ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joel Rees" <>
Subject Re: always recompiles <solved/>
Date Tue, 09 Apr 2002 07:51:02 GMT
Stefan Bodewig suggested:

> On Mon, 8 Apr 2002, Joel Rees <> wrote:
> >   <property name="src" value="."/>
> >   <property name="build" value="../classes"/>
> I'd highly recommend location instead of value here.
> >     <javac
> >         srcdir="${src}/${dbdriver_loc}"
> >         destdir="${build}"
> >         debug="on"/>
> srcdir should be the top of the source tree, which is ${src} in your
> case.

Not sure what you mean by location instead of value, but here's what I did:

<?xml version="1.0" encoding="Shift_JIS" ?>
<project name="My_project" default="rest" basedir="src">

  <!-- set global properties for this build -->
  <property name="src" value="."/>
  <property name="build" value="../classes"/>
  <property name="dbdriver" value="jp/gr/alpsgiken/myclass/dbdriver"/>

  <target name="init">
    <!-- ?????????? -->
    <!-- ??????????????? -->
    <mkdir dir="${build}/${dbdriver}"/>

  <target name="dbdriver" depends="init">
    <!-- dbdriver ???????????? ${build} ?????????? -->
    <javac destdir="${build}" debug="on">
        <src path="${src}"/>
        <include name="${dbdriver}/*.java"/>

  <target name="rest" depends="dbdriver">
    <!-- ??????????????? ${build} ?????????? -->
    <javac destdir="${build}" debug="on">
        <src path="${src}"/>
        <exclude name="${dbdriver}/**"/>


dbdriver is "package". I'm in the process
of modularizing the code, and the dbdriver class was the first package to
fall out. This keeps the dependencies straight, and does not cause
unnecessary recompiling. The rest of the packages will fall out in a similar

The exclude element/property was relatively intuitive to me, but include was
a little counter-intuitive, until I caught onto src/srcdir being directories
rather than files. I guess that's what you mean by location instead of

Thanks, and sorry for the noise.

Joel Rees
Alps Giken Kansai Systems Develoment
Suita, Osaka

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message