Comments (2)
delegate is an implicit variable scoped to the current closure.
Writing:
nuspec { delegate.foo() }
is the same as
nuspec { foo() }
but being explicit about the fact that you want to use the method resolving on the XMLBuilder (that is the XML building DSL).
This is needed as gradle scripts already define some methods (file/files) that'll be called otherwise as they're part of any script scope.
In your case as you got out of the XMLBuilder closure (you're in the each) closure, the XMLBuilder delegate is no longer available and your stack show that you use Script.file instead of XMLBuilder.file.
Try this instead:
delegate.files {
def filesXmlNode = delegate;
fileTree(msbuild.destinationDir).each { File entry ->
filesXmlNode.file(src: entry, target: 'lib')
}
}
Should work I think.
from gradle-nuget-plugin.
Thanks for the explanation! That worked nicely. I will close this issue.
from gradle-nuget-plugin.
Related Issues (20)
- Allow ad-hoc location to NuGet Executable HOT 3
- Project configuration fails without nugetSources section in build.gradle HOT 4
- Plugin cannot be released by gradle 4.9
- Timescale for 2.18? HOT 1
- Plugin won't work for Azure NuGet 3
- HOTWO nugetSpec and list of files? HOT 1
- The process cannot access the file 'fileContent.lock' because it is being used by another process HOT 1
- The distsDir method has been deprecated. This is scheduled to be removed in Gradle 6.0.
- Property is not annotated with an input or output annotation. This behaviour has been deprecated and is scheduled to be removed in Gradle 7.0. HOT 3
- Could not generate a decorated class for type NuGetPush HOT 4
- nugetRestore also triggers nugetSources with error HOT 1
- Solution file argument isn't being passed
- Gradle 7.0 - No such property: UPLOAD_GROUP HOT 1
- deprecated feature warning in Gradle 7.0.2
- Additional task "nugetInstall"
- nugetPack.basePath incorrect annotated as a file
- NuGetPack.getIdFromMsbuildTask got broken by csprojPath type change
- Collision when downloading nuget in multiple sub projects HOT 1
- Could not set unknown property 'nugetExePath' for extension 'nuget' of type com.ullink.NuGetExtension. HOT 1
- Gradle 8 - update version and use providers on Task objects
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-nuget-plugin.