ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prad...@almarea.com
Subject dynamically reading a property file
Date Wed, 11 Apr 2007 20:53:31 GMT
Hi there,

Using ant, how can I dynamically read a property file?

e.g.

<property prefix="myprop" file="${base.dir}/config/properties/myprop.properties" />

so now to reference a property in that file

foo=bar

All I have to do is

<echo>${myprop.foo}</echo>   // prints bar

however, I don't know how to do something like this

envAll=abc,def

abc=abhay
def=pradhan


now, say I pass in -Denv=abc, something like this, dosen't work..

<echo>${myprop.${env}.abc}</echo>

where ${env} can be either abc or def

am I doing something stupid?

cheers
Abhay

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


Mime
View raw message