Bug 42970

Summary: ${ant.version} not set after <ant ... inheritAll="false">
Product: Ant Reporter: dave
Component: CoreAssignee: Ant Notifications List <notifications>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P2    
Version: 1.7.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

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 ***