Dokka Gradle Plugin
Starting from Dokka 2.1.0, the new Dokka Gradle Plugin is enabled by default. The documentation on kotlinlang.org has been updated accordingly:
- See Get started with Dokka for instructions on adding Dokka to a project
- See Migrate to Dokka Gradle plugin v2 for migrating from the old plugin
Dokka 2.2.0-Beta introduces multiple improvements and fixes:
Note: most of the following changes affect only the new Dokka Gradle Plugin, enabled by default since Dokka 2.1.0
- Compatibility with Android Gradle Plugin 9.0.0, including Built-in Kotlin. (#4231, #4295, #4412)
- Android Gradle Library Plugin for KMP is now properly supported. (#4359, #4366)
- Support the new Kotlin Gradle Plugin API to work with generated sources (#4402, #4410)
- Fix
suppressGeneratedFilesflag was unused (#4348) - Improve classpath resolution and platform detection logic (#4296, #4263, #4258)
- Add
olderVersionsDirNameto DokkaVersioningPluginParameters (#4301). Thanks to @osipxd! - Rework the Gradle attributes to make them integrate better with the ecosystem (#4334). Thanks to @martinbonnin!
- Drop usages of APIs deprecated in KGP (#4271)
- this change makes deprecated DGPv1 be compatible with KGP 1.9.0+, aligning it with DGPv2
Analysis improvements
Starting from Dokka 2.1.0, the K2 analysis is enabled by default. K2 analysis is now stable, enabled by default, and fully migrated to the new shared Analysis API. This includes the migration to the new KDoc resolution API within the Analysis API.
Dokka 2.2.0-Beta introduces multiple improvements and fixes:
Note: most of the following changes affect only Dokka's K2 analysis, enabled by default since Dokka 2.1.0
- Allow
actualdeclarations to automatically inherit their documentation fromexpectcounterparts in multiplatform projects (#2493, #4245, #4351) - Link resolution improvements:
- Support references to declarations with quoted names (#3356)
- Support resolution of links to extensions with type parameters according to KEEP#385 (#3555)
- Improve handling of ambiguous KDoc links according to KEEP#389 (#3451, #3179, #3632, #4327, #3604)
- Note: those changes are currently available only under experimental
org.jetbrains.dokka.analysis.enableExperimentalKDocResolutionsystem property
- Note: those changes are currently available only under experimental
- K2/K1 compatibility improvements:
- Fix
Multiple pages associated with key(#4300) - Fix inconsistent constructor rendering for expect/actual annotation (#4055)
- Fix missing abstract modifier for abstract interface method with redundant open modifier (#4144)
- Fix working with intersected and overridden fake functions/properties (#3857)
- Fix rendering of links in
@seeblock (#3680) - Fix redundant
?on properties with a type of typealias to nullable type (#4337) - Fix the missing default parameter value for inherited (not overridden) members (#4320)
- Fix duplicate source links for function overloads and properties (#4049, #4338)
- Fix resolution of links in the second line of KDoc tags (#4332, KT-75215, KT-79783)
- Fix
- Improve DRI handling for varargs and properties (#3558, #4347)
- Context parameters improvements:
- Java/Javadoc related improvements:
- Use language-java class for
<pre>and<code>tags generated from Java sources (#4346) - Add new
MarkDocTag,TextStyle.Highlightand support for<mark>javadoc HTML tag (#4376) - Fix source links to accessors in the KotlinAsJava plugin (#4396)
- Fix incorrect links to Javadoc's functions with type parameters (#3502)
- Fix links to Java fields (#4360)
- Fix documentation on extension properties is not propagated to the generated extension getters (#3752)
- Fix generated getter for property in kotlin-as-java doesn't inherit KDoc description (#3369)
- Use language-java class for
Kotlin playground runnable samples extracted into a separate plugin
Starting with Dokka 2.2.0-Beta, Kotlin Playground–based rendering of @sample KDoc references is disabled by default. Samples are now rendered as non-runnable code blocks.
Support for interactive, runnable samples has been extracted into a separate plugin with configurable options, including custom Playground scripts and server URLs. See the plugin README.md for setup instructions.
Other changes and bugfixes
- Fix unnecessary logging for unresolved links in module documentation (#4413)
- Fix CLI runner to force use of the latest stdlib (#4324)
- Use the shadowed stdlib in the Dokka Maven Plugin (#4229)
Feedback
We would appreciate your feedback!
- Please report any feedback or problems https://kotl.in/dokka-issues
- Chat with the community visit #dokka in https://kotlinlang.slack.com/ (To sign up visit https://kotl.in/slack)