无法使用 Dokka 生成 Kdoc

Unable to generate Kdoc using Dokka

我正在尝试在 Android 项目中生成 KDoc 文档。以下是添加此功能的相关文件。

build.gradle(根级别):

buildscript {
    ...
    ext.dokka_version = "0.10.1"
    repositories {
        ...
        maven { url "https://dl.bintray.com/kotlin/kotlin-eap/" }
    }
    dependencies {
        ...
        classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
    }
}
...

build.gradle(模块:应用程序)

...
apply plugin: 'org.jetbrains.dokka'

...

dokka {
    outputFormat = 'html' // use 'javadoc' to get standard java docs
    outputDirectory = "$buildDir/javadoc"

    configuration {
        includeNonPublic = false
        skipEmptyPackages = true
        skipDeprecated = true
        reportUndocumented = true
        jdkVersion = 8
    }
}

后来我是运行./gradlew dokka命令行的。但是没有生成任何输出。以下是我得到的:

> Task :app:dokka
logging: loading modules: [java.se, jdk.accessibility, jdk.attach, jdk.compiler, jdk.dynalink, jdk.httpserver, jdk.jartool, jdk.javadoc, jdk.jconsole, jdk.jdi, jdk.jfr, jdk.jshell, jdk.jsobject, jdk.management, jdk.management.jfr, jdk.net, jdk.scripting.nashorn, jdk.sctp, jdk.security.auth, jdk.security.jgss, jdk.unsupported, jdk.unsupported.desktop, jdk.xml.dom, java.base, java.compiler, java.datatransfer, java.desktop, java.xml, java.instrument, java.logging, java.management, java.management.rmi, java.rmi, java.naming, java.net.http, java.prefs, java.scripting, java.security.jgss, java.security.sasl, java.sql, java.transaction.xa, java.sql.rowset, java.xml.crypto, jdk.internal.jvmstat, jdk.management.agent, jdk.jdwp.agent, jdk.internal.ed, jdk.internal.le, jdk.internal.opt]
No documentation for io.elektrifi.outageplanner.GettingStartedActivity (GettingStartedActivity.kt:9)
No documentation for io.elektrifi.outageplanner.GettingStartedActivity$<init>() (GettingStartedActivity.kt:9)
No documentation for io.elektrifi.outageplanner.GettingStartedActivity$onCreate(android.os.Bundle) (GettingStartedActivity.kt:10)
No documentation for io.elektrifi.outageplanner.LoginActivity (LoginActivity.kt:6)
No documentation for io.elektrifi.outageplanner.LoginActivity$<init>() (LoginActivity.kt:6)
No documentation for io.elektrifi.outageplanner.LoginActivity$onCreate(android.os.Bundle) (LoginActivity.kt:7)
No documentation for io.elektrifi.outageplanner.MainActivity (MainActivity.kt:17)
No documentation for io.elektrifi.outageplanner.MainActivity$<init>() (MainActivity.kt:17)
No documentation for io.elektrifi.outageplanner.MainActivity$onCreate(android.os.Bundle) (MainActivity.kt:18)
No documentation for io.elektrifi.outageplanner.RegisterActivity (RegisterActivity.kt:6)
No documentation for io.elektrifi.outageplanner.RegisterActivity$<init>() (RegisterActivity.kt:6)
No documentation for io.elektrifi.outageplanner.RegisterActivity$onCreate(android.os.Bundle) (RegisterActivity.kt:7)
No documentation for io.elektrifi.outageplanner.SplashScreenActivity (SplashScreenActivity.kt:16)
No documentation for io.elektrifi.outageplanner.SplashScreenActivity$<init>() (SplashScreenActivity.kt:16)
No documentation for io.elektrifi.outageplanner.SplashScreenActivity$onCreate(android.os.Bundle) (SplashScreenActivity.kt:19)

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings

其实在MainActivity中有一个小的demo脚本。我不确定为什么什么都没有生成。请让我知道我的配置是否正确。另外,如果能有一个有效的配置就好了。

我是新手,所以没有意识到。以上配置有效。 KDoc 注释必须在我们正在记录的 class 或函数之上。我在 Kotlin 文件的最顶部(导入和打包之前)以 /** 开始评论并以 */ 结束,但它没有用。