ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: project.replaceProperties()
Date Wed, 30 Sep 2009 08:45:41 GMT
On 2009-09-30, Raja Nagendra Kumar <> wrote:

> Stefan, you are correct.. We did make few modifcations to ant source and this
> has side effect else where..

> We are trying to support multiple property references resolutions with in a
> string some thing like this..

> Project p = getProject();
> p.setProperty("nagrama", "nagiest");
> p.setProperty("n", "nag");
> p.setProperty("m", "rama");
> p.replaceProperties("${${n}${m}}")//${${n}rama}

You will want Ant's trunk and a PropertyExpander like


You can't have nested properties with Ant 1.7.1, but since you are
modifying Ant's source code anyway, you might as well switch to Ant's
trunk now - a release shouldn't be too far into the future.

> Pl. observe that there is misbehavior of replace properties.. i.e 2nd one
> gets replaced but not the first one..

No, there is not.  Ant parses ${} constructs by searching up to the next
closing brace, ignoring any newly opened ones by default.

${${n}${m}} is turned into

"value of property ${n" + "value of property m" + "literal }"

and since there is no property named "${n" it is expanded to ${${n}


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message