Claude,

Going forward, most of the "modern" versions of java compilers (at least the
ones from Sun) will not support "complex" dependency checking.  I don't know
why this is the case.  The dependency checking you are looking for will only
be performed in "classic" mode, and classic mode will be removed starting in
JDK 1.4.

You can use the Jikes compiler, as has been posted, or you can use the
<depends> optional ant task before the <javac> task.  See the documentation
for details.  It will delete any dependent .class files, forcing them to be
recompiled in the javac task.

hope it helps,
-Mark

-----Original Message-----
From: Rouiller Claude [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 11, 2001 5:07 AM
To: '[EMAIL PROTECTED]'
Subject: javac and dependencies


Hi

I have 2 source files: a.java and b.java.
In a.java, I use a class that is defined in b.java.

Imagine I've just compiled both files.
If I modify only b.java and I call Ant again, Ant will call the compiler for
b.java only. (This is not a surprise, because it is written in the Ant
documentation "Only Java files that have no corresponding class file or
where the class file is older than the java file will be compiled.")

What I would like Ant to do is to recompile both files, even when I don't
change a.java.
A solution is to "clean" every time before calling the compiler.
Is there any nicer solution??

Claude

Reply via email to