3

我在 build.gradle 文件中有以下配置:

buildscript {
    ext.dokka_version='0.9.15'
    repositories {
        jcenter()
    }

    dependencies {
        classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
    }
}

apply plugin: 'org.jetbrains.dokka'

task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
    outputFormat = 'javadoc'
    outputDirectory = "$buildDir/dokkaJavadoc"
}

task packageJavadoc(type: Jar, dependsOn: 'dokkaJavadoc') {
    from "$buildDir/dokkaJavadoc"
    classifier = 'javadoc'
}

artifacts {
    archives packageJavadoc
}

这会生成外观正确的 javadoc jar ("${moduleName}-javadoc.jar")。但是,当使用 Intellij Idea 导入时,虽然它被检测为 javdoc jar,但 IDE 支持不起作用。是与 dokka-javadoc 格式不兼容还是 gradle 配置错误?

4

0 回答 0