ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: javac and src tags
Date Mon, 02 Sep 2002 13:55:07 GMT
On Fri, 23 Aug 2002, Glenn Kidd <GKidd@placeware.com> wrote:

> I am compiling some classes in a folder call it src, the JUnit test
> classes are in a folder called test.  I want to be able to compile
> both using the same javac.  That is all fine, I accomplished this by
> using 2 src tags inside the javac task.

The alternative:

<path id="my-src-dirs">
  <dirset dir="common-parent-of-src-and-test">
    <include name="path-leading-to-src" />
    <include name="path-leading-to-test" />
  </dirset>
</path>

<javac ...>
  ...
  <src refid="my-src-dirs" />
</javac>

This may look more complicated, but ...

> We are trying to use this build script for multiple projects, the
> problem is that in some projects the test directory does not exist
> and this causes the target to fail.

If either of both directories is not there, it will not be included in
the dirset and thus not show up in the path (requires Ant 1.5).

Stefan

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