You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I do this, I get the error below. Using delegate.file on the same files outside the above closure works fine, however.
Caused by: org.gradle.internal.typeconversion.UnsupportedNotationException: Cannot convert the provided notation to a File or URI: {src=build\msbuild\bin\log4net.dll, target=lib}.
The following types/formats are supported:
A String or CharSequence path, e.g 'src/main/java' or '/usr/include'
A String or CharSequence URI, e.g 'file:/usr/include'
A File instance.
A URI or URL instance.
at org.gradle.internal.typeconversion.ErrorHandlingNotationParser.parseNotation(ErrorHandlingNotationParser.java:55)
at org.gradle.api.internal.file.AbstractFileResolver.convertObjectToFile(AbstractFileResolver.java:184)
at org.gradle.api.internal.file.BaseDirFileResolver.doResolve(BaseDirFileResolver.java:69)
at org.gradle.api.internal.file.AbstractFileResolver.resolve(AbstractFileResolver.java:77)
at org.gradle.api.internal.file.AbstractFileResolver.resolve(AbstractFileResolver.java:60)
at org.gradle.api.internal.file.DefaultFileOperations.file(DefaultFileOperations.java:72)
at org.gradle.api.internal.project.AbstractProject.file(AbstractProject.java:637)
at org.gradle.groovy.scripts.DefaultScript.file(DefaultScript.java:110)
The text was updated successfully, but these errors were encountered:
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.
Is this behavior supported? I'd like to automatically declare all files in a specific directory without having to list each specific one, e.g.
When I do this, I get the error below. Using delegate.file on the same files outside the above closure works fine, however.
Caused by: org.gradle.internal.typeconversion.UnsupportedNotationException: Cannot convert the provided notation to a File or URI: {src=build\msbuild\bin\log4net.dll, target=lib}.
The following types/formats are supported:
at org.gradle.internal.typeconversion.ErrorHandlingNotationParser.parseNotation(ErrorHandlingNotationParser.java:55)
at org.gradle.api.internal.file.AbstractFileResolver.convertObjectToFile(AbstractFileResolver.java:184)
at org.gradle.api.internal.file.BaseDirFileResolver.doResolve(BaseDirFileResolver.java:69)
at org.gradle.api.internal.file.AbstractFileResolver.resolve(AbstractFileResolver.java:77)
at org.gradle.api.internal.file.AbstractFileResolver.resolve(AbstractFileResolver.java:60)
at org.gradle.api.internal.file.DefaultFileOperations.file(DefaultFileOperations.java:72)
at org.gradle.api.internal.project.AbstractProject.file(AbstractProject.java:637)
at org.gradle.groovy.scripts.DefaultScript.file(DefaultScript.java:110)
The text was updated successfully, but these errors were encountered: