Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio - Gradle generate specific javadoc files

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?

like image 812
Ben987654 Avatar asked Jan 26 '16 00:01

Ben987654


1 Answers

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
}
like image 122
Ben987654 Avatar answered Nov 20 '22 20:11

Ben987654