ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@cortexebusiness.com.au>
Subject Re: depends vs. antcall
Date Thu, 28 Jun 2001 14:10:08 GMT
Kyle,

The first way is better, IMHO. It reflects the structure of your build.
When the build becomes more complicated - i.e. not just a linear
dependency, the depends attribute can capture the hierarchical nature of
your build's dependencies. The <antcall> approach loses that information. I
don't know by looking at your second example whether the "build" target
comes before the "deploy" target because it needs to or just that is the
sequence you chose. If both "clean" and "deploy" depend on build, I can't
see that.

You use antcall primarily where you want to run a separate build. That
usually implies some sort of property management issues. I think it would
be good to avoid turning this into a way of running a set of "functions".

In summary - use depends. Don't use antcall unless you have to.

Conor



----- Original Message -----
From: "Kyle Adams" <kadams@gfs.com>
To: <ant-user@jakarta.apache.org>
Sent: Thursday, June 28, 2001 11:38 PM
Subject: depends vs. antcall


I've seen both the depends attribute of the target tag, and the antcall
task used in very similar methods - to call internal targets the comprise
an external target.  For example:

<target name="all" depends="init, build, deploy, clean">
</target>

vs.

<target name="all">
  <antcall target="init" />
  <antcall target="build" />
  <antcall target="deploy" />
  <antcall target="clean" />
</target>

I've also seen this for the deploy target (to make jar, war, and ear
files), for the build target (to make directories, compile).  My question -
which is the better way of doing this?

Kyle




Mime
View raw message