You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Keith Hatton <kh...@axiomsystems.com> on 2008/03/03 10:53:23 UTC

task, inheritAll=false and ant.version property

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


Re: task, inheritAll=false and ant.version property

Posted by Peter Reilly <pe...@gmail.com>.
This is a bug in ant 1.7.0, it has been fixed
and will be in the soon to be released 1.7.1.
https://issues.apache.org/bugzilla/show_bug.cgi?id=42263
Peter

On Mon, Mar 3, 2008 at 9:53 AM, Keith Hatton <kh...@axiomsystems.com> wrote:
> 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
>
>

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