Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 58162 invoked by uid 500); 14 Jun 2001 23:01:04 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 58150 invoked from network); 14 Jun 2001 23:01:03 -0000 Message-ID: From: Viraj Purang To: ant-user@jakarta.apache.org Subject: RE: Java Dependencies ... Date: Thu, 14 Jun 2001 15:58:49 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" X-OriginalArrivalTime: 14 Jun 2001 23:01:25.0390 (UTC) FILETIME=[EFE792E0:01C0F525] X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N HI, The 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 task, since that's what the task itself does. As for the task -- my understanding is that if you change a source-file that other source-files depend on, then running the task should remove all those dependents' classfiles, which will cause them to be handed off to the compiler when you then run the task (since the 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 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 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 task first, then it would be because all those classfiles are gone. Diane --- Viraj Purang 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 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 ... > > > > destdir="{client.build}/classes" > cache="depcache" > closure="yes"/> > > 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/**"> > > > > > 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/