ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Nested Variables in ANT?
Date Wed, 09 Jun 2004 14:50:32 GMT

On Jun 9, 2004, at 10:25 AM, Mattos, John wrote:
> <target name="dev-target">
>       <echo massage = "${location.dev}>
> </target>
>
> <target name="qa-target">
>       <echo massage = "${location.qa}>
> </target>
>
> I have a variable called ${envir} and I'd like to do something like
>
> <target name="general-target">
>       <echo massage = "${location.${envir}}>
> </target>
>
>
> Can I do anything like this? It doesn't seem to like the nested ${} 's
>

A cleaner solution is to have a qa.properties file and a dev.properties 
file.

    <property name="envir" value="dev"/>
    <property file="${envir}.properties"/>

To run for QA, use:

	ant -Denvir=qa

Place whatever properties need to be different into each of those files 
appropriately (location, for example).

Erik



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


Mime
View raw message