ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raja Nagendra Kumar <Nagendra.R...@tejasoft.com>
Subject Re: project.replaceProperties()
Date Wed, 30 Sep 2009 07:51:59 GMT

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}
p.replaceProperties("${${m}${n}}") //${${m}nag}
p.replaceProperties("${${n}${m}${n}}")//${${n}ramanag}
p.replaceProperties("${nag${m}}")//${nag${m}}
p.replaceProperties("${nag${m}${n}}")//${nag${m}nag}
p.replaceProperties("${nag${m}${n}${m}}")//${nag${m}nagrama}
p.replaceProperties("${nag${m}${${n}${m}}}")//${nag${m}${${n}rama}}

the one in comments is current behaviors in original ant code.
Pl. observe that there is misbehavior of replace properties.. i.e 2nd one
gets replaced but not the first one..

May be it would be nice for properties and replaceProperties to support such
multi level property resolutions.

We are seeing such need to define the properties based on the module id,
this helps in writing macros and custom tasks based generic property names.

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com










Stefan Bodewig wrote:
> 
> On 2009-09-27, Raja Nagendra Kumar <Nagendra.Raja@tejasoft.com> wrote:
> I haven't tested this but I'm pretty sure replaceProperties("${foo}")
> returns "${foo}" if there is no property named "foo", doesn't it?
> 

-- 
View this message in context: http://www.nabble.com/project.replaceProperties%28%29-tp25631397p25676498.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message