Return-Path: Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 6308 invoked from network); 29 Sep 2000 13:00:11 -0000 Received: from smtp3.mail.yahoo.com (HELO smtp1b.mail.yahoo.com) (128.11.68.135) by locus.apache.org with SMTP; 29 Sep 2000 13:00:11 -0000 Received: from cpe-203-45-133-154.qld.bigpond.net.au (HELO adam) (203.45.133.154) by smtp.mail.vip.suc.yahoo.com with SMTP; 29 Sep 2000 13:00:10 -0000 X-Apparently-From: From: "Adam Murdoch" To: Subject: RE: What about dependecies? Date: Fri, 29 Sep 2000 23:01:40 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 Importance: Normal In-Reply-To: <11F50C3B0CFFD311A1D900508B8B7C6E4BF42A@posti.rtse.com> X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Hi, As far as jikes is concerned, if you give it a class A on the command line, it will compile that source file and (optionally) all the classes that class A depends on. It will not, however, hunt down classes that are dependent on class A and compile them. So, if you have a class B that depends on class A (e.g. B implements A, or B extends A, or B.method() throws A, etc) and you change class A, you still have to name class B on the jikes command line. Unfortunately, ant won't let you do this unless B itself has changed. Or you've fooled ant into getting the package structure wrong. AFAIK this behaviour is pretty much how all java compilers behave (just with differing degrees of accuracy in figuring out which the classes that A is dependent on). If there's a compiler out there that can travel back up the dependency graph, please let me know! So what options are there for dealing with this? If your project is fairly small, use jikes as your compiler and set up your javac task so that the source directory structure does not match the package heirarchy. For example. rather than use This way ant will attempt to compile everything every time, and jikes is fast. Really fast. Alternatively, setup your javac task correctly and use a 'clean' target to force a rebuild when changing core interfaces and base classes. Unfortunately, there's no real good way for ant to solve this problem without parsing all the Java source files, and then traversing the dependency graph to figure out the set of files to hand off to the compiler. You'd be hard pressed to build this in Java and have it end up being faster than just recompiling everything from scratch with jikes or jvc. Adam -----Original Message----- From: Carlos Quiroz [mailto:carlos.quiroz@rtse.com] Sent: Friday, 29 September 2000 8:40 PM To: 'ant-user@jakarta.apache.org' Subject: RE: What about dependecies? Ok, here it goes. I just change interface agian without changing implementors and ant -verbose is: Ant version 1.2alpha3 compiled on September 27 2000 Searching for build.xml ... Searching in D:\Projects\AIS\code Buildfile: D:\Projects\AIS\code\build.xml Detected Java Version: 1.3 Detected OS: Windows 2000 Project base dir set to: D:\Projects\AIS\code Build sequence for target `main' is [prepare, compile, main] Complete build sequence is [prepare, compile, main, clean, total-clean, client, jarfile, deploy, backup] [javac] Compiling 2 source files to D:\Projects\AIS\code\build [javac] Using jikes compiler [javac] Compilation args: jikes -deprecation -d D:\Projects\AIS\code\build -classpath "D:\Projects\AIS\code\build;D:\Projects\AIS\code;D:\Projects\AIS\code\lib\ma rket;D:\Projects\AIS\code\lib\gnu-classes.jar;D:\Projects\AIS\code\lib\feeds haper.message.jar;D:\Projects\AIS\code\lib\fi.cgs.util.jar;D:\Java\jars\jaxp .jar;D:\Java\jars\parser.jar;D:\Java\jakarta-tomcat\lib\servlet.jar;D:\Java\ jars;D:\Java\jars\xml4j.jar;D:\Java\jars\xerces.jar;D:\Java\jars\JMF2.1\lib\ jmf.jar;D:\Java\jars\Jindent.jar;D:\Java\jmk\jmk.jar;D:\Java\jakarta-ant\lib \ant.jar;D:\Java\jakarta-ant\lib\jaxp.jar;D:\Java\jakarta-ant\lib\parser.jar ;D:\Java\jdk1.2.2\lib\tools.jar;C:\Program Files\JavaSoft\JRE\1.3\lib\rt.jar;D:\Projects\AIS\code\src" -g -depend +F [javac] Files to be compiled: D:\Projects\AIS\code\src\com\rtse\ais\interfaces\FeedConnection.java D:\Projects\AIS\code\src\fi\cgs\widget\table\TableRowTableModel.java compiling BUILD SUCCESSFUL Total time: 2 seconds _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com