问题
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 © 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 © 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