ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Bucanek <>
Subject Property substitutions, Contributed Tasks, & New features
Date Mon, 08 Jan 2001 17:04:06 GMT

Does anyone know where I can find:

(a) A place to find or post contributed Ant Tasks?

(b) A place to find out what new features are being added, or 
considered, for the next version of Ant?

I ask because I've been somewhat annoyed that Project.getProperty() 
doesn't perform substitutions ("bla bla ${prop}").  It's up to the 
code that sets the property to make the substitution before setting 
the value.

This makes it impossible to make forward references in property 
values because the property substitution has to be preformed prior to 
setting the value.  Nor can the substitution value be modified at 

To resolve this in the short term, I wrote a ResolveProperties Task 
that rattles through the Project's properties and fixed up all of the 
references.  So, coming back to (a), it would seem likely that 
someone else might want something like this and I'd like to made that 
available to the Ant community in general.

On a side note, my code also resolves substitutions in the property's 
name as well.  This lets me get around the limitation of the 'if=' 
clause of targets that only test to see if a property has been 
defined, not it's value (true or false).  I can now create two 


When ResolveProperties is finished, I'll have two properties defined: 
needsManifest=true and needsManifest-true=whatever.  Now I can 
happily write <target name="buildManifest" if="needsManifest-true">...

Getting back to (b), I would strongly suggest that 
Project.getProperty() (or Project.getResolvedProperty(...)) be 
modified to perform the property value substitution on the fly. 
About the only thing you'd need to do is put a cap on the iteration 
depth to catch circular substitutions.

So, how does one go about suggesting such a change?  And, more 
importantly, how do you find out if a such a change has already been 
proposed or implemented?


James Bucanek

View raw message