Friday, July 16, 2004

Bug or feature?

Today, we got a very interesting behaviour with building a larger application at work. We have an ant task at one place like this:
<javac debug="on" 

classpath="${external.lib.dir}/foo.jar">
<src path="."/>
<src path="../common"/>
<src path="${java.dir}"/>
[... includes ...]
</javac>
You see, no destdir set.

Now when running this with a file modified in . ant reports:

compile:
[javac] Compiling 1 source file

After this we end up with a lot of .class files in ${java.dir}.
So javac seems to not only compile this one file, but also the
files that this one imports.

At the end, this led to different versions of the .class files
with our autobuild system running wild.

No comments: