Problems with FileSet in Ant script?
I am using an Ant script to generate javadoc and I just just wnt Ant looking for some classes based on a certain template, so I wrote:
<javadoc access="public" source="1.6" sourcepath="src" destdir="dest" >
<fileset dir="src" casesensitive="yes" defaultexcludes="yes">
<filename name="**/ABC*.java"/>
</fileset>
</javadoc>
This means that I only want Ant to look for the source file that starts with "ABC" and generate javadoc for those files. However, the results are duplicated for each file starting with "ABC".
Did I do something wrong?
thanks
+2
a source to share
3 answers
The problem comes from the use of the attribute sourcepath
and nested tag fileset
. If you cancel sourcepath
and just get it fileset
, you should be fine. that is, instead of
<javadoc access="public" source="1.6" sourcepath="src" destdir="dest" >
<fileset dir="src" casesensitive="yes" defaultexcludes="yes">
<filename name="**/ABC*.java"/>
</fileset>
</javadoc>
just do:
<javadoc access="public" source="1.6" destdir="dest" >
<fileset dir="src" casesensitive="yes" defaultexcludes="yes">
<filename name="**/ABC*.java"/>
</fileset>
</javadoc>
+3
a source to share