Bug 42970 - ${ant.version} not set after <ant ... inheritAll="false">
${ant.version} not set after <ant ... inheritAll="false">
Status: RESOLVED DUPLICATE of bug 42263
Product: Ant
Classification: Unclassified
Component: Core
1.7.0
PC Windows XP
: P2 normal (vote)
: ---
Assigned To: Ant Notifications List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2007-07-25 03:19 UTC by dave
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dave 2007-07-25 03:19:25 UTC
Apache Ant version 1.7.0 compiled on December 13 2006

If you take the two files below and run ant on build.xml:
- on Ant 1.6.5, ${ant.version} is set in second.xml
- on Ant 1.7.0, ${ant.version} is NOT set in second.xml

All the other ${ant.xxx} properties (ant.file etc) are set in second.xml, so
this appears to be an unintentional change. It can be worked around easily
enough of course, by passing the property explicitly.

--- build.xml ---
<project>
<echo>build.xml - ${ant.version}</echo>
<ant antfile="second.xml" inheritAll="false"/>
</project>
------

--- second.xml ---
<project>
  <echo>second.xml - ${ant.version}</echo>
</project>
------

Outputs:

D:\antbug>set ANT_HOME=C:\tools\apache-ant-1.6.5

D:\antbug>%ANT_HOME%\bin\ant
Buildfile: build.xml
     [echo] build.xml - Apache Ant version 1.6.5 compiled on June 2 2005
     [echo] second.xml - Apache Ant version 1.6.5 compiled on June 2 2005

BUILD SUCCESSFUL
Total time: 0 seconds
D:\antbug>set ANT_HOME=C:\tools\apache-ant-1.7.0

D:\antbug>%ANT_HOME%\bin\ant
Buildfile: build.xml
     [echo] build.xml - Apache Ant version 1.7.0 compiled on December 13 2006
     [echo] second.xml - ${ant.version}

BUILD SUCCESSFUL
Total time: 0 seconds
Comment 1 Peter Reilly 2007-07-25 03:41:03 UTC

*** This bug has been marked as a duplicate of 42263 ***