Jump to content
Posted 22 March 2011 - 10:02 PM
Posted 23 March 2011 - 12:36 AM
Posted 23 March 2011 - 01:38 AM
Posted 23 March 2011 - 04:28 AM
Posted 23 March 2011 - 04:18 PM
But your build system (or often your IDE in the case of Java) at least needs to check. If ClassTwo imports ClassOne, and ClassOne.java has changed then ClassTwo *might* need recompiling because without identifying exactly what in ClassOne changed you can't be sure that recompilation isn't necessary. Java dependencies such as this are incredibly difficult to express in a make-style dependency graph.
Also, I think you have some misconceptions about how Java's compilation model works. In your given example, you do not need to rebuild ClassTwo.
If you go this route and use make be very careful, as it will introduce race conditions in to parallel builds, potentially producing corrupt .class files.
Edit: You might also want to peruse http://download.oracle.com/javase/6/docs/technotes/tools/windows/javac.html Javac will automatically recompile dependencies if necessary and it finds the source code (i.e. specified on the sourcepath). But again, in cases like the one you outlined, recompilation is not necessary.