ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Wood <>
Subject Re: Dependency task
Date Sat, 28 Oct 2000 13:26:40 GMT
I'm gonna try this out sometime this weekend.

We have a set of builds that take anywhere
from 20 seconds (a handfull of files) to
one that takes about 9 minutes (2251 files).

Just a question - in verbose mode does it list
all the classes that it deleted? Because, I
can check version control and see what files
were changed since the last build, and I
can look at their import statements, and
see if the files deleted match up...

Conor MacNeill wrote:

> 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

View raw message