Incremental java compile AKA javac print compile dependencies

Joshua Maurice joshuamaurice at gmail.com
Tue May 25 02:23:57 UTC 2010


I'm sorry. I'm new to this list, and I'm not sure if this is the appropriate
forum. I was looking at the javac source code, and I am now looking for help
or guidance. Specifically, I want to create an incrementally correct build
system for java, preferably without having to (re)write a Java compiler. I
need some additional information to be printed from javac to get full
dependency information. Please see:
  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4639384

http://groups.google.com/group/comp.lang.java.programmer/browse_thread/thread/bb6f663d55700951#
for a detailed discussion. The short version is that -verbose output almost
is what I need. I need to know the full list of class files loaded for each
java file being compiled, and the full list of java files in the compile
used by each java file being compiled; that is, the full list of java file
and class file \compile\ dependencies of each java file in the compile. One
can already get this information by calling javac once on the set of
interested java files to do the compile, then an additional java -verbose
once per java file to get the dependency information.

However, calling javac so many times is quite slow, and unnecessary. I would
like to enhance javac to print out this dependency information with one
invocation aka without resorting to calling javac once per java file, and
preferably get this change into the actual official released javac.

PS: Yes this information on its own is insufficient to do an incrementally
correct java compile. However, when combined with Ghost Dependencies (please
see:
  http://www.jot.fm/issues/issue_2004_12/article4.pdf
), I think that this would actually work. I have some tests to this effect
already with my proposed system which currently calls javac once per java
file to get the compile dependency information.



More information about the discuss mailing list