<Dokka 2.0.0> has been released! With a focus on s...
# dokka
o
Dokka 2.0.0 has been released! With a focus on simplifying configuration and preparing for support of future Kotlin language features. Key highlights include: • Dokka Gradle Plugin v2: revamped Gradle plugin based on Dokkatoo. • Experimental K2 Analysis: support for K2 compiler frontend. • HTML Improvements: better accessibility and easier customization. More details about changes can be found in the release notes! We would really appreciate your feedback! kodee loving
K 9
🎉 11
🎉 7
s
As the new plugin is based on Dokkatoo, it would be great if the migration guide also covered migrating from Dokkatoo instead of from Dokka < 2.0.0.
o
We considered it initially, but decided not to do it, because: • majority of the users are using Dokka 1.X and not Dokkatoo • DGPv2 and Dokkatoo have very similar API (as ones code is based on another) While I understand, that it would be nice to have also an additional migration guide for Dokkatoo, our resources are finite kodee floating You can also take a look on a great work of @mbonnin of migration of apollo-kotlin from Dokkatoo to DGPv2!
💙 1
s
> You can also take a look on a great work of @mbonnin of migration of apollo-kotlin from Dokkatoo to DGPv2! Many thanks for that pointer!
On a related note, is there an official statement about the future of https://github.com/adamko-dev/dokkatoo? Will adamko-dev contribute to Dokka 2.0 instead going forward?
j
Is it impossible to avoid having the property
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
? I have a lot of projects and having to add that property to all of them will be really annoying. As V2 is the default state for the new version, I think keeping that property to have the setup working is not nice, maybe
Copy code
org.jetbrains.dokka.experimental.gradle.pluginMode=V1Enabled //V2Enabled is the default
a
On a related note, is there an official statement about the future of https://github.com/adamko-dev/dokkatoo? Will adamko-dev contribute to Dokka 2.0 instead going forward?
Hi, yes, now I'm working at JetBrains I'll be working on the official Dokka Gradle Plugin. My plan for Dokkatoo is to transition it to a repo for community-supported Dokka formats, add-ons, extras, etc. For example, DGPv2 dropped support for Markdown and Jekyll, so I might transfer those to Dokkatoo. But there's no solid plans yet. I'm just waiting on time/energy/motivation.
🎉 1
1
kotest intensifies 1
o
Is it impossible to avoid having the property
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
?
it's possible to apply DGP via class name, e.g.
plugins.apply(DokkaHtmlPlugin::class)
Yeah, it's probably not very nice, but may be it will be fine for you
having to add that property to all of them will be really annoying
Yeah, I understand the frustration, but still, we need to have a graceful migration for a lot of Dokka users In future versions we will flip the default to v2 and emit a warning about unnecessary property, so you will be able to drop it. Even while DGPv2 is very cool and supports all new features, it's a big shift comparing to DGPv1, so we don't want to just break build scripts for all users It's not the first time we hear this concern and I've written a bit more under the 2.0.0-Beta post
👍 1
a
Is it impossible to avoid having the property org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled?
To add to Oleg's answer, the main thing we were concerned with is making it less confusing in the future when DGPv2 is the default. We wanted the opt-in flag to be as ephemeral as possible. If we did something more permanent, like publishing a Gradle plugin ID for DGPv2, it would always be published forever, and would definitely confuse people in the future when DGPv1 is a distant memory!
👍 2
l
The table here says there is a
dokkaGenerateHtml
task. https://kotlinlang.org/docs/dokka-migration.html#select-documentation-output-format But I see only
dokkaGenerateModuleHtml
and
dokkanGeneratePublicationHtml
in my project (one-module).
Context: I have an Android project, where I manually pack the documentation in a jar file like this (in v1). I'm not sure how / if I should migrate it:
Copy code
tasks.register<Jar>("dokkaHtmlJar") {
    dependsOn(tasks.dokkaHtml)
    from(tasks.dokkaHtml.flatMap { it.outputDirectory })
    archiveClassifier.set("html-docs")
}
The
dokkaHtml
task is still available in DGPv2
a
hi @Lukasz Kalnik, thanks for finding this. It looks like either a mistake in the docs or the plugin that should be fixed. I'll have a look. For now, to create a JAR from the Dokka HTML you can replace
Copy code
from(tasks.dokkaHtml.flatMap { it.outputDirectory })
with
Copy code
from(tasks.dokkaGeneratePublicationHtml.flatMap { it.outputDirectory })
There's a complete example in the repo here: https://github.com/Kotlin/dokka/blob/v2.0.0/examples/gradle-v2/library-publishing-example/build.gradle.kts#L18-L22
l
Amazing, thanks for the quick response!
a
👍 1