ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chun Tat David Chu" <beyonddc.stor...@gmail.com>
Subject Re: How to construct condition statement?
Date Mon, 18 Dec 2006 00:58:23 GMT
Thanks Peter, I used your approach and it works great!

On 12/15/06, Peter Reilly <peter.kitt.reilly@gmail.com> wrote:
>
> 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
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message