简体   繁体   English

Dokka 1.4.20 “无需记录”

[英]Dokka 1.4.20 “Nothing to document”

Dokka 1.4.20 does not generate any documentation and returns the following for all tasks 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 (Project) 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
}

It does generate the folders when using 1.4.20, but both command-line running as well as running the tasks in the Gradle panel do not work.它在使用 1.4.20 时会生成文件夹,但命令行运行以及在 Gradle 面板中运行任务都不起作用。

The documentation also specifies a bunch of things for configuration, but it is very unclear, and half of it gives me additional errors like setting the output directory.文档还指定了一堆配置的东西,但是很不清楚,其中一半给了我额外的错误,比如设置 output 目录。

I have tried version 0.9.17 as well, but with no success.我也尝试过 0.9.17 版本,但没有成功。

Seems like you're missing the following in your module level build.gradle (here for version 1.4.20)似乎您在模块级别 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

Just add the dokkaHtml task.只需添加dokkaHtml任务。 Keep in mind syntax has significantly change since version 1.x.请记住,自 1.x 版以来,语法发生了显着变化。 In version prior to 1.4x you will have to use the following syntax在 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM