ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ribeiro, Glauber" <>
Subject RE: File dependencies?
Date Tue, 05 Sep 2000 19:35:54 GMT

here's what i was doing wrong, maybe you're having the same problem (maybe
not). The platform, in my case, was Solaris, with java 1.2.1.

I was trying to set up as i usually do with makefiles, having one build.xml
file per package, then a "global" build.xml which used "ant" tasks to run
each of these. Each of the "package" build.xml files had srcdir of ".",
destdir pointing to the project root. Ant was compiling all files each time.

What i had to do was change to one build.xml file for the whole project,
pointing both srcdir and destdir to the project root. Now ant only
recompiles if it has to.

You can use the -v (or -verbose) option to see what files it's actually



-----Original Message-----
From: Barbara Samson []
Sent: Tuesday, September 05, 2000 1:55 PM
Cc: Christopher Todd
Subject: Re: File dependencies?

Based on the amount of time it takes to compile, I don't think this check is
happening. It takes me the same amount of time (approx 1 minute) to compile
source files after cleaning out the class files as it does
to re-compile the source a second time with the class files still present.

I am running the latest CVS version on Linux.


Chris Todd wrote

> If I'm not mistaken, that is the default behavior of Ant - it checks the
> last time modified of each .java file and compares it to any .class files
> finds.  As a matter of fact, from the Ant manual:
> Javac
> Description
> Compiles a source tree within the running (Ant) VM.
> The source and destination directory will be recursively scanned for Java
> source files to compile. Only Java files that have no corresponding class
> file or where the class file is older than the java file will be compiled.
> This can be viewed at:
> .90&content-type=text/html
> Chris Todd
> Software Engineer
> Alabanza Corporation
> > -----Original Message-----
> > From: Ribeiro, Glauber []
> > Sent: Tuesday, September 05, 2000 1:57 PM
> > To: ''
> > Subject: File dependencies?
> >
> >
> > Hello,
> >
> > sorry if this is a newbie kind of question, but the FAQ server seems to
> > offline.
> >
> > I just started using Ant, and i like it. I haven't figured out
> > how to set up
> > a build.xml file so that Ant compiles only the files that have
> > changed (like
> > you do with a makefile). Is there a way to do this? It just feels
> > like there
> > should be.
> >
> > Thanks!
> >
> >
> > glauber ribeiro
> > (Experian, Schaumburg IL)
> > Opinions stated are my own and not representative of Experian.
> >

View raw message