问题
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?
回答1:
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
}
来源:https://stackoverflow.com/questions/35004765/android-studio-gradle-generate-specific-javadoc-files