On Fri, Jul 8, 2011 at 10:27 AM, Perrier, Nathan <nperr...@ptc.com> wrote:
> No, because antcall creates a new project underneath the hood, whereas 
> runtarget (antcontrib task) does not.

I would add that <runtarget> (and <antcall> as well in fact) goes
against the Ant philosophy of having declarative builds using targets
with proper dependencies between them, where by "dependencies" I mean
that target just state their "requirements" and should not care when
or in which order those requirements are fulfilled,  since that's the
job of the "dependency manager" to analyze the graph of targets and
order them such that each one runs only once and in the proper order,
detecting circular references. Targets are not functions that one
would call at will, leading to procedural as opposed to declarative
builds. <macrodef> usage should eliminate the need for most
<runtarget> usage and is preferred in general.

In more practical terms, <antcall> does indeed create a new project
(i.e. a new "scope"), which means that any property it sets will not
be visible to the build that used <antcall>. <runtarget> does not
create a new Project, so all properties set *are* visible to the
"caller", and it achieves that via a loophole in Ant's API which is
not plugged for backward-compatibility reasons.

Using <antcall> and <runtarget> is IMHO a symptom of using Ant and
builds with a wrong (procedural) mindset. I've created lots of large
and complex builds in the past without any, so it's certainly not
necessary to idiomatic Ant usage, although it remains quite popular to
many :) My $0.02. --DD

> -----Original Message-----
> From: Steve Amerige [mailto:steve.amer...@sas.com]
>
> Are the two statements below equivalent?
> <antcall target="doit" InheritRefs="true" />
> <runtarget target="doit" />

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

Reply via email to