Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 32588 invoked by uid 500); 3 Oct 2001 04:20:43 -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 32579 invoked from network); 3 Oct 2001 04:20:43 -0000 Date: 2 Oct 2001 21:20:44 -0700 Message-ID: <20011003042044.21056.cpmta@c006.snv.cp.net> X-Sent: 3 Oct 2001 04:20:44 GMT Content-Type: text/plain Content-Disposition: inline Mime-Version: 1.0 To: ant-user@jakarta.apache.org From: otisg@ivillage.com X-Mailer: Web Mail 3.9.3.5 X-Sent-From: otisg@ivillage.com Subject: Re: javac include that avoids rebuilding everything? X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I think the first problem is that your source dir and destination dir in the javac task are different. I'm not 100% sure about that. In the case of the project for which I am using Ant, I copy all sources in a directory that I call 'build/compile' The equivalent would be: cp -a MySourceDir/* build/compile/ I then have source dir and destinatin dir for the javac task set to the same thing: build/compile That way, if there is a .java file build/compile/com/foo/bar/Barbie.java the compiled class will end up being at build/compile/com/foo/bar/Barbie.class That is the only way that I was able to prevent javac/jikes from recompiling over 1300 of our .java files every time I use ant to compile things. If there is a better way I'm all eyes! Otis On Tue, 02 October 2001, Scott Ellsworth wrote: > > Howdy, all. > > I note that the task for javac says: > > "If you include part of your package-structure inside the srcdir-attribute > (or nested src-elements) Ant will start to recompile your sources every > time you call it." > > This is exactly what ANT is doing to me at the moment, and I cannot figure > out how to rewrite my build.xml file to make it work. > > My directory structure for this is: > > -org > --metagraph > ---lib > ---app > ----experiment > > My build.xml file is in foo/org/metagraph/app/experiment. Up at the top, I > define > > I want to compile all of the files in experiment, using various libs in > lib. The following javac task does it, but as the documentation warns, it > recompiles everything each time. > > > > srcdir="${src}" > destdir="${build-debug}" > classpath="${utilclasspath}" > /> > > > I tried changing it to: > > > > srcdir="${src}/test" > includes="org/metagraph/app/import/**" > destdir="${build-debug}" > classpath="${utilclasspath}" > /> > > > where test is a directory with nothing in it, but then it did not recompile > anything. > > I must be missing something basic here. For various reasons, the build.xml > file has to be in org.metagraph.app.experiment, and the build must be run > from there, but this should not be an insolvable problem, right? > > The complete file which rebuilds the world, as the documentation warns, is > attached below. > > > > > > > > > > > > > value="${libdir}/metagraph.jar:${libdir}/mysql.jar:${libdir}/log4j.jar:${libdir}/xerces.jar:${libdir}/jdom.jar"/> > > > > > > > > > > > > > > > > > destdir="${build-debug}" > cache="${depcache-debug}" > closure="yes" > /> > > destdir="${build-release}" > cache="${depcache-release}" > closure="yes" > /> > > > > > debug="on" > optimize="off" > srcdir="${src}" > destdir="${build-debug}" > classpath="${utilclasspath}" > /> > > > > > debug="off" > optimize="on" > srcdir="${src}" > destdir="${build-release}" > classpath="${libdir}/metagraph.jar:${libdir}/mysql.jar:${libdir}/log4j.jar:${libdir}/xerces.jar:${libdir}/jdom.jar" > /> > > > > > jarfile="${dist}/expImport-${DSTAMP}-debug.jar" > basedir="${build-debug}" > compress="false" > /> > > > > > jarfile="${dist}/expImport-${DSTAMP}.jar" > basedir="${build-release}" > compress="true" > /> > > > > > > > > > > > > > Scott > Scott Ellsworth > scott@alodar.com _________________________________________________________________ iVillage.com: Solutions for Your Life Check out the most exciting women's community on the Web http://www.ivillage.com