ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramfre...@softhome.net
Subject optimization question: override vs condition
Date Tue, 04 May 2004 05:30:30 GMT
Hi, 

 I am optimizing my ant scripts and one thing that I would like to know is 
how logical would it be to use the condition task for setting properties. My 
script has the following format: 

<target name="sample1">
   <antcall target="override"/>
   <antcall target="condition">
       <param name="dummy.value" value="hehehehe"/>
   </antcall>
</target> 

<target name="override">
   <property name="dummy.value" value="hehehe"/>
   <!-- do some other task with dummy.value -->
</target> 

<target name="condition">
   <condition property="dummy.value" value="hahahaha">
       <not>
           <isset property="dummy.value">
       </not>
   </condition> 

   <!-- do some other task with dummy.value -->
</target> 


 Disregarding the performance hit of the antcall task, would you recommend 
that I use the method used in the "override" target over the one used in 
"condition"? I am inclined to using the override way since it is simpler to 
write and more readable but I think the condition approach is safer. As in 
all normal ant tasks, the property specified by the parent target takes 
precedence. In real world usage, the dummy.value changes depending on some 
scenarios but that could be disregarded for the time being. Thank you for 
your time. 

 --
"Programming, an artform that fights back" 

Anuerin G. Diaz
Registered Linux User #246176
Friendly Linux Board @ http://mandrakeusers.org/index.php

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


Mime
View raw message