ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Moynihan <>
Subject javac/javadoc with a common fileset for source files
Date Thu, 30 Aug 2007 12:28:21 GMT
Hi all,

I'm just wondering if it's possible to have the javac & javadoc tasks 
share a common fileset.

I have a series of builds with more than one source directory.  I would 
ideally like a mechanism to specify the directories/files for both of 
these once and reuse that definition in both the javadoc and javac tasks.

We have quite a complex build where we import a base ant file which we 
override selectively depending on the build.  What I'd like to do is 
specify once in base.xml something like (abbreviated):

     <!-- override src.dirs in top level build when we want multiple 
directories etc... -->
     <fileset dir="${src.dir}" id="src.dirs">
       <include name="**/*.java"/>

     <target name="build">
           <fileset refid="src.dirs"/> <!-- problem -->
           <classpath refid="build.classpath"/>

     <target name="java-doc">
           <classpath refid="build.classpath"/>
           <fileset refid="src.dirs"/> <!-- works ok -->

Unfortunately the above doesn't work as javac won't accept a fileset in 
order to specify it's source directories (where as javadoc does). 
Ideally I'd like to keep things DRY and not have to resort to 
duplicating the specification of my src directories.  Is this possible?

Thanks in advance,


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

View raw message