ant-user mailing list archives

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


> On Mon, 8 Apr 2002, Joel Rees <joel@alpsgiken.gr.jp> 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">
    <!-- ?????????? -->
    <tstamp/>
    <!-- ??????????????? -->
    <mkdir dir="${build}/${dbdriver}"/>
  </target>

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

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

</project>

dbdriver is "package jp.gr.alpsgiken.myclass.dbdriver". 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
way.

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

Thanks, and sorry for the noise.

Joel Rees
Alps Giken Kansai Systems Develoment
Suita, Osaka




--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message