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 Sat, 16 Dec 2006 00:29:51 GMT
Indeed. Thanks Peter.

-Rob A 

> -----Original Message-----
> From: Peter Reilly [mailto:peter.kitt.reilly@gmail.com] 
> Sent: Friday, December 15, 2006 11:52 AM
> To: Ant Users List
> Subject: Re: How to construct condition statement?
> 
> On 12/15/06, Anderson, Rob (Global Trade) 
> <Rob.Anderson@nike.com> 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: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
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For 
> additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 


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


Mime
View raw message