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 23:23:36 GMT
Hi Viraj,

Oops, wrong verbose. My fault -- I should've been clearer. I didn't mean
for you to set the "verbose" attribute of <javac>, but to run Ant with the
-verbose flag. Eg:

  $ ant -verbose build-main

Thanks,
Diane

--- Viraj Purang <viraj_purang@spincircuit.com> wrote:
> HI,
>    The <Javac> task with the verbose option gave s0ome information but
> not
> good enough to lead me to deuce anything significant.
> 
> The directory in question has 6 files and it compiles all 6 while it
> should
> do only one.
> build-main:
>     [javac] Compiling 6 source files to
> C:\CVS1\builder\client\build\classes
>     [javac] [parsed
> C:\CVS1\builder\client\com\spincircuit\utils\ErrorMessage.java in 531
> ms]
>     [javac] [parsed
> C:\CVS1\builder\client\com\spincircuit\utils\Mail.java
> in 100 ms]
>     [javac] [parsed
> C:\CVS1\builder\client\com\spincircuit\utils\MailException.java in 0 ms]
>     [javac] [parsed
> C:\CVS1\builder\client\com\spincircuit\utils\PropertyLocator.java in 71
> ms]
>     [javac] [parsed
> C:\CVS1\builder\client\com\spincircuit\utils\SwitchPathSlash.java in 20
> ms]
>     [javac] [parsed
> C:\CVS1\builder\client\com\spincircuit\utils\TimeStamp.java in 30 ms]
> Which means that all the local files(in the current directory) are being
> parsed for compilation 
> 
> For all other files it gives me a 
> 	[javac] [loaded c:\jdk1.3\jre\lib\rt.jar(java/util/Locale.class) in
> 60 ms]
> 	[javac] [loaded
> c:\jdk1.3\jre\lib\rt.jar(java/util/ResourceBundle.class) in 30
> 	[javac] [loaded c:\jdk1.3\jre\lib\rt.jar(java/lang/Object.class) in
> 10 ms]
> 	[javac] [loaded c:\jdk1.3\jre\lib\rt.jar(java/lang/Exception.class)
> in 0 ms]
> 	[javac] [loaded c:\jdk1.3\jre\lib\rt.jar(java/lang/Throwable.class)
> in 0 ms]
> and all these LOADED files are external files (outside the directory
> ...from
> the classpath)
> 
> Regards,
> Viraj Purang
> 
> 
> -----Original Message-----
> From: Diane Holt [mailto:holtdl@yahoo.com]
> Sent: Thursday, June 14, 2001 12:41 PM
> To: ant-user@jakarta.apache.org
> Subject: RE: Java Dependencies ...
> 
> 
> 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/


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



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

Mime
View raw message