ant-dev mailing list archives

> -----Original Message-----
> From: Tom Cook [mailto:tcook@ardec.com.au]
> Sent: Tuesday, 4 July 2000 10:23
> To: ant-dev@jakarta.apache.org
> Subject: RE: WIBNI for Javac Task
>
>
> Forgive my persistence, and it's been a while since I hacked through
> this code, but I thought ant decided which files to recompile _before_
> passing them on to javac (at least for the classic compiler). I was
> under the impression that it found all the source files specified,
> worked out where they would end up (this bit may be a bit wonky if
> your directory structure doesn't match, I guess) and compared
> timestamps. Then if it needed recompiling, the file found it's way to
> the javac command line. Isn't this the way it works? Or is my view of
> the world going to be torn apart? ;-)
>
Yes and No :-)
Say you want to compile just a single package (selecting it with an include
element), the javac task will determine all files in that package that need
to be recompiled and pass these to the javac tool. Now the tool will examine
these files and determine the classes upon which these files depend. Say
some of these dependencies are not in the list passed from the javac task.
The javac tool needs to find (or generate) a .class file for these
dependencies. If it can't find the .class file in the classpath it will try
to generate it by finding and compiling a .java file in the source path. The
full algorithm it uses for this search is described in the javac tool
documentation.
Conor