ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Cohen" <>
Subject RE: Question about MacroDef vs antcall
Date Sun, 26 Oct 2003 22:59:29 GMT
Thanks for the information on depends vs. antcall.  My suspicion has been that antcall was
a major cause of delay.  Unnecessary operations are another area of optimization potential.

-----Original Message-----
From:	Conor MacNeill []
Sent:	Sun 10/26/2003 4:21 PM
To:	Ant Developers List
Subject:	Re: Question about MacroDef vs antcall
On Sun, 26 Oct 2003 03:18 am, Steve Cohen wrote:
> The new ant features wiki
> says:
> "If you are using <antcall> as a macro substitute, you really should look
> into this task. It is not only going to simplify your build files but also
> speed up your builds considerably as you skip the huge overhead connected
> with <antcall>."
> Re: the "huge overhead connected with <antcall>":
> Does this also apply to calls made to other tasks via "depends"?  

No, there is no overhead associated with depends because it operates within 
the same context as the depending target. An <antcall> sets up a whole new 
context in which to exectue the targets tasks. This also includes re-parsing 
the XML and re-building the in-memory structure of the build file. 

And if
> so, is a macrodef callable via depends? (I don't see how.)

No. depends does not really mean "callable". The depends attribute is used to 
describe the dependency structure of your build. That causes Ant to execute 
those targets to satisfy the dependencies. It is a relationship between 
targets - i.e. the large scale things that happen within your build. Tasks, 
including those defined by <macrodef> are about the small, detail-level 
things that need to happen in your build. 

> Does ant 1.6 offer a way around this problem, or is there perhaps another
> way in ant 1.5 even?  My general feeling on ant scripts up to now has been,
> you can write an excellent quick and dirty script pretty easily or you can
> write a complicated system of build scripts, but it's very hard to make one
> script that serves both goals.

I would probably need more info to understand your build system to see why it 
may be taking time. Are there custom tasks? What operations are being invoked 
which may not be necessary. Can <uptodate> be used to avoid sub-builds? etc.

If you can use macrodef in place of antcall, you should save some time. OTOH, 
if the build invokes operations that take time and which need to be done, 
according to timestamps, etc, then you may be limited in what you can do. You 
can potentially save time by accepting some out-of-date components. This can 
be OK in dev situation and may be what your "quick and dirty" scripts are 


To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message