1

I have a module with Kotlin code, and Dokka integrated.

When I'm running ./gradlew :core:clean :core:dokkaHtml I'm getting following output with Java syntax, while this code is pure Kotlin:

enter image description here

Why and how to fix it?

BZKN
  • 1,499
  • 2
  • 10
  • 25
artem
  • 16,382
  • 34
  • 113
  • 189
  • the second example in the [readme](https://github.com/Kotlin/dokka#applying-plugins) is how to add dokkaHtml to dokkaJavadoc. – AlexT Jan 14 '22 at 18:32
  • @Alex.T lol, it's true, stupid me, the problem is that I've _added_ this dependency. Now I removed it and it works fine (and generates Kotlin docs). Could you please post your comment as an answer, so I can mark it as accepted? – artem Jan 14 '22 at 18:37

1 Answers1

1

According to the dokka readme:

Applying plugins Dokka plugin creates Gradle configuration for each output format in the form of dokka${format}Plugin:

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:

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

To generate the documentation, use the appropriate dokka${format} Gradle task:

./gradlew dokkaHtml
AlexT
  • 2,524
  • 1
  • 11
  • 23