Hello,

I tried looking in the archives (covalent.net?) 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 thereafter.

Concrete example: I have a file that looks like this

@[EMAIL PROTECTED]
@[EMAIL PROTECTED]
@[EMAIL PROTECTED]

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

[EMAIL PROTECTED]@

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 @myProperty.foo@ 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 task).

Help? I am running Ant 1.1

Thanks,

Alex


_________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at http://profiles.msn.com.



Reply via email to