You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Glenn Kidd <GK...@placeware.com> on 2002/08/23 20:34:04 UTC
javac and src tags
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. 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. Any ideas on how I can accomplish this? Thanks in advance.
Glenn
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: javac and src tags
Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 23 Aug 2002, Glenn Kidd <GK...@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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>