ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <>
Subject RE: Problem to set property with refid
Date Thu, 03 Jun 2004 07:23:27 GMT
Hi Vinod,

Let's say the property we want to check is called
testprop. The check can be done in several ways

1) Pure Ant
<target name="main" depends="target_A, target_B"/>

<target name="target_A" if="testprop">
... Do smth here

<target name="target_B" unless="testprop">
... Do smth here again

The point is that target "main" will call both
target_A and target_B. Then if testprop IS set
target_A will be excecuted. If testprop IS NOT set
target_B will be executed.

2) Ant + Ant-Contrib
If you have many conditions to check in this way you
may prefer ant-contrib [1] <if> task [2]. In our case:
<target name="main">
        <isset property="testprop">
            ... Do here the stuff previously done in
            ... Do here the stuff previously done in

Note that <isset> is Ant built-in condition. For more
info on condition check [3] and [4].

Regards Ivan


Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger. 

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

View raw message