ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject RE: Java Dependencies ...
Date Thu, 14 Jun 2001 19:41:12 GMT
Well, the page you pointed me to has this to say about using the -Xdepend
flag:
  -Xdepend  Recursively search all reachable classes for more recent
            source files to recompile. This option will more reliably
            discover classes that need to be recompiled, but can slow
            down the compilation process drastically.

So, if all it's doing is looking for source-files that are newer than
their classfile counterpart (which is what that says to me -- although I'm
not sure what "reachable classes" means), then I don't see it being useful
when using Ant's <javac> task, since that's what the task itself does.

As for the <depend> task -- my understanding is that if you change a
source-file that other source-files depend on, then running the <depend>
task should remove all those dependents' classfiles, which will cause them
to be handed off to the compiler when you then run the <javac> task (since
the <javac> task will compile any source-file that either a) is newer than
its corresponding classfile, or b) has no corresponding classfile.

As for why all your source compiles every time you run the <javac> task --
if it's doing it even when no source-file has changed, then I'd suggest
running ant with the -verbose flag, which will give you output from
<javac> telling you why it's compiling those files (it tends to be because
it can't find the classfile). If it's doing it when you've changed a
source-file that the whole world depends on, and you're running the
<depend> task first, then it would be because all those classfiles are
gone.

Diane

--- Viraj Purang <viraj_purang@spincircuit.com> wrote:
> Hi Diane,
>    It definitely  helped me...
> 
> 
> But I do remember having read in the "javac" description on java.sun.com
> that javac's handling of "The need for recompilation" is not dependable
> and
> -depend option is more desirable to use. eg:
> http://java.sun.com/products/jdk/1.2/docs/tooldocs/win32/javac.html
> 
> "By default, javac considers a class file out of date only if it is
> older
> than the source file. (The -Xdepend option specifies a slower but more
> reliable procedure."
> 
>  
> Another clarification is about the javac task itself :  you said 
> 
> "In any case, it isn't used to associate a dependency from the
> classfiles to
> the sourcefiles -- that's done by the <javac> task itself". 
> 
> Do you mean that the functionality is taken care of, by the "javac task
> implementation in ANT" OR 
> comes to Ant intrinsically because "Javac executable which Ant
> implementation from java.sun.com is supposed to handle this  behaviour".
> 
> 
> I have just completed a compilation script using Ant ...and based on
> deductions I make regarding (which files are (re-)compiled and which are
> not) I shall get back to you with more questions...
> 
> I am currently using something like ...
> 
>   <target name="build-main">
>    
>     <depend srcdir="com/spincircuit"
>         destdir="{client.build}/classes"
>         cache="depcache"
>     closure="yes"/>
>     
>     <javac   srcdir="com/spincircuit" destdir="${client.build}/classes"
> depend="on"
>  
>
classpath="${symbeans.jar}:${jsdk.jar}:${activation.jar}:${xerces.jar}:${ser
> vlet.jar}:${mail.jar}:${jaws.jar}:
>
${sfc.jar}:${bsf.jar}:${js.jar}:${jsse.jar}:${jnet.jar}:${jcert.jar}:${basev
> ol}"
>              deprecation="off" debug="on" optimize="off" target="1.2"
>              excludes="**/CVS/**">
>     </javac>
> 
>   </target>
> 
> Can you suggest the expected outcome of this set of statements ?
> 
> Regards,
> Viraj Purang
> 
> 
> 
>    


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Spot the hottest trends in music, movies, and more.
http://buzz.yahoo.com/

Mime
View raw message