ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Project.setProperty(String,String)?
Date Wed, 27 Jun 2001 07:00:19 GMT
Bram Smeets <> wrote:

> I did some further investigation and the property gets changed every
> token found.
> So, how come the target which consists of:
> <target name="testing">
>   <echo message="${engine}"/>
> </target>
> still prints the former token??

Read the Life-cycle of a Task section in Developing with Ant in the
manual - especially item 10 (in the CVS version, that is).

The echo task will be configured using setMessage once, this is when
you run the target for the first time. Property expansion is
transparent to the task writer, which means the echo task doesn't see
${engine} but the value of the property at this time.

When you run the same target a second time, setMessage will not be
invoked again - this is not related to mutable or immutable properties
at all.

To work around this, you'll have to reconfigure all tasks in the
target you intend to run yourself.


View raw message