为Gradle Javadoc任务指定所需的软件包 [英] Specifying desired packages for Gradle Javadoc task

查看:61
本文介绍了为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任务指定所需的软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆