[英]Dokka generates docs with Java syntax instead of Kotlin
I have a module with Kotlin code, and Dokka integrated.我有一个带有 Kotlin 代码的模块,并且集成了 Dokka。
When I'm running ./gradlew:core:clean:core:dokkaHtml
I'm getting following output with Java syntax, while this code is pure Kotlin:当我运行
./gradlew:core:clean:core:dokkaHtml
时,我正在使用 Java 语法来关注 output,而这段代码是纯 Z539A3A5859D24FB7BFFAZ29E74D6:
Why and how to fix it?为什么以及如何解决它?
According to the dokka readme :根据 dokka自述文件:
Applying plugins Dokka plugin creates Gradle configuration for each output format in the form of
dokka${format}Plugin
:应用插件 Dokka 插件以
dokka${format}Plugin
的形式为每个 output 格式创建 Gradle 配置:
dependencies {
dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.6.10")
}
You can also create a custom Dokka task and add plugins directly inside:您还可以创建自定义 Dokka 任务并直接在其中添加插件:
val customDokkaTask by creating(DokkaTask::class) {
dependencies {
plugins("org.jetbrains.dokka:kotlin-as-java-plugin:1.6.10")
}
}
Please note that dokkaJavadoc task will properly document only single jvm source set
请注意,dokkaJavadoc 任务将仅正确记录单个 jvm 源集
To generate the documentation, use the appropriate dokka${format} Gradle task:
要生成文档,请使用适当的 dokka${format} Gradle 任务:
./gradlew dokkaHtml
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.