ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Jackl-Mochel" <>
Subject RE: recursive ant build: recommendation?
Date Mon, 11 Jun 2001 16:31:07 GMT
After re-reading the article in question I have to say that it seems to have
a large number of
arguments that don't seem to apply to either a tool of ANT's architecture or
the common types
of projects I am dealing with.

First off, let me point out that for most small projects (4-7 developers) I
don't really think
that a recursive build structure is necessary. It may be worthwhile but the
cost/benefits ratio is
very dependent on what is being done with the project.

Many of the recursive make cons address the explicitly constructed nature of
the dependency graph in
Make. ANT went the route (in many cases ) of offloading dependency
calculations to the task. This often
results in faster performance all the way around. Of course, the ANT model
has a real problem with
dependencies that need to be mapped among J2EE components at a higher level
than the java source file ..

The projects I am, increasingly, dealing with  have well over 10 developers,
geographically distributed,
working on J2EE based distributed applications.

Leaving aside the component specific issues of component identification and
versioning, these
components very naturally fall into independent teams or single developers
working on semi-isolated
components. Yet, the entire application needs to be automatically built and
unit tested at night
to help track integration and other issues. To this end the components share
a common build environment
and common configuration scheme. The build can be entered at multiple levels
(individual components may
need to be redeployed to the test server on the fly).

In addition the test need to be run repeatedly using different
login/passwords for the same ANT session.

I have already seen first hand what happens when a single ANT file or even a
single set of ANT files (all
at the top level) are used to handle this kind of interrelated projects. It
is not pretty, especially when
combined with an "exclusive check out" revision control system...

Given ANT's narrowly focused conditional branching (available and if/unless
on tasks), I believe that the only
way to achieve what is desired is to use a root set of configuration files
that are "entity referenced" into the
build files at the various levels. Those configuration files include a set
of common defined targets ala:


and so on..

Even with the recursive structure I am still forced to resort to using PERL
to get the iteration over the possible test
configurations and to do some of the conditional testing after some of the
build steps.

Jim JM

> -----Original Message-----
> From: Peter Vogel []
> Sent: Saturday, June 09, 2001 1:56 AM
> To: ''
> Subject: RE: resursive ant build: recommendation?
> > -----Original Message-----
> > From: Suu Quan []
> > Sent: Friday, June 08, 2001 9:28 AM
> > To: ANT user group
> > Subject: resursive ant build: recommendation?
> >
> >
> > I am solliciting recommendation from this group on whether recursive
> > build.xml files is a recommended pattern.
> >
> > In make, it is a common practice to build a makefile for each
> > package/subpackage/component. Then at the upper level, you invoke the
> > sub-level makefiles.
> It's a common practice, but not a good idea.  Check this out:
> In fact, many of the make performance issues discussed on this list
> can be directly attributed to recursive make structures.  It takes a
> little while to wrap one's head around the ideas discussed by Peter,
> but its well worth it.
> >
> > For a not-so-clean design, compilation dependencies force the
> > build system
> > to first create a dependency list, usually creating makefiles
> > dynamically,
> > then executing them in a known order. This occupies a good
> > 20-40% of the
> > build time.
> >
> > With Ant and Javac, it seems that I can get away with one
> > toplevel build
> > file and skip that intermediate step of finding dependencies.
> > Is this the recommendation for Java type of builds?
> Yes.  However, there are cases were a certain amount of recursion
> makes sense.  For example, I'm working a project right now where
> there are basically 4 almost completely independent components (basically
> a lot of glue) that tie several other systems together.  For the
> convenience of the developers in each project, there is an ant file
> that builds that component independently of the others.  My system
> integration project build essentially iterates across those individual
> component builds.
> >
> > The above is possible, I think, due to capability of javac to resolve
> > dependencies. (correct me  please if I'm wrong, even slightly)
> > What about other languages: C, C++ ...
> Check out cons:
> -Peter
> ---
> Peter A. Vogel
> Manager, Configuration Management
> Arsin Corporation, Professional Services

View raw message