Okay, now I’m mad at ant: I just changed a method from public to private, a method which was called by other classes, and ant didn’t recompile all the affected files: I had to wait until I got an error at runtime. So either ant doesn’t do what it should, or something’s seriously wrong with my understanding of Java.
(Admittedly, the latter is a serious possibility.)
Post Revisions:
There are no revisions for this post.
Your mistake is in thinking that Ant somehow does dependency analysis at the source-code level. It doesn’t. The javac task simply looks for class files that are out-of-date with respect to their corresponding source files. Ant as a whole analyzes dependencies only at the task level.
However, there is JavaMake at http://www.experimentalstuff.com/Technologies/JavaMake/ (that’s a Sun Labs website), which does do full class-level dependency analysis and can run either inside Ant or stand-alone. Disclaimer: I haven’t used it.
Note one limitation of the Java class file format noted on that site: if you change a class or interface containing public static final values, JavaMake can’t figure out which classes actually import this value, and assumes that all classes must be recompiled.
11/13/2005 @ 8:28 am
I didn’t think it did dependencies on the source-code level, but I did think it got information from the .class files to do dependencies.
Am I getting any improvement from using ant over using make with no dependencies other than a class file depending on a single java file?
11/13/2005 @ 2:47 pm