ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajkumar Seth <Seth.Rajku...@GNI.co.uk>
Subject RE: Why does <javac> recompile even source not modified?
Date Wed, 23 May 2001 13:23:08 GMT
Thanks I found the problem the 2 files in the package ended in .Java not
.java so javac would not process them.
I didn't need to compile them separately.

Seth

-----Original Message-----
From: Diane Holt [mailto:holtdl@yahoo.com]
Sent: 2001 May 22 20:28
To: ant-user@jakarta.apache.org
Subject: RE: Why does <javac> recompile even source not modified?


--- Rajkumar Seth <Seth.Rajkumar@GNI.co.uk> 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/JVMFunctions.java,utils/NetworkFunctions.java">
>     </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:
  /home/dianeh/src/java/com/fozbod/utils/{*.java}
and I want my classfiles to go into:
  /home/dianeh/classes
then my <javac> srcdir and destdir attributes should point up to, but not
including, the first subdir of the package hierarchy:
  srcdir="/home/dianeh/src/java"
  destdir="/home/dianeh/classes"
and my includes attr would list the two filenames I wanted to include,
beginning with the package hierarchy:
  includes="com/fozbod/utils/Foo.java, com/fozbod/utils/Bar.java"

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,
Diane
 
> -----Original Message-----
> From: Suu Quan [mailto:squan@wwc.com]
> Sent: 2001 May 22 00:52
> To: ant-user@jakarta.apache.org
> Subject: Re: Why does <javac> recompile even source not modified?
> 
> 
> ----- Original Message ----- 
> From: "Diane Holt" <holtdl@yahoo.com>
> To: <ant-user@jakarta.apache.org>
> 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/Copy.java"
> >        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.
> ************************************************************************


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/


************************************************************************
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.
************************************************************************

Mime
View raw message