ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian McCann" <>
Subject How change variable based on environment variable value
Date Mon, 06 Jun 2011 15:45:37 GMT
Below is xml from my build.xml file. I'm trying to set a property value
based on the condition
that the build.xml file is being run on the build box. I created a system
variable and set it to true on a Win XP SP3 build system.
I tested this part of the xml and the code " <echo>${env.BUILD_BOX}</echo>"
works and returns the correct value of "True"
for the variable "${env.BUILD_BOX}". The problem is the second target
"setJOF" is not setting the "JOF" property value to
The xml "<echo>${JOF}</echo>" returns no value. 

In a nutshell I'm trying to do is check if the buld.xml is running on the
buildbox (not a developers box). If it's running on the buildbox change the
value of a property to 
a path unique to the buildbox which overrides the path property value in the file. If it's not running on the buildbox use the
value of the 
property set in the file.

Any help on this would be greatly appreciated.


Build.xml :         

                <!-- check for value of BUILD_BOX -->

      <target name="checkbuildbox" description="Checks if the build is
running on the Build Machine">

                                                <!-- check to see that the
property gets set -->


                                                <property name="BUILD_BOX"




  <target name="setJOF" if="${env.BUILD_BOX}">

    <property name="JOF" value="F:/Inetpub/wwwroot/wo30"/>





  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message