ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: optimization question: override vs condition
Date Tue, 04 May 2004 05:42:43 GMT
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
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message