ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wildish, Joe STASCO-OTO/72" <>
Subject Javac: multiple source roots & filesets
Date Wed, 26 Apr 2006 09:08:44 GMT

New to the list, not new to ANT. Am using v1.6.5. I've had a scan through the archives of
this list but I can't find an answer to my question.. so here goes: I have two source roots,
root_a and root_b. Beneath those directories are some source files, some of which are for
the same class. e.g.


I want to compile up the source files of my choosing, without copying files around to temporary
areas (I can achieve what I want via copy, but I should be able to do it just via javac).
Let's say that I want to choose "package.Two" from the root_b directory; if this was command
line, I could do the following:

$ mkdir classes
$ javac -d classes root_a/package/ root_b/package/ root_b/package/

... and it would work fine. However, I can't seem to replicate this in an ANT target. As filesets
are relative to the specificed directory, I cannot find a way to exclude certain files from
one source root, as effectively I am working within the same namespace.

What I really want to do is something like this:

<javac destdir="classes">
        <fileset dir="root_a">
            <include name="**/*.java"/>
            <exclude name="package/"/>
        <fileset dir="root_b">
            <include name="**/*.java"/>

However, the src attribute of javac is only looking for directories (to then recursively scan),
so that does not work. Any help would be appreciated.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message