> Does ANT work by parsing any changed file to discover the
> dependencies?
Depends on the task you are talking about. For most tasks, including
<javac> it does not. <javac> simply compares the timestamps of *.java
and *.class and compiles those files with outdated .class files.
<depend> in turn parses the compiled .class files to discover
dependencies, then compares the timestamps of .class files to the
.java files and deletes all .class files that are older then the .java
files of any class they depend upon. <javac>'s timestamp checking
after that is going to succeed then.
There are third party tasks like <javamake> - see Ant's external tools
page - that can do that in one step and are more sophisticated.
> Can it be relied on to recompile everything that needs it if a
> static final changes?
No.
And a static final primitive will be inlined by the compiler so even
<depend> will not detect the change (as it wouldn't detect the
dependency) - not sure whether <javamake> would.
> Is ANT smart enough to avoid loading the compiler over and over for
> each file; i.e. does it invoke it only once for the whole shot?
It will invoke the compiler exactly once per <javac> task (that
actually needs to compile at least one file).
Stefan