[Scons-dev] File-based build tools will never handle Java
Mark A. Flacy
mflacy at verizon.net
Thu Sep 6 15:18:32 EDT 2012
On Thursday 06 September 2012 13:47:02 Greg Ward wrote:
> You cannot compile these two files independently.
Yes.
> Either javac will
> discover the other source file and compile it implicitly, or you must
> list both files on the javac command line.
Well, not quite.
*If* you specify a sourcepath (via -sourcepath), *then* javac will look for
the sources in that path and automatically compile them as needed. If you
merely provide a list of files, javac will operate only on them if the
sourcepath is not set.
In this case, it is true that if you did not set the sourcepath and gave javac
only one of the two files, the compile would fail.
> (IMHO the latter is by far
> preferable. javac's implicit compilation might have seemed like a good
> idea at the time, but I'm convinced that it's a bad thing to rely on.)
The other large problem that we had seen was when we renamed/repackaged
various classes without ensuring that their old .class files were removed.
Classes that were still looking for the old one would still compile, since
javac would find the old .class file in the classpath and use that. Since our
nightly loadbuild always worked from a clean slate, it would fail even though
the designer thought he/she had tested the compile.
More information about the Scons-dev
mailing list