ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Drew Davidson <d...@ognl.org>
Subject Re: How to make generic rules
Date Mon, 04 Aug 2003 06:13:58 GMT
North Alex wrote:

>>I'm an old makefile user. Now i'm an ant user.
>>But i haven't yet found a way to replace a powerfull 
>>functionality of make: implicit rules and import of rule from 
>>a makefile in another makefile (include). In fact i need to 
>>overide some task in order to define implicit properties.
>>
>>For example i want to set the compress attribute of jar task 
>>to false one time for the full build file and not to set it 
>>for each jar task.
>>
>>How can i do this?
>>    
>>
>
>One way could be to set a property and use "unless" for a target that
>sets the properties you want.
>
>You can also call <ant> and set properties for that ant call ... or use
><antcall> :
>
>	<antcall target="update.changehistory">
>		<param name="history.version"
>value="${component.version}"/>
>	</antcall>
>
>	<antcall target="update.changehistory">
>		<param name="history.version"
>value="${baseline.version}"/>
>	</antcall>
>
>So, update.changehistory can be called from different places with
>different values for the history.version
>  
>
But bear in mind that <ant> and <antcall> reparses the entire ant file 
each time they are used, so don't be lulled into thinking that they are 
cheap function calls.

- Drew

-- 
+---------------------------------+
< Drew Davidson | OGNL Technology >
<     Professional Open Source    >
+---------------------------------+
|  Email: drew@ognl.org          /
|    Web: http://www.ognl.org   /
|    Vox: (520) 531-1966       <
|    Fax: (520) 531-1965        \
| Mobile: (520) 405-2967         \
+---------------------------------+




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


Mime
View raw message