ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <>
Subject Re: Conditionnal Task
Date Tue, 05 Mar 2002 14:35:38 GMT
----- Original Message -----
From: "Romain.Rouvoy" <>

> I want to to use different tasks depending on the value of a specific
> property
> So for Example when the value of the property is "VisiBroker"
> I' want to execute the specific target "compile" and in the other cases
> I want to use a default target named "compile"

Huh?  You cannot have two targets named the same.

> We can execute a task if a property is set or not but I don't know how
> to test the property's value !

You can have conditional <target>'s, not tasks.  The syntax is:

<target name="compile" if="VisiBroker">

But that only tests whether the property is set or not, not the value.  If
you need to check the actual value, you'll have to use <condition> to
optionally set a property or not based on string equality and such.

> I'm sure you understand what I mean ! :)

Nope, not at all!  :)  But I took a stab at an answer anyway.


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message