You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Mark Porter <ma...@canlink.com> on 2000/04/27 17:45:12 UTC

dynamic properties?

Hi all,

Firstly, great work... ANT rocks! Secondly, I'm about to write my first
ant task and as such I'd like to be able to add properties to a project
as a result of the task execution. In my task I've instantiated some
Property objects and called setName() and setValue() but they dont seem
to get 'registered' with the project as a whole. What am I missing or is
this not possible? Thanks!

Mark

--
Mark D. Porter BSc.,
Software Developer
CanLink Interactive Technologies
mark.porter@canlink.com
http://www.canlink.com



Re: dynamic properties?

Posted by Stefan Bodewig <bo...@bost.de>.
Hi Mark,

you've been tricked by one of the most confusing features of Ant, but
read on ...

>>>>> "MP" == Mark Porter <ma...@canlink.com> writes:

 MP> Secondly, I'm about to write my first ant task and as such I'd
 MP> like to be able to add properties to a project as a result of the
 MP> task execution.

The current situation:

You can add properties at task runtime but the ${...} constructs in
your build file are replaced at parse time, so you won't see the
effects unless the later running tasks explicitly ask the project for
some property's value.

There is wide agreement that this is no ideal situation. Take a look
at spec/core.html in Ant's CVS tree to see what Ant is heading
to. This document hasn't been carved into stone yet so feel free to
comment, propose changes ...

Stefan