ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Price <>
Subject how to supplement javac compile dependencies?
Date Fri, 20 Oct 2000 18:51:51 GMT
I just joined the list, and couldn't find an archive with prior data or
get the FAQ link on the site to work, so I'll ask a question that
probably has been asked many times.  If so, and you can point me to
prior answers that would be great.

My question is, how can I supplement the dependency checking that the
'javac' task does?  It obviously compares the timestamp between the java
file and the compiled class file and recompiles if the java file is
newer.  But, this is not enough in some cases.

For example, in a package with lots of java files that have already been
compiled, if I change one file in an incompatible way then recompile
using ant, then it only compiles the file that changed, but then the
other compiled classes will be unchanged but will not work since I broke
something that should have been caught at compile time.  It would be
wonderful if ant could figure this out and recompile all effected
classes.  But short of that, is there a mechanism where I can say that
these java files depend upon this other one (like in makefiles), thereby
forcing ant to recompile the other files?

Is the only way to do this to write my own task that checks these
dependencies and deletes the generated class files before calling
'javac' thereby making it recompile?

Thanks for any help!


View raw message