ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: if/else structure
Date Wed, 08 May 2002 18:54:11 GMT
Then use <equals> instead of <contains>, possibly with an <or> to check for
several exact matches (beta1, beta2, etc...). It exists in 1.4.1 for sure,
and without 'since version x.y' info in *the* online docs, nor online docs
for all past released version of ANT, it's hard to tell whether is available
for older version of ANT... --DD

-----Original Message-----
From: Michael_Luu@NAI.com [mailto:Michael_Luu@NAI.com] 
Sent: Wednesday, May 08, 2002 1:49 PM
To: ant-user@jakarta.apache.org
Subject: RE: if/else structure

the problem is that earlier versions of ant doesn't support the nested
contains element. :)

i guess the most simple solution is to force everyone to update their build
environment to use ant1.5Beta1.

mike

-----Original Message-----
From: Diane Holt [mailto:holtdl@yahoo.com]
Sent: Wednesday, May 08, 2002 11:40 AM
To: Ant Users List
Subject: Re: if/else structure


--- Michael_Luu@NAI.com wrote:
> does anyone know if you're able to perform an if/else structure in ant?
> 
> i want to execute a target if the current version of ant is 1.5Beta1.

The if/unless attributes of a <target> check for whether the named
property is set (to any value), so to do an "if" on whether a property is
set to a specific value, you need to conditionally set a property using
the <condition> task, then use that property in your <target>'s if/unless.
For example:

  <target name="whatever" if="is1.5" depends="chkVersion">
    ...
  </target>

  <target name="chkVersion">
    <condition property="is1.5" value="true">
      <contains string="${ant.version}" substring="1.5Beta1"/>
    </condition>
  </target>

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

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

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

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


Mime
View raw message