On 12/15/06, Anderson, Rob (Global Trade) <[EMAIL PROTECTED]> wrote:
A simpler approach is to check the existence of a variable, and ignore
the value. This may or may not work for your situation, but consider it.
<property environment="env"/>
<target name="do.stuff" if="${env.SOMEVARIABLE}">
Should be if="env.SOMEVARIABLE"
I.e the name of the property and not its value.
Peter
...
Perhaps the non-existence of the variable would provide the "false"
condition...
<target name="do.otherstuff" unless="${env.SOMEVARIABLE}">
...
-Rob Anderson
> -----Original Message-----
> From: Chun Tat David Chu [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 15, 2006 7:56 AM
> To: user@ant.apache.org
> Subject: How to construct condition statement?
>
> Hi,
>
> I'm trying to construct a condition statement in ANT, and I'm
> stuck. Any help or suggestion would be great!
>
> What I am trying to do is to check an environmental variable,
> and if it is set to "TRUE", then I want to set a field to
> another text.
>
> ex. (sorry, I'm new at ANT, I'll use pseudo code to demonstrate)
>
> STRING location = "xxx";
>
> IF (CONDITION == TRUE)
> location = "yyy";
>
> I really hope to achieve this using ANT straight from the box
> without downloading additional libraries/plug-in
>
> Thanks!
>
> - dc
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]