ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kuiper, Arnout" <Arnout.Kui...@nl.origin-it.com>
Subject RE: Classic command line on NT
Date Fri, 28 Apr 2000 08:35:13 GMT
> From: Steve Peterson [mailto:stevep-hv@virtation.com]
> I'm having an issue with the destination directory for .class 
> files in Ant 
> builds.  My goal is to have the .class file live in the same 
> directory as 
> the .java file.
> 
> In my build.xml I say
> 
>    <javac
> 		srcdir="${src.java.dir}/com/databottling/fountain/core"
> 		destdir="${src.java.dir}/com/databottling/fountain/core"
> 		includes="Constants.java"
> 		debug="${debug}"
> 	/>
> 
> where <property name="src.java.dir" value="src"/>
> 
> If there is a Constants.class in the destdir, javac will 
> overwrite that 
> with the newly created .class.  If there isn't, javac creates a 
> com/databottling/fountain/core/Constants.class inside 
> destdir, which isn't 
> what I want.

There is a simple solution,

use destdir="${src.java.dir}". This is the root of the
class/package tree.

You might want to use srcdir="${src.java.dir}" also. Ant
will scan for sourcefiles within that tree. You can narrow
the search using includes and excludes.

Your example should look like:

<javac
  srcdir="${src.java.dir}"
  destdir="${src.java.dir}"
  includes="com/databottling/fountain/core/Constants.java"
  debug="${debug}"
/>

See the manual for more information on the include/exclude stuff.

Cheers,

  Arnout

Mime
View raw message