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:46:31 GMT

I don't see how either target checkbuildbox nor setJOF is called...  Your 
default target is set to "build" - how are you executing when you run ant?

I'd like to see your depends, etc...


On Mon, 6 Jun 2011, Brian McCann wrote:

> Hi,
> This is the complete build.xml file.
>
> Thanks,
> BPM
> ==========================================================
> <project name="Buildbox" default="build" basedir=".">
>    <!--
>        Import a special target set for master build files.
>        This overrides the standard targets defined in
>        build-common-targets which is pulled in through
>        the build-imports.xml process.
>    -->
>
>    <!--<import file="tools/build-master-targets.xml" />
>    <import file="build-imports.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>
>
>
>    <!--
>        A filelist defines an ordered list that is used to
>        encode the project build order that should be used
>    -->
>    <!--<filelist id="children.filelist" dir=".">
>        <file name="JOF"/>
>    </filelist>-->
> </project>
> ==========================================================================
>
> -----Original Message-----
> From: Scot P. Floess [mailto:sfloess@nc.rr.com]
> Sent: Monday, June 06, 2011 12:09 PM
> To: Ant Users List
> Subject: Re: How change variable based on environment variable value
>
>
> 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
>
>

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