如何排除javadoc ant脚本上的文件



如何使Ant Javadoc类排除两个文件?

使用ANT从javadoc生成中排除一些源文件

我遇到同样的问题,但我还没有解决…我已经尝试了一些方法,但是没有一个适合我。

我代码:

<target name="javadocs">
<mkdir dir="${docs.dir}" />
<fileset dir="${project.dir}src" defaultexcludes="yes">
  <exclude name=".externalToolBuilders**"/>
</fileset>
<javadoc 
    excludepackagenames=".externalToolBuilders**"
    sourcepath="${project.dir}" 
    destdir="${docs.dir}" 
    classpath="${project.dir}" 
    author="true" version="true" 
    use="true" 
    doctitle="&lt;h1&gt;${app.name}&lt;/h1&gt;" />

EDIT-1:

after I try this:

<javadoc 
sourcepath="${project.dir}" 
destdir="${docs.dir}" 
classpath="${project.dir}" 
author="true" version="true" 
use="true" >            
<fileset dir="${project.dir}src" defaultexcludes="yes">
  <include name="**/*.java"/>
  <exclude name=".externalToolBuilders/**"/>
</fileset>
</javadoc>

我得到这个错误:

javadocs:
[javadoc] Generating Javadoc
[javadoc] Javadoc execution
[javadoc] Loading source file D:PaulPaulHostIPsrcAutofitTableColumns.java...
[javadoc] javadoc: error - Illegal package name: ".externalToolBuilders.one-jar-ant-task-0.97.ant.com.simontuffs.onejar.ant"
[javadoc] Loading source file D:PaulPaulHostIPsrcCToolTip.java...
[javadoc] javadoc: error - Illegal package name: ".externalToolBuilders.one-jar-ant-task-0.97.test.com.simontuffs.onejar.test"
[javadoc] Loading source file D:PaulPaulHostIPsrcHostIP.java...
[javadoc] Loading source file D:PaulPaulHostIPsrcRun.java...
[javadoc] Loading source file D:PaulPaulHostIPsrcTableColumnSynchronizer.java...
[javadoc] Loading source file D:PaulPaulHostIPsrcThreadDoSomething.java...
[javadoc] Loading source file D:PaulPaulHostIPsrcWork.java...
[javadoc] Loading source files for package src...
[javadoc] 2 errors

你可以这样做:

<javadoc 
    destdir="${docs.dir}" 
    author="true" version="true" 
    use="true" 
    doctitle="Test" >
    <fileset dir="${project.dir}/src" defaultexcludes="yes">
         <include name="**/*.java"/>
         <exclude name=".externalToolBuilders/**"/>
    </fileset>
</javadoc>

相关内容

  • 没有找到相关文章