ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: javac and src tags
Date Mon, 02 Sep 2002 13:55:07 GMT
On Fri, 23 Aug 2002, Glenn Kidd <> 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" />

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

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


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

View raw message