Ant script
<property environment="env">
<if> <equals arg1="${env.PARA} arg2=""/>
<then>
<property name="${env.PARA}" value="abc"/>
<then>
<if>
<echo message="${env.PARA}">
Output is
${env.PARA}
Expected output is
abc
I have not defined the environment variable PARA in dos. How to get the expected output.
Note : I am using ant 1.8.2 and antcontrib in windows 7
The following is the “ANT way” to conditionally set properties.
Testing
I’m a linux user, however, it should work the same on windows.
No environment variable
environment variable