ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scot P. Floess" <sflo...@nc.rr.com>
Subject Re: How change variable based on environment variable value
Date Mon, 06 Jun 2011 16:08:48 GMT

Any chance we can see the complete build.xml?

On Mon, 6 Jun 2011, Brian McCann wrote:

> Hi,
> 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
> "F:/Inetpub/wwwroot/wo30".
> 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
> build.user.properties file. If it's not running on the buildbox use the
> value of the
> property set in the build.user.properties file.
>
> Any help on this would be greatly appreciated.
> Thanks,
>
> BPM
>
> 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
> environment="env"/>
>
>                                                <property name="BUILD_BOX"
> value="${env.BUILD_BOX}"/>
>
>
> <echo>${env.BUILD_BOX}</echo>
>
>      </target>
>
>
>
>  <target name="setJOF" if="${env.BUILD_BOX}">
>
>    <property name="JOF" value="F:/Inetpub/wwwroot/wo30"/>
>
>                <echo>${JOF}</echo>
>
>   </target>
>
>
>
> build.userproperties:
> JOF=C:/Inetpub/wwwroot/wo30
>
>
>
>

Scot P. Floess             RHCT  (Certificate Number 605010084735240)
Chief Architect FlossWare  http://sourceforge.net/projects/flossware
                            http://flossware.sourceforge.net
                            https://github.com/organizations/FlossWare

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


Mime
View raw message