ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sunil Goklani" <>
Subject Dynamic references to properties files
Date Sat, 20 May 2006 01:05:47 GMT
Hi All,

I had a question on how I could use two variables to access information from 
my properties files.  I am trying to build an ant script to generate 
configuration files for all of my development, qa, and staging environments.

For example I have the following in a properties file:

#Configuration for adapterconfig.xml

The first property is what developers use and check/label into the cvs.  The 
other values are what I am supposed to have for my respective environments.

Suppose I input "-Dset.environment=assem1" as a command line argument.  Is 
there a way possible for me to access the value of 
${assem1-adapterconfig.webpath} with a variable combination of 

I tried it like that and I got an error because it was replacing the actual 
value of "adapterconfig.webpath" before it even got to where I wanted it to.

Second approach:

I created a temp property and built out the correct string
<property name="p-temp" 
the and set.close are the ${ and } respectively.  However now in my 
destination file, it actually replaces with: 
"${assem1-adapterconfig.webpath}" and not the value itself.  Is there anyway 
I can make ant recognize this string as a property?

Thanks all in advance!

Express yourself instantly with MSN Messenger! Download today - it's FREE!

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

View raw message