Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.5, 1.5.8, 1.6.4, 1.7-beta-1
-
Fix Version/s: 1.7-beta-2, 1.6.6
-
Component/s: Ant integration
-
Labels:None
-
Environment:Windows and Linux
Java 1.5
Ant 1.6.5
-
Number of attachments :
Description
From the mailing list wrap-up post by Dierk:
<quote>
def ant = new AntBuilder()
ant.ant(antfile:'build.xml'){
target(name:'one')
}
is working but
def ant = new AntBuilder()
ant.ant(antfile:'build.xml'){
target(name:'one')
target(name:'two')
}
is not. The flag 'targetAttributeSet' is set erroneously in org.apache.tools.ant.taskdefs.Ant#addConfiguredTarget.
(possible Ant bug?)
</quote>
(Having looked at the Ant source myself, I can only see targetAttributeSet being set in setTarget, so personally I suspect it's not an Ant bug.)
To find the mailing list thread, search for a subject of "AntBuilder.ant.target not working?" on Feb 23rd/24th 2006. (Web access to mailing list is down right now, hence the lack of URL.)
Attachments
Issue Links
| This issue supercedes: | ||||
| GROOVY-1260 | Using the Ant task with multiple targets fails |
|
|
|
def ant = new AntBuilder()
ant.ant(antfile: 'build.xml') {
target(name: 'one')
}
–
<project name="testprj" default="three">
<target name="one">
<echo message="Target ONE"/>
</target>
<target name="two">
<echo message="Target TWO"/>
</target>
<target name="three">
<echo message="Target DEFAULT"/>
</target>
</project>
–
groovyant/test.groovy
groovyant$ ant -version
Apache Ant version 1.7.1 compiled on July 16 2009
groovyant$ groovy -version
Groovy Version: 1.6.3 JVM: 1.6.0_15
groovyant$ groovy test.groovy
three:
[echo] Target DEFAULT
groovyant$