Android Studio - Gradle 生成特定的 javadoc 文件 [英] Android Studio - Gradle generate specific javadoc files
问题描述
我需要为包含 3 个模块的项目生成一些 javadoc,我只需要每个模块的特定文件.
在 Android Studio 中,我可以转到工具 -> 生成 JavaDoc,然后设置自定义范围,并有选择地选择我想要的文件,并将它们聚合到一个 javadoc 文件夹中,但这不适用于我们的自动构建.>
我不知道如何在 gradle 命令行上执行此操作?
每个例子都是这个任务的一些变体
task javadoc(type: Javadoc) {源 = android.sourceSets.main.java.srcDirsclasspath+=project.files(android.getBootClasspath().join(File.pathSeparator))destinationDir = 文件(../javadoc/")失败错误假}
这会为整个模块生成 javadoc.我不知道如何只获取我想要的文件?
看起来你可以通过以下方式进行
task javadoc(type: Javadoc) {源 = android.sourceSets.main.java.srcDirsclasspath += project.files(android.getBootClasspath().join(File.pathSeparator))destinationDir = 文件(../javadoc/")包括(**/ClassFile1.java")包括(**/ClassFile2.java")失败错误假}
I need to generate some javadoc for a project that contains 3 modules, and I only need specific files from each module.
In Android Studio I can go Tools -> Generate JavaDoc and then set custom scope, and selectively choose the files I want and it aggregates them into a single javadoc folder, but this won't work for our automated build.
I can't figure out how to do this on the gradle command line?
Every example is some variation of this task
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath+=project.files(android.getBootClasspath().join(File.pathSeparator))
destinationDir = file("../javadoc/")
failOnError false
}
This generates the javadoc for the entire module. I can't figure out how to get only the files I want?
It looks like you can do it the following way
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
destinationDir = file("../javadoc/")
include("**/ClassFile1.java")
include("**/ClassFile2.java")
failOnError false
}
这篇关于Android Studio - Gradle 生成特定的 javadoc 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!