How generate javadoc with Gradle?

前端 未结 1 1486
粉色の甜心
粉色の甜心 2020-12-30 05:35

I would like generate javadoc out of aar lib file, but my actual task not work and finish with error. I\'m somewhat lost with gradle.

Where should generate javadocs?

相关标签:
1条回答
  • 2020-12-30 06:21

    If you are following standard project structure then use:

    apply plugin: 'java'
    
    javadoc {
        source = sourceSets.main.allJava
        classpath = configurations.compile
    }
    

    If not then you need to specify the include closure. Add the closure like:

    include 'path/to/directory/*'
    

    If include closure is not working then add sourceSet closure with srcDir pointing to the module/java directory:

    sourceSets {
        build {
            java.srcDir file('src/main/java')
    
        }
    }
    

    And after that run $gradle javadoc command. Then check your build directory for html files having all javadocs. Note: Replace srcDir with your root package path.

    0 讨论(0)
提交回复
热议问题