ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject RE: Why does <javac> recompile even source not modified?
Date Tue, 22 May 2001 19:28:10 GMT
--- Rajkumar Seth <> wrote:
> I tried this based on the  example code and it does not seem to do
> anything.
>  <javac srcdir="${build.classes}"
>         destdir="com/gerrard/equities/reconciliationserver/"
>         classpath="${classpath}"
>         debug="on"
>         deprecation="on"           
>         includes="utils/,utils/">
>     </javac>
> Does anyone have an example of a JAVAC that builds 2 files in a package
> with more than 2 files and then builds the rest of the package?

You need to have the srcdir package hierarchy and the destdir package
hierarchy match, in order for <javac> to be able to find the classfiles
for the source-files (so it can determine whether the classfile exists and
is newer than the source). In other words, if I have a source-tree that
looks like:
and I want my classfiles to go into:
then my <javac> srcdir and destdir attributes should point up to, but not
including, the first subdir of the package hierarchy:
and my includes attr would list the two filenames I wanted to include,
beginning with the package hierarchy:
  includes="com/fozbod/utils/, com/fozbod/utils/"

Note1: Even if you specify only certain files to compile, the Java
compiler may well decide it's going to compile more than that.
Note2: I would never actually hard-code in all those paths :)

Hope this helps,
> -----Original Message-----
> From: Suu Quan []
> Sent: 2001 May 22 00:52
> To:
> Subject: Re: Why does <javac> recompile even source not modified?
> ----- Original Message ----- 
> From: "Diane Holt" <>
> To: <>
> Sent: Monday, May 21, 2001 3:16 PM
> Subject: Re: Why does <javac> recompile even source not modified?
> > Use:
> > <target name="utils">
> >   <javac srcdir="/stp" destdir="/stp"
> >        includes="util/*.java" 
> >        excludes="util/"
> >        verbose="yes/>
> > </target>
> > 
> > IOW: The "srcdir" attr should point up to where the package hierarchy
> > begins, and the filenames should begin with the package hierarchy --
> it's
> > how it matches source-files to class-files.
> Diane
> Man, you're good. Fixed my build file and it worked.
> What do I owe you so far?
> ************************************************************************
> The contents of this message and any attachments are confidential and
> are intended solely for the attention and use of the addressee only.
> Information contained in this message may be subject to legal, 
> professional or other privilege or may otherwise be protected by other
> legal rules. This message should not be copied or forwarded to any other
> person without the express permission of the sender. If you are not the
> intended recipient you are not authorised to disclose, copy, distribute
> or retain this message or any part of it.
> If you have received this message in error, please notify the sender by
> telephone (+44-20-7002-4000) and destroy the original message.
> We reserve the right to monitor all e-mail messages passing through our
> network.
> ************************************************************************


Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices

View raw message