ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peterson, Brian" <Brian.Peter...@westgroup.com>
Subject RE: Use "depends" attribute versus "antcall" task
Date Fri, 14 Jun 2002 18:10:04 GMT
One of the big differences is that properties that are set in targets run
via "depends" will remain set/accessible in your "all" task, whereas
properties that are set in targets run via "ant" or "antcall" are not
set/accessible from your "all" task.

<target name="test1" depends="set">
	<echo message="${p}"/> <!-- this will print 'worked' -->
</target>

<target name="test2">
	<antcall target="set"/>
	<echo message="${p}"/> <!-- this will print '${p}' -->
</target>

<target name="set">
	<property name="p" value="worked"/>
</target>

brian peterson

| -----Original Message-----
| From: George_Schlitz@ssga.com [mailto:George_Schlitz@ssga.com]
| Sent: Friday, June 14, 2002 12:57 PM
| To: ant-user@jakarta.apache.org
| Subject: Use "depends" attribute versus "antcall" task
| 
| 
| Newbie build best practices question:
| I am trying to pattern our build process based on suggestions 
| made in "Ant
| in Anger", and a few other sources.
| 
| It seems like common practice to use the "depends" attribute 
| of a target to
| execute subordinate targets.  What is the benefit of this 
| over using nested
| "antcall" tasks in a target.
| Arbitrary example:
| <target name="all" depends="init,clean,build,deploy"/>
| 
| Wouldn't it make sense, since these tasks are all part of 
| "all" rather than
| prerequisites of "all", to include them as antcall tasks?
| Since I'm new to using ant, I might just not understand the important
| differences between depends and antcall.  All advice welcome!
| 
| Thanks
| George
| 
| 
| --
| To unsubscribe, e-mail:   
<mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

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


Mime
View raw message