本文介绍了为Gradle Javadoc任务指定所需的软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将ant构建文件转换为Gradle,我想知道是否存在一种方法,可以像在package中使用"packagenames"一样指定应在javadoc中使用哪些软件包?

I'm trying to convert an ant build file to Gradle and I was wondering if there exists a way to specify which packages should be in the javadoc in the same way 'packagenames' works in ant?

谢谢乔纳森

推荐答案

请参见包含"/排除"属性或相关方法.这些模式使用与ant相同的语法.

See the 'includes'/'excludes' properties, or related methods. The patterns use the same syntax as ant.

javadoc {
    exclude "**/internal/**"
}

再举一个例子,如果构建过程将Java源文件生成到构建目录中,则可以使用以下命令生成Javadocs:

As another example, if the build process generates Java source files into a build directory, the Javadocs can be generated using:

javadoc {
  source = "$buildDir/"
  include( "**/*.java" )
}

这可确保仅解析.java文件.请注意,括号是可选的.

This ensures that only .java files are parsed. Note that the parentheses are optional.

这篇关于为Gradle Javadoc任务指定所需的软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 17:58