One reason to use AntCall instead of depends: depends does not guarantee
the order that the targets will be executed in. Granted, the current
implementation calls them in the order they're listed, but I've seen
quite a few emails from committers saying that this could change. So if
you want to force order of execution, AntCall is your method of choice.
Diane's example is also a good one. I have a target that executes unit
tests and generates reports based on their results, and I invoke it
several times to run on different filesets. Using AntCall allows me to
set a property differently each time, so that I can use that property in
building the fileset. This way, I don't have to have a separate target
for running my tests different sets of files. I suppose templating
could achieve the same effect, but it seems a bit heavyweight for such a
trivial problem.
Cheers,
Chris Greenlee
> -----Original Message-----
> From: Peter Donald [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 28, 2001 9:18 PM
> To: [EMAIL PROTECTED]
> Subject: Re: depends vs. antcall
>
>
> On Fri, 29 Jun 2001 06:22, Bevan Arps wrote:
> > Peter Donald wrote:
> > > (1) will allow you to resue same target but pass in
> different properties
> > > each time. Effectively treating the target as a method. This will
> > > probably go away in Ant2.
> >
> > !!!!
> >
> > ... and be replaced by ???
> >
> > The ability to factor out common steps from different tasks
> for ease of
> > maintenance and documentation seems to be an essential
> feature for Ant.
> >
> > So, my question is - if AntCall w/Parameters, how am I to retain the
> > current structure in my build files?
> >
> > [ If it is useful, I'm willing to send a couple of my build
> files to the
> > list for comment ]
>
> Well different pepole want to replace it with different
> things ;) They
> strategy I will implement is having a separate rules or
> template file. This
> rule/template file would contain all the reusable bits and
> just operate on
> the "data" present in base build file. Others believe that
> making ant a fully
> fledged procedural scripting language is the answer.
>
> Cheers,
>
> Pete
>
> *-----------------------------------------------------*
> | "Faced with the choice between changing one's mind, |
> | and proving that there is no need to do so - almost |
> | everyone gets busy on the proof." |
> | - John Kenneth Galbraith |
> *-----------------------------------------------------*
>