tags:

views:

124

answers:

2

Hi,

I am using Ant script to generate javadoc and I just only wnt Ant to look for some classes based on a certain pattern, 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>                       

That means I only want Ant to look for source file that starts with "ABC" only and generate javadoc for these files. However, the results are awayls duplicate for each file starting with "ABC".

Did I do something wrong?

Thanks

A: 

Can you try with a nested include inside fileset, instead of filename like

<include name="**/ABC*"/>

or use the packagenames attribute within javadoc tag as

 <javadoc packagenames="*.abc*"
JoseK
Thanks for your reply, I have tried <include name="**/ABC*"/> but the results are the same as I did before. and it did not work with <javadoc packagenames="*.abc*". Any thoughts?
ipkiss
well by any chance the same files "**/ABC*.java present under 2 different packages in the code base?
JoseK
No, it is not. There is only file. For example, I have ABC_E1.java, ABC_E2.java and the results are ABC_E1.java,ABC_E1.java,ABC_E2.java,ABC_E2.java; and even more all files that do not start with "ABC" are displayed as well. If I dont use <include name="**/ABC*"/> (or something similar) then the result is not duplicate but it has other files which do not start with "ABC" as well (which I do not want)
ipkiss
i have tried this myself and cant get it to work. looks like javadoc does not honour nested FileSet/Include patterns
JoseK
+1  A: 

You cannot use complex file-patterns in the javadoc task.

The javadoc for the Ant Javadoc class mentions this as a limitation:

==Begin Quote===

Current known limitations are:

  • patterns must be of the form "xxx.*", every other pattern doesn't work.

  • ...

==End Quote===

Hippo