You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ramesh Donnipadu <rd...@uswest.com> on 2001/08/06 18:27:01 UTC

incremental build using ant

I know ant can do incremental compilation/build based on time stamp of
the surce and class files. But I am not aware whether ant is really
smart and can figure out logical dependency among various class files by
itself.

I am guessing this can be done using ant but we have to tell it using
the "depends" key word. But maintaining the list of dependency class
files up-to-date itself  becomes a nighmare in a large development
effort involving 25 developers spread across different locations.

Apart from clobbering  everything and make a clean build each time,  is
there any timesaving suggestion?

Thanks,
Ramesh



Re: incremental build using ant

Posted by Nico Seessle <ni...@apache.org>.
----- Original Message -----
From: "Ramesh Donnipadu" <rd...@uswest.com>
To: <an...@jakarta.apache.org>
Sent: Monday, August 06, 2001 6:27 PM
Subject: incremental build using ant


> I know ant can do incremental compilation/build based on time stamp of
> the surce and class files. But I am not aware whether ant is really
> smart and can figure out logical dependency among various class files by
> itself.

No, it can't. Of course there is a task "depend" that can help you to
accomplish that task. It tries to find dependencies between your classes and
simply deletes all class files that it thinks need a rebuild. But beware, it
will not find all the dependencies in your classes (for an example you might
get problems using "public final static int" constants) because of the way
these are handled by the compiler (the values are just copied to the class
where they are used and there is no simple way to know where the value comes
from - you could parse the sourcem but Ant is not doing that).

You can start to use <depend> by outting it just before your javac-task with
the same srcdir and destdir.

For simplier cases there is the "depend"-attribute for javac which will - if
your compiler supports it - enable the -depend option in the compiler.

> I am guessing this can be done using ant but we have to tell it using
> the "depends" key word. But maintaining the list of dependency class
> files up-to-date itself  becomes a nighmare in a large development
> effort involving 25 developers spread across different locations.

And where would you place this information?

Nico