Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Core
-
Labels:None
-
Number of attachments :
Description
I am executing some Ant targets via Gant in a Grails script.
I've noticed that gant fails for nested elements that are 2 or more deep.
e.g. the following example from this page: http://groovy.codehaus.org/Using+Ant+from+Groovy
value = ant.path {
fileset(dir: "mybuild") {
include(name: "**/*.js")
}
}
fails with this error:
Error executing script TestApp: path doesn't support the nested "include" element. gant.TargetExecutionException: path doesn't support the nested "include" element. at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:331) at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334) at gant.Gant$_dispatch_closure6.doCall(Gant.groovy) at gant.Gant.withBuildListeners(Gant.groovy:344) at gant.Gant.this$2$withBuildListeners(Gant.groovy) at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source) at gant.Gant.dispatch(Gant.groovy:334) at gant.Gant.this$2$dispatch(Gant.groovy) at gant.Gant.invokeMethod(Gant.groovy) at gant.Gant.processTargets(Gant.groovy:495) at gant.Gant.processTargets(Gant.groovy:480) Caused by: path doesn't support the nested "include" element. at org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:359) at org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:198) at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160) at BuildConfig$_run_closure1_closure2.doCall(BuildConfig.groovy:33) at _Events$_run_closure4.doCall(_Events.groovy:72) at _GrailsEvents_groovy$_run_closure5.doCall(_GrailsEvents_groovy:58) at _GrailsEvents_groovy$_run_closure5.call(_GrailsEvents_groovy) at _GrailsTest_groovy$_run_closure1.doCall(_GrailsTest_groovy:214) at TestApp$_run_closure1.doCall(TestApp.groovy:102) at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324) ... 10 more Caused by: The <path> type doesn't support the nested "include" element. at org.apache.tools.ant.IntrospectionHelper.throwNotSupported(IntrospectionHelper.java:447) at org.apache.tools.ant.IntrospectionHelper.getNestedCreator(IntrospectionHelper.java:506) at org.apache.tools.ant.IntrospectionHelper.getElementCreator(IntrospectionHelper.java:567) at org.apache.tools.ant.UnknownElement.handleChild(UnknownElement.java:546) at org.apache.tools.ant.UnknownElement.handleChildren(UnknownElement.java:346) ... 19 more Error executing script TestApp: path doesn't support the nested "include" element. Application context shutting down...
By changing that code to:
value = ant.path {
ant.fileset(dir: "mybuild") {
include(name: "**/*.js")
}
}
all works fine. ie. changing fileset to ant.fileset is a work around for this.
This is occurring under grails 1.2.1 . I am not certain which version of GANT is being used there - I would be using the default GANT that is shipped with grails 1.2.1 however.
Cheers,
Nick