ant-user mailing list archives

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

> 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.

    Erik



--
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