Bug 55831

Summary: Augment task noop behavior after first invocation
Product: Ant Reporter: rich
Component: Core tasksAssignee: Ant Notifications List <notifications>
Status: NEW ---    
Severity: critical    
Priority: P2    
Version: 1.9.4   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description rich 2013-12-01 12:58:37 UTC
With this build file:

<project name="augment-test">

<target name="init"> <path id="inner"/>

<path id="outside"> <path refid="inner"/> </path> </target>

<target name="update-paths"> <augment id="inner"> <fileset dir="lib"/> </augment> </target>

<target name="a" depends="init, update-paths"> <echo message="${toString:inner}" /> </target>

<target name="b" depends="init, update-paths"> <echo message="${toString:outside}" /> </target>

</project>

If I invoke target "b" I get a response I expect:

C:\augment-test>ant b Buildfile: C:\augment-test\build.xml

init:

update-paths:

b: [echo] C:\augment-test\lib\A.jar;C:\augment-test\lib\B.jar

However, if I call it with both "a" and "b" the value of the "outer" path is empty:

C:\augment-test>ant a b Buildfile: C:\augment-test\build.xml

init:

update-paths:

a: [echo] C:\augment-test\lib\A.jar;C:\augment-test\lib\B.jar

init:

update-paths:

b: [echo]

If I reverse the targets then I get a similar result, however now the inner path is empty and outer is OK:

C:\augment-test>ant b a Buildfile: C:\augment-test\build.xml

init:

update-paths:

b: [echo] C:\augment-test\lib\A.jar;C:\augment-test\lib\B.jar

init:

update-paths:

a: [echo]

This happens with both 1.8.4 and 1.9.2 on 64-bit Windows 7.