ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <>
Subject Re: When is it appropriate to use antcall?
Date Wed, 02 Apr 2003 04:39:24 GMT
On Wed, 2 Apr 2003 02:33 pm, Andrew Zeon wrote:
> In "Java development with Ant" by Erik Hatcher and Steve Loughran it says
> excessive use to antcall is the wrong way to use ant. It has an example of
> using the antcall task, but I don't quite understand when it is appropriate
> to use antcall. Can somebody explain?
> Thanks.

You should not use <antcall> in place of proper dependency definition. For 
example, this arrangement

<target name="build">
  <antcall target="step1"/>
  <antcall target="step2"/>
  <antcall target="step3"/>

is more simply expressed as

<target name="build" depends="step1, step2, step3">

The latter is also more maintainable as dependencies change. The first version 
is an attempt to "program" in Ant and is pretty messy.

You generally use antcall where you need to parameterize parts of your build. 
When you use <antcall> is sets up a separate context with its own property 
values. Setting properties in <antcall> does not,. therefore, set properties 
in the main build context.

Conor MacNeill

View raw message