Android Studio - Gradle generate specific javadoc files

旧巷老猫 提交于 2021-02-07 13:36:40

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!