Dokka 1.4.20不生成任何文档,并为所有任务返回以下内容
> Task :dokkaJavadoc
Dokka 1.4.* is an alpha project
Initializing plugins
Validity check
Creating documentation models
Exiting Generation: Nothing to documentbuild.gradle (项目)
buildscript {
// omitted a bunch of versions here
ext.version_dokka = '1.4.20'//0.9.17//1.4.20
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath("org.jetbrains.dokka:dokka-gradle-plugin:$version_dokka")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id("org.jetbrains.dokka") version "$version_dokka"
}
allprojects {
repositories {
google()
jcenter()
}
// used for testing 0.9.17
// dokka {
// outputFormat = 'html'
// outputDirectory = "$buildDir/documentation "
//
// }
}
task clean(type: Delete) {
delete rootProject.buildDir
}它在使用1.4.20时会生成文件夹,但命令行运行和Gradle面板中的任务都不起作用。
文档还为配置指定了一堆东西,但它非常不清楚,其中有一半给了我额外的错误,比如设置输出目录。
我也尝试过0.9.17版本,但没有成功。
发布于 2021-03-10 18:08:52
看起来你在你的模块级build.gradle (这里是1.4.20版本)中遗漏了以下内容
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'kotlinx-serialization'
id 'org.jetbrains.dokka'
}
dokkaHtml {
dokkaSourceSets {
named("main") {
includeNonPublic.set(false)
skipEmptyPackages.set(true)
skipDeprecated.set(true)
reportUndocumented.set(true)
jdkVersion.set(8)
}
}
}
android {
compileSdkVersion 30只需添加dokkaHtml任务即可。请记住,自1.x版以来,语法发生了重大变化。在1.4x之前的版本中,您必须使用以下语法
dokka {
outputFormat = 'html'
outputDirectory = "$buildDir/dokka/html"
configuration {
includeNonPublic = false
skipEmptyPackages = true
skipDeprecated = true
reportUndocumented = true
jdkVersion = 8
}
}https://stackoverflow.com/questions/65260195
复制相似问题