Excluding some source files from javadoc generation using ANT [duplicate]

雨燕双飞 提交于 2020-01-06 15:58:16

问题


Possible Duplicate:
How can I make an Ant Javadoc class exclude two files?

I want to exclude javadoc generation for some eclipse related files, say Activator.java from my ant javadoc target. I have my below sample of code which generates javadoc for different java projects under single document.

<project basedir="." default="jdoc" name="ANT_TASK">
<target description="creates the javadoc for the XXXXX module" name="jdoc">
      <javadoc
               destdir="docs/api"
               use="true"
               public="true"
               splitindex="true"
               classpath="..\com.sample.script.modules\bin"
               packagenames="com.sample.package1,
                             com.sample.test1"
               windowtitle="XXXXX 1.0 API"> 
        <sourcepath>
              <pathelement path="..\com.sample.package\src"/>
              <pathelement path="..\com.sample.test\src"/>        
        </sourcepath>
        <doctitle><![CDATA[<h1>XXXXX 1.0 API</h1>]]></doctitle>
        <bottom><![CDATA[<i>Copyright &#169; 1999-2012 XXXX company Ltd. All Rights Reserved.</i>]]></bottom>
      </javadoc>
</target>
</project>

Can anyone help me how should I exclude the Activator.java file from javadoc generation.


回答1:


Straight from the javadoc ant task:

<fileset dir="src" defaultexcludes="yes">
  <include name="com/dummy/test/**"/>
  <exclude name="com/dummy/test/doc-files/**"/>
</fileset>

<doctitle><![CDATA[<h1>Test</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright &#169; 2000 Dummy Corp. All Rights Reserved.</i>]]></bottom>
<tag name="todo" scope="all" description="To do:"/>
<group title="Group 1 Packages" packages="com.dummy.test.a*"/>
<group title="Group 2 Packages" packages="com.dummy.test.b*:com.dummy.test.c*"/>
<link offline="true" href="http://download.oracle.com/javase/6/docs/api/" packagelistLoc="C:\tmp"/>
<link href="http://developer.java.sun.com/developer/products/xml/docs/api/"/>

So I would pou the file into the exclude list of the fileset.



来源:https://stackoverflow.com/questions/11757587/excluding-some-source-files-from-javadoc-generation-using-ant

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!