The biggest difference is that Ant ensures that dependencies declared through depends are called no more than once. For example:
<target name="a" /> <target name="b" depends="a" /> <target name="c" depends="a" /> <target name="d" depends="b, c" />
If I call target d , b and c called. However, a is called only once (although both b and c depend on it).
Now suppose we decide to use antcall instead of a dependency for target d :
<target name="d"> <antcall target="b" /> <antcall target="c" /> </target>
Calling target d will now call targets b and c ; however, target a will be called twice, once for b , and then again for c .
In other words, antcall circumvents normal dependency rules, which are the cornerstone of Ant.
I do not think that antcall should be used as a replacement for normal Ant dependencies; what for depends . So when do you use it? The antcall task allows you to control which properties and links are defined (which is why a new Ant environment is created - and why it is so slow), so it can be used to create variations of the same thing; for example, there may be two banks, one with one and one without debugging symbols.
Using antcall , however, creates slow, fragile, and tough build scripts. Think of it as goto of Ant - this is evil. Most well-written build scripts are simply not needed, except in unusual cases.
Richard Steele May 09 '11 at 17:47 2011-05-09 17:47
source share