ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@cortexebusiness.com.au>
Subject Dependency task
Date Sat, 28 Oct 2000 05:26:03 GMT
I have commited an experimental dependency task. This task examines
class files produced by the compiler and determines their direct
dependency relationships. It then "inverts" this relationship to
determine which classes are affected when a given class file is out of
date. These class files are deleted which will force the compiler to
recompile them when the <javac> task is run.

Here is an example usage (on ant itself)
    <depend cache="deps" closure="yes"
            srcdir="../jakarta-ant/src/main"
            destdir="../build/ant/classes"/>


The srcdir and destdir attributes correspond to those of the <javac>
task. The cache attribute identifies a directory where dependency
information is cached. This attribute is optional and if it is not
present, no caching is used.

The closure attribute is also optional. When this is set to yes, the
task will traverse dependency relationships deleting classes as it goes.
If it set to no, only direct relationships are followed. For example,
suppose class A depends on B which depends on C. If C is out of date,
class B will be deleted as it is directly related. class A will only be
deleted if closure = "yes" as there is no direct relationship between C
and A. Using the closure flag will result in the deletion of more files
and probably take longer. In most cases I don;t think this is necessary
but it is there for the paranoid.

I have found performance to be reasonable but I haven't tried it with a
really big project. On our ejb code, a clean build with javac takes 39
seconds, the dependency task takes 4.9 seconds without a cache and 2.2
with a cache.

Feedback is most welcome.

Conor




Mime
View raw message