ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject Re: Possible to dynamically reference a property?
Date Tue, 25 Jan 2011 22:12:14 GMT
On Tue, Jan 25, 2011 at 3:39 PM, Dominique Devienne <> wrote:
> On Tue, Jan 25, 2011 at 3:32 PM,  <> wrote:
>> Then I pass in this command line argument to my script "-Denv=...".  So, in my ant
script, how do I dynamically access a property using the ${env} param?  For example, if "-Denv=dev"
is passed in to the command line, what is a generic way of accessing the property, "dev.baseurl"?
> See

Note that an alternative is to split your property file into several,
one per "prefix". Then you only have to <property
file="${env}.properties" /> and simply refer to the prefix-less
properties 'baseurl'. Put common (or default) properties into another
file yet, and load both in order, keeping in mind that the first
property defined "wins".

There's also <propertyset> which can work with prefixes and remove
them, but I don't think it applies here. --DD

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

View raw message