ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <Rob.Ander...@nike.com>
Subject RE: How to construct condition statement?
Date Fri, 15 Dec 2006 19:08:58 GMT
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}">
...

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:beyonddc.storage@gmail.com] 
> 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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message