[英]Dokka 1.4.20 “Nothing to document”
Dokka 1.4.20 不生成任何文檔並為所有任務返回以下內容
> Task :dokkaJavadoc
Dokka 1.4.* is an alpha project
Initializing plugins
Validity check
Creating documentation models
Exiting Generation: Nothing to document
build.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 面板中運行任務都不起作用。
文檔還指定了一堆配置的東西,但是很不清楚,其中一半給了我額外的錯誤,比如設置 output 目錄。
我也嘗試過 0.9.17 版本,但沒有成功。
似乎您在模塊級別 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
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.