I have a question regarding ANT and its treatment of environment variables. To illustrate I have a small sample.
Given the ANT file test.xml:
<property environment="env"/>
<target name="testProps">
<echo message="${env.MyEnvVar}"/>
<echo message="${MY_PROPERTY}"/>
</target>
And the properties file test.props:
MY_PROPERTY=${env.MyEnvVar}
Now set the environment variable MyEnvVar to some value (foo in my case) and run the command line:
ant -f test.xml -propertyfile test.props testProps
The output I get is:
[echo] foo
[echo] ${env.MyEnvVar}
What I would like to know is whether there is any way to structure the input properties file such that I get
[echo] foo
[echo] foo
That is I would like to name an environment variable in the properties file which is replaced within the ANT script. Note - I know how to access environment variables directly (as is done here). What I need to do is make use of a set of ANT scripts that expect one collection of properties in an environment that defines the same properties using different names. Thus the thought of "bridging" them in a properties file.
I am using ANT 1.6.5.