ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: Ant/javac
Date Thu, 25 Jan 2001 00:15:08 GMT
Just a note: That particular answer is only true if the source-files are
part of a package.

Diane

--- Kevin Mukhar <kevin.mukhar@corp.usa.net> wrote:
> Tina Armstrong wrote:
> > 
> > however, it re-compiles everything everytime, and I thought that the
> following should apply:
> > The source and destination directory will be recursively scanned for
> Java source files to compile. 
> 
> Here's the answer from Douglas Bitting <Douglas.Bitting@agilesoft.com>
> Subject: RE: javac always recompiles all files
> Date: Mon, 22 Jan 2001 15:35:33 -0800
> 
> > Change:
> >
> >     <target name="compile" depends="prepare">
> >        <javac srcdir="com" destdir="${build.dir}/classes" debug="on"
> >           deprecation="off" optimize="off"/>
> >     </target>
> > 
> > To:
> > 
> >     <target name="compile" depends="prepare">
> >        <javac destdir="${build.dir}/classes" debug="on"
> >           deprecation="off" optimize="off"
> >           includes="com"/>
> >     </target>
> > 
> > By setting 'srcdir="com"', you are telling javac that package names
> should be
> > resolved relative to "com", which is probably not what you want.
> > Instead specify 'includes="com"' to tell the javac task to look within
> the 'com'
> > directory for source files.
> > 
> > For example, assume you have a file located at "com/foo/bar.java",
> with a package
> > declaration of "package com.foo".  When bar.java is compiled, the
> > compiler will place it within the 'com.foo' package.  However,
> according to your
> > build.xml, when the javac task does its dependency sweep, it will be
> > looking for 'bar' within the package 'foo' (not 'com.foo').  Not
> finding it, the
> > javac task will think it needs to be recompiled.
> > 
> > Wow, that explanation sure looks overly complicated to me.  I hope you
> can make
> > sense of it!  :-)
> >


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



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

Mime
View raw message