ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject RE: Multiple conditions satisfying in an ant target
Date Fri, 31 Oct 2008 08:01:07 GMT

-----Original Message-----
From: sukanya [mailto:sukanyadevik@yahoo.co.in]
Sent: Friday, October 31, 2008 8:48 AM
To: user@ant.apache.org
Subject: Multiple conditions satisfying in an ant target

/*
[...]
<condition property="iswow">
 <equals arg1="wow" arg2="wow" trim="true"/>
</condition>

<condition property="isbad">
 <equals arg1="bad" arg2="bad" trim="true"/>
</condition>
</target>



  <target name="antcall"  unless="iswow" >

        <echo>Start something new</echo>
</target>


Here how do i inclue isbad also as an unless condition to the same target
antcall?
*/

The unless/if attributes from target takes only only one value, so you have
to combine your conditions like that =

<condition property="yourcondition">
<and>
<equals arg1="wow" arg2="wow" trim="true"/>
<equals arg1="bad" arg2="bad" trim="true"/>
</and>
</condition>

  <target name="antcall"  unless="yourcondition" >

        <echo>Start something new</echo>
</target>


Regards, Gilbert

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


Mime
View raw message