ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Smith" <>
Subject Eager evaluation of properties
Date Thu, 28 Sep 2000 15:37:45 GMT

I tried looking in the archives ( except that I couldn't find 
them :)

I am trying to substitute a value twice where the second substitution is 
based on the results of the first. This amounts to a recursive evaluation 
and since I can't do this with tokens, I am trying a hack with properties. 
It almost works except that I am being foiled by properties-evaluate-first 
mechanism, even if I define a property after my first substitution that 
generates the property file which contains the desired properties referenced 

Concrete example: I have a file that looks like this

where 'foo', 'bar' and 'baz' are users on my box. I have another file that 
looks like this


and I want @myProperty@ to be replaced with '10' if I am user 'foo'. To this 
end I copy the first file to a temporary location, substituting all tokens 
that match with the string 'targetProperty'. Then I 
reference this newly built property file with <property file="..."> and copy 
the second file while substituting @myProperty@ with ${myProperty}. The last 
step doesn't work because ${myProperty} is empty since the property task 
read the file in before it was created...even though <property file="..."> 
is defined after the task that created the file referenced therein. (I also 
trying explicit dependency instead of defining one after another in the same 

Help? I am running Ant 1.1



Get Your Private, Free E-mail from MSN Hotmail at

Share information about yourself, create your own public profile at

View raw message