ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Hatton" <khat...@axiomsystems.com>
Subject <ant> task, inheritAll=false and ant.version property
Date Mon, 03 Mar 2008 09:53:23 GMT
It seems that something has changed between Ant 1.6.2 and 1.7.0 in the
way the ant.version property is handled when another build file is
invoked using the <ant> task.

Given the following files:
main-build.xml:
<project name="test-case-main-build" default="main-build">
    <target name="main-build">
        <echo>Ant version is ${ant.version}</echo>
        <ant antfile="sub-build.xml" inheritAll="false"/>
    </target>
</project>

sub-build.xml:
<project name="test-case-sub-build" default="sub-build">
    <target name="sub-build">
        <echo>Ant version is ${ant.version}</echo>
    </target>
</project>

I get the following results:
Ant 1.6.2:
C:\...>ant -f main-build.xml
Buildfile: main-build.xml

main-build:
     [echo] Ant version is Apache Ant version 1.6.2 compiled on July 16
2004

sub-build:
     [echo] Ant version is Apache Ant version 1.6.2 compiled on July 16
2004

But with Ant 1.7.0:
C:\...>ant -f main-build.xml
Buildfile: main-build.xml

main-build:
     [echo] Ant version is Apache Ant version 1.7.0 compiled on December
13 2006


sub-build:
     [echo] Ant version is ${ant.version}


Is this an Ant bug? It seems reasonable that ant.version should not be
inherited, but I would have expected the new Ant "environment" to detect
its own version and set the property (and maybe other ant.* properties
too), and clearly it did that before.

Thanks,
Keith


Axiom Systems Limited is a limited company registered in England and
Wales. Registered number: 2358771. Registered office: One Forbury
Square, The Forbury, Reading, Berks RG1 3EB

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message