ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Baldry, Scot M" <Scot.Bal...@gs.com>
Subject Includes within ANT
Date Fri, 20 Apr 2001 09:55:19 GMT
I think I may have found a deficiency in ANT - in the old days of Unix
Makefiles it was common to structure Makefiles in such a way that you would
"include" various targets and attributes for use within other Makefiles. I
can't seem to find a way to do this within ANT (the ant task is not quite
what I am looking for). This is best described with an example:

1. Imagine I have a large source tree that contains several "products" or
"deliverables"

i.e. com.mycompany.common
     com.mycompany.productA
     com.mycompany.productB

2. At any point I may want to build an individual product or the entire
source tree (containing all products and common code).

3. All my source is dependant upon several pieces of 3rd party supplied
software i.e. BEA Weblogic, JUnit etc etc. This 3rd party software is
typically supplied in jar only form and is therefore is not found within the
current source tree - instead it is usually stored on a central file system.

4. To build the entire tree I would like to use a cascading makefile
approach - for example a build.xml will exist at the "com" level that will
pass control to build.xml at the "mycompany" and so on. This will enable me
to use "ant all" at com to build the whole tree or "ant all" at any
sub-package to build everything below the current package.

5. I don't want every build.xml file to contain hard-coded references to the
infrastructure - for example:

<property name="infradrive" value="k:/infra_v1_1_2" />
<property name="WeblogicVer" value="5.1.0" />
<property name="BEA Dir" value="BEAProducts" />

instead I would like to include something like "infra.xml" within every
build file - this will ensure that the entire tree build with consistent
infrastructure. Short of writing my own task I can't see how I can achieve
this. The "ant" task seems to assume things work the other way round - I
will call all targets from a master build.xml script and the environment
will be exported into the sub projects.

Does anyone have any ideas?

Many Thanks

Scot

Mime
View raw message