You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jack Woehr <ja...@purematrix.com> on 2001/08/22 23:01:01 UTC
Conditionals
I'd like to do <if testproperty="some.prop" testvalue="doIt" trueantcall="some_target"
falseantcall="another_target"/>
What's the closes thing I can do to this in Ant?
--
Jack J. Woehr # "I never worry that all hell will break loose.
Senior Consultant # I worry that half hell will break loose, which
Purematrix, Inc. # is much harder to detect." - George Carlin
Re: Conditionals
Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 22 Aug 2001, Jack Woehr <ja...@purematrix.com> wrote:
> I'd like to do <if testproperty="some.prop" testvalue="doIt"
> trueantcall="some_target" falseantcall="another_target"/>
>
> What's the closes thing I can do to this in Ant?
<target name="check">
<condition property="testprop">
<equals arg1="${some.prop}" arg2="doIt" />
</condition>
</target>
<target name="some_target" depends="check" if="testprop" />
<target name="another_target" depends="check" unless="testprop" />
<target name="call-this" depends="some_target,another_target" />
Stefan
RE: Conditionals
Posted by Supriya Saha <ss...@bowcutter.com>.
Whatever you want to do if the conditions are satisfied, put in a target and
execute the target with the if option.
Example:
<target name=<name of the target> if="some.prop">
Supriya Saha
Senior Developer,
Bowcutter Technologies,
7000 Central Parkway,
Suite 1400,
Atlanta, GA 30328
Phone : 770-225-3614
http://www.bowcutter.com <http://www.bowcutter.com/>
-----Original Message-----
From: jax@purematrix.com [mailto:jax@purematrix.com]
Sent: Wednesday, August 22, 2001 5:01 PM
To: ANT User Mailing List
Subject: Conditionals
I'd like to do <if testproperty="some.prop" testvalue="doIt"
trueantcall="some_target" falseantcall="another_target"/>
What's the closes thing I can do to this in Ant?
--
Jack J. Woehr # "I never worry that all hell will break loose.
Senior Consultant # I worry that half hell will break loose, which
Purematrix, Inc. # is much harder to detect." - George Carlin