ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rutger Hofman <>
Subject Re: Trying to get rid of makefiles
Date Thu, 24 Jul 2003 00:26:49 GMT
Hmmm, I thought that if one feeds all .java files to the javac
task, then javac figures out the dependencies automatically.
So, if class A extends class B and is changed, javac
will also compile class A (actually, because B.class is changed).
There is no need to do more sophisticated dependency analysis --
javac takes care of it all.

The caveat here is that the dependency checking uses the .class
files, not the .java files. One notable situation where dependency
checking fails is if class A references a static final value
defined in class C. Then, the actual value is constant-propagated
into A.class, so the dependency is invisible within A.class,
and changes to class C will not necessarily lead to recompilation
of A.


> -----Original Message-----
> From: Leonardo Abreu de Barros [] 
> Sent: Wednesday, July 23, 2003 4:02 PM
> To:
> Subject: Trying to get rid of makefiles
> Hi all,
> I work in a company that has a long history using makefiles. Since I 
> joined it, I proposed to migrate to Ant. Some people resist to 
> changes, some people agree, as long as all benefits provided by the 
> makefiles are covered by Ant.
> I've already reproduced all behaviors but one: currently, all java 
> classes names are declared explicitly in the makefile, and sent to 
> the java compiler. It rebuilds all the class files, at each build. 
> They want this behavior in order to detect broken code, due to 
> changes on a base class, for example.
> The problem is that Ant, specifically the <javac> task, only 
> recompiles ".class" if the timestamp differs from the related ".java" 
> file. I've read on documentation that to detect this kind of broken 
> dependencies, you should perform "clean builds" from time to time.
> I proposed this solution, but it wasn't accepted. They think it's a 
> loss of time (even if it's ridiculous) to delete all ".class" files 
> before calling the compiler. If I'm not able to reproduce this 
> behavior with Ant, they prefer to keep the makefiles.
> Does anyone have any idea of how I could reproduce this behavior 
> using Ant? Any other possible solution?
> Thanks in advance,
> Leonardo Barros
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message