Use a condition task:

<condition
    property="Build"
    value="Build">
    <not>
        <isset property="ENV.BUILD">
   </not>
</condition>
<property "Build" value="${ENV.BUILD}"/>

The above should work. If ENV.BUILD isn't set, Build will be set. If
it is set, then the property "Build" won't be set. The <property> task
below the <condition> task won't change the value of the property
"Build" if "Build" already has a value.

On Feb 3, 2008 4:48 PM, Francisco Tolmasky <[EMAIL PROTECTED]> wrote:
> I'd like to use an environment variable for my build directory if it
> exists, basically:
>
> <property environment = "ENV" />
> <property name = "Build" value = "${ENV.BUILD}" />
>
> However, I also want a default Build directory "Build", if ENV.BUILD
> doesn't exist, how
> do I do this given that setting the property cannot be undone?
>
> Thank you,
>
> Francisco
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
--
David Weintraub
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to