ant-user mailing list archives

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

hi, 

 thanks for the reply but i dont have the option to convert to 1.6 yet and 
that decision is not mine to make. 

 what i am really after here is if there are certain flaws in using the 
override method instead of checking for the existence of a property using 
the condition task. my initial assessment is that i should be able to use 
the override route without any problems since if the property is already set 
in the caller then the override will just be ignored. what i am not sure now 
is if i am missing something or if such an approach will cost more in terms 
of processing.

 thank you for your time.

ciao! 

Jan.Materne@rzf.fin-nrw.de writes: 

> An <antcall> opens a new scope of properties. Properties which are set by
> the caller
> is available by the callee - but not vice versa. This is the reason why it´s
> difficult
> to have return values. 
> 
> But in the area of <antcall> Ant 1.6 introduced the <*def> family. Maybe
a
> <macrodef>
> would help you? For easier use of local variables you have to try the patch.
> (Sorry,
> haven´t the link. Search on BugZilla for 'local variable macrodef'). 
> 
> 
> Jan 
> 
>> -----Original Message-----
>> From: ramfree26@softhome.net [mailto:ramfree26@softhome.net]
>> Sent: Tuesday, May 04, 2004 7:31 AM
>> To: user@ant.apache.org
>> Subject: optimization question: override vs condition 
>> 
>> 
>> 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 
>> 
 


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