ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Unexpected <augment> behavior
Date Sat, 30 Nov 2013 16:20:29 GMT
On 2013-11-27, Steele, Richard wrote:

> I've run into an odd behavior that I'm assuming is a defect but I'd
> like to confirm.

Looks like one, yes.

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


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

augment is a very special task in many ways, in particular it doesn't
perform it's work in the execute method but while the representation of
the piece of XML that makes up the task is mapped to a Java object tree.

If you execute a target twice, this translation only happens once, so
the second invocation is a NOOP.  But this is an implementation detail
that users should never have to deal with, so in a way it is a defect.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message