ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Murdoch" <>
Subject RE: What about dependecies?
Date Fri, 29 Sep 2000 13:01:40 GMT


As far as jikes is concerned, if you give it a class A on the command line,
it will compile that source file and (optionally) all the classes that class
A depends on.  It will not, however, hunt down classes that are dependent on
class A and compile them.

So, if you have a class B that depends on class A (e.g. B implements A, or B
extends A, or B.method() throws A, etc) and you change class A, you still
have to name class B on the jikes command line.  Unfortunately, ant won't
let you do this unless B itself has changed. Or you've fooled ant into
getting the package structure wrong.

AFAIK this behaviour is pretty much how all java compilers behave (just with
differing degrees of accuracy in figuring out which the classes that A is
dependent on).  If there's a compiler out there that can travel back up the
dependency graph, please let me know!

So what options are there for dealing with this?  If your project is fairly
small, use jikes as your compiler and set up your javac task so that the
source directory structure does not match the package heirarchy.  For
example. rather than

<javac srcdir="src" ... />


<javac srcdir="src/com/foo" ... />

This way ant will attempt to compile everything every time, and jikes is
fast.  Really fast.

Alternatively, setup your javac task correctly and use a 'clean' target to
force a rebuild when changing core interfaces and base classes.

Unfortunately, there's no real good way for ant to solve this problem
without parsing all the Java source files, and then traversing the
dependency graph to figure out the set of files to hand off to the compiler.
You'd be hard pressed to build this in Java and have it end up being faster
than just recompiling everything from scratch with jikes or jvc.


-----Original Message-----
From: Carlos Quiroz []
Sent: Friday, 29 September 2000 8:40 PM
To: ''
Subject: RE: What about dependecies?

Ok, here it goes. I just change interface agian without changing

and ant -verbose is:

Ant version 1.2alpha3 compiled on September 27 2000

Searching for build.xml ...
Searching in D:\Projects\AIS\code
Buildfile: D:\Projects\AIS\code\build.xml
Detected Java Version: 1.3
Detected OS: Windows 2000
Project base dir set to: D:\Projects\AIS\code
Build sequence for target `main' is [prepare, compile, main]
Complete build sequence is [prepare, compile, main, clean, total-clean,
client, jarfile, deploy, backup]
    [javac] Compiling 2 source files to D:\Projects\AIS\code\build
    [javac] Using jikes compiler
    [javac] Compilation args: jikes -deprecation -d
D:\Projects\AIS\code\build -classpath
Files\JavaSoft\JRE\1.3\lib\rt.jar;D:\Projects\AIS\code\src" -g -depend +F
    [javac] Files to be compiled:



Total time: 2 seconds

Do You Yahoo!?
Get your free address at

View raw message