ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Gordon" <>
Subject RE: how many build.xml files and where should they go?
Date Tue, 08 Apr 2003 09:07:55 GMT

I have just been down this road - we've 11 projects that all depend on each
other to varying degrees. The layout of these projects is similar in some
repsects, but we do have some 'funnies' too. I've a build.xml in the src
directory of each. Quite recently they'd all grown into monsters pushing the
best part of 1000 lines and I've just been on a major refactoring tip to
factor out all the common code - never put your refactoring off for too long
or you'll be sorry. The vast majority of the workings of my build are held
in a library build.xml which I <ant> into using inheritall="true", which is
the closest thing to an import in ANT.

Issues I have with this approach are:

- While it's possible to specify all the intra-project dependencies using
the 'depends' attribute of each target in that project, there are some
inter-project dependencies which need to be satisfied. I cope with that by
making a target for those inter-project dependencies which is implemented
using <ant>s to those other build.xml files.

- If you depend on classes and jars held in another project then there seems
to be no way to express that dependency other than to spell out those
classes and jars on the classpath of every project which needs to include
them. There's no way (that I can see) of being able to say 'I'd like to
combine the classpath of another project with my own'.

If it were possible to resolve these issues I'd be able refactor a lot

I've heard that some people separate out all the inter-project dependencies
into a separate ANT file, so that each project has two ANT files - one for
the inter-project dependencies and another that expresses the intra-project
dependencies only.

(Sorry for the late response - our mail server was down yesterday =(


View raw message