ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Ellsworth <sc...@alodar.com>
Subject Re: <javac>
Date Tue, 04 Jun 2002 16:44:48 GMT

On Tuesday, June 4, 2002, at 03:30  AM, Eugene Voytitsky wrote:

> 1. module A has released version 1.0.0 (A_1.0.0.jar),
> and source files of module A modified
> since version 1.0.0 had been released, moreover
> current working (in development) version of A
> not compatible with version 1.0.0
> 2. module B depends on module A and requires version 1.0.0 so 
> A_1.0.0.jar in classpath of Ant <javac> task compiling B (of course I 
> specified to compile src of B only)

In this case, you really want completely seperate source directories for 
A and B, with different build files.  You can then have a master build 
file that calls each subfile in dependency order, but having

> BUT because of both module A and B have same ${src_dir}
> javac.exe/jikes.exe [will compile anything in src-dir as needed]

pretty much forces the rebuilds you are discovering.  Even if there is 
an easy workaround, I suspect over the long term, you will be happier 
having different build scripts, or at least complete source isolation 
between any two modules that might need to be compiled separately.

We ended up isolating our cross-module dependencies in a master build 
script, and our targets into one standard build file driven by four 
properties to tell it where and what to do.

top
-build
--masterbuild.xml
--standardbuild.xml
-libraries
-products
-toplevelone
--projecta
---projectabuild.xml
---projectasrc
--projectb
---projectbbuild.xml
---projectbsrc
-topleveltwo
--projectc
---projectcbuild.xml
---projectcsrc
--projectd
---projectdbuild.xml
---projectdsrc

masterbuild knows the dependencies of a, b, c	, and d, and calls 
targets in standard-build that build in complete isolation in projecta, 
projectb, projectc, and projectd.  (This is done via properties.)

Each project deploys to the products dir, and uses libraries in the 
libraries dir.  Thus, if b depends on a, b knows that it will find 
projecta.jar in products once projecta's build is done.

If b has gotten to where it will not compile with the current a source, 
then I just do not use the masterbuild target that knows of the 
dependency until it is fixed.

For general use, we use only masterbuild, which calls targets in 
standardbuild, but it is possible to create projectabuild.xml if 
desired.  Just like masterbuild, all a projectbuild file does is set the 
magic four properties to tell it which directory to work in, what to 
compile and what is in the classpath.  All the real work is done in 
standardbuild.

Scott


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message