Releases: Kotlin/dokka
2.0.0
Dokka 2.0.0 focuses 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 each of the changes below. See Dokka 2.0.0 milestone for the list of all changes.
Dokka's Gradle plugin v2 based on Dokkatoo
Please check the migration guide for the update procedure and give feedback!
Dokka 2.0.0 introduces significant improvements to Dokka Gradle plugin, aligning more closely with Gradle best practices:
- Adopts Gradle types, which leads to better performance.
- Uses an intuitive top-level DSL configuration instead of a low-level task-based setup, which simplifies the build scripts and their readability.
- Takes a more declarative approach to documentation aggregation, which makes multi-project documentation easier to manage.
- Uses a type-safe plugin configuration, which improves the reliability and maintainability of your build scripts.
- Fully supports Gradle configuration cache and build cache, which improves performance and simplifies build work.
Changes from Dokka 2.0.0-Beta
- Forward Dokka Generator messages to Gradle logger (#3833)
- Add deprecated property to help migrate from JSON Dokka plugin configuration (#3877)
- Rename
dokkaPublicationDirectory
tobasePublicationsDirectory
(#3876) - Rename
dokkaModuleDirectory
, and mark as internal (#3880) - Update and add KDoc for DGPv2 (#3842)
- Remove DokkaPluginParametersBuilder (#3872)
- Increase default max heap of Worker to 2G (#3913)
- Remove the dependency of
dokkaGenerate
ondokkaGenerateModule*
(#3920) - KT-71784 Fix classpath for KMP shared source sets (#3942)
- Fix DGP/KMP integration, so Dokka can 'see' code from shared source sets in target source sets (#3814)
Dokka's K2 analysis
Dokka 2.0.0 introduces K2 analysis, which is currently in an experimental stage. Dokka's K2 analysis leverages Kotlin's K2 compiler frontend for analysing code and uses the same shared Analysis API, which is used in IntelliJ IDEA’s K2 mode. The output with K2 analysis should mostly match that of K1 analysis, but there may be minor differences. We are actively working towards stabilizing K2 analysis and are planning to enable K2 analysis by default in future.
To opt in to Dokka's K2 analysis, add the following flag to your project's gradle.properties
file:
org.jetbrains.dokka.experimental.tryK2=true
Known limitations:
- Intersecting source roots (#3701) and intersecting sample roots (#3373) may cause issues.
- Kotlin/JS libraries compiled with the legacy Kotlin/JS compiler are not supported (#3751).
We would greatly value your feedback if you encounter any of these limitations.
Potential differences between the outputs of K1 and K2:
While the output of K2 analysis aims to align with K1, there are some differences to be aware of:
- Java synthetic properties: rendering may vary (details).
- KDoc links: resolution and rendering differences (details).
- Inconsistent documentable rendering order (#3590).
- Enum entries: anonymous and overridden methods are no longer rendered (#3129).
- Other differences may arise due to variations in type inference between K1 and K2.
HTML format
Dokka 2.0.0 introduces some changes to HTML output. We updated the structure of some elements and classes, particularly in the navigation and sidebar, to improve accessibility and simplify maintenance. These changes only affect you if you previously customized Dokka styles.
- We removed redundant wrappers like
navigation--inner
andnavigation-title
. - We reworked blocks such as
versions-dropdown
to make them more accessible. - We renamed classes like
navigation-controls--homepage
to improve consistency. For example, it’s now callednavigation-controls--btn_homepage
.
For more information, see the pull request.
The easiest way to update your current templates is to adjust the new templates to your needs.
Bugfixes
- Fix merging expect-actual declarations (#3875)
Other changes
- Update the external link URL for stdlib (#3938)
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)
Full Changelog: v1.9.20...v2.0.0
2.0.0-Beta
Dokka's Gradle plugin v2 based on Dokkatoo
Please check the migration guide for the update procedure and give feedback!
DGP v2 introduces significant improvements to DGP, aligning more closely with Gradle best practices:
- Adopts Gradle types, which leads to better performance.
- Uses an intuitive top-level DSL configuration instead of a low-level task-based setup, which simplifies the build scripts and their readability.
- Takes a more declarative approach to documentation aggregation, which makes multi-project documentation easier to manage.
- Uses a type-safe plugin configuration, which improves the reliability and maintainability of your build scripts.
- Fully supports Gradle configuration cache and
build cache, which improves performance and simplifies build work.
Note: org.jetbrains.dokka-javadoc
is not yet published to Maven Central and is only available via Gradle Plugin Portal
HTML format
- Fix overflow of long underscore separated names in HTML (#3240). Thanks to @seelchen!
- Accessibility: Wrap links and code blocks (#3415). Thanks to @lauzadis!
- Accessibility: add outline when section-tab is focused (#3416). Thanks to @lauzadis!
- fix: made tabs work when open via iframe (#3323)
- Fixed theme switcher on root page of multimodule project (#3616)
- HTML rendering memory allocations optimisation (#3800)
Bugfixes
- Fix checking for annotations when rendering constructor keyword (#3523)
- Fix KDoc and Javadoc link to a package (#3490)
- Handle exception for recursive type aliases (#3582)
- Do not show the
override
modifier for fake overrides (#3696) - Display Java's
Deprecated
message (#3421)
Other changes
- Fix for broken link, typo, and sample code (#3532). Thanks to @LiYing2010!
- Remove
<a href="TODO">
in enum constant summary (#3548). Thanks to @MattiasBuelens! - Remove log4j coming from intellij dependencies (#3592)
- Replace
Path.toRealPath
in K1 analysis to improve performance a bit (#3608) - Support specifying custom folder name for older versions for versioning plugin (#3693)
- Fix links in nested class summary not resolved correctly (#3674). Thanks to @MattiasBuelens!
- Filter out JVM mapped methods (#3694)
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)
Full Changelog: v1.9.20...v2.0.0-Beta
1.9.20
General bugfixes
- Fixed sealed interfaces not having the
sealed
keyword in signatures (#2994) - Fixed incorrect links in multi-module projects with non-unique package names (#2272). Huge thanks to @EddieRingle!
- Fixed member extensions not being shown on index pages in certain scenarios (#3187)
- Fixed Java's inner classes not having the
inner
keyword in Kotlin signatures (#2793) - Fixed Java's
@param
tag not working with type parameters (#3199) - Fixed Dokka failing in KMP projects when the JVM source set is suppressed (#3209)
HTML format
- Provide an ability to add a custom homepage link to the header, more details in #2948 (comment)
- Fixed tab selection resetting after navigating to a different page (#2899)
- Fixed inline code not always being aligned with the surrounding text (#3228)
- Fixed the "No options found" text in search being barely visible (#3281)
- Fixed empty HTML tags being rendered for no reason (#3343, #3095)
Runners
Gradle Plugin
- Mark tasks as not compatible with Gradle configuration cache, second try (#3438). Thanks to @3flex for noticing and fixing the problem!
Maven Plugin
- Fixed
dokka:help
being absent (#3035). Thanks to @aSemy! - Fixed the source links configuration not working (#3046). Thanks to @freya022 for fixing this one!
CLI runner
- Allow using relative paths in the
sourceRoots
configuration option (#2571)
Plugin API
- Provide an extension point to customize the rendering of code blocks in HTML format (#3244)
Other:
- Make sure
wasm-js
andwasm-wasi
targets introduced in Kotlin 1.9.20 are supported (#3310) - Avoid concurrent invocations of Kotlin compiler's API due to the compiler API itself not always being thread safe (#3151). No noticeable performance loss is expected.
- Bump dependencies to the latest versions (#3231, #3206, #3204)
- Fix a documentation link (#3213). Thanks to @SubhrajyotiSen for noticing and fixing it!
- Various build and project structure improvements (#3174, #3132). Enormous thanks to @aSemy for the help!
See Dokka 1.9.20 milestone for the list of all changes.
1.9.10
General
- Fix re-emerged code analysis concurrency issues which led to flaky builds (#1599, #3143)
- Preserve the order of collection items when deserializing Dokka's configuration (#3006). Thanks to @eunwoop!
HTML format
- Fix an indefinite loop in the script that resizes symbol signature blocks (#3116)
Gradle
- Fix resolution of platform dependencies for Kotlin 1.9 / Gradle 8 (#3153, #3147)
- Mark tasks as not compatible with the Gradle configuration cache (#3070). Thanks to @BoD!
Java
- Fix Java contravariant types being represented as covariant (#3091). Thanks to @juliamcclellan!
1.9.0
General improvements
- Generate dedicated pages for type aliases and enhance their presentation (#2862, #2971)
- Add documentation for Enum.entries introduced in Kotlin 1.9.0 (#2762)
HTML format
This release is packed with enhancements and bugfixes that make your API reference docs mobile-friendly!
You may find it a weird direction for improvement — we were just as surprised to find that almost 1/4 of Standard Library's API reference traffic is coming from mobile devices. Thanks to the Kotlin Website team, who contributed these improvements, Dokka now provides a solid experience to such visitors.
Improvements:
- Significantly improve the mobile layout and overall responsiveness (#2836, #3021, #3082, #3018)
- Use JetBrains Sans as the primary text font (#3017)
- Improve the experience of reading the documentation when JavaScript is disabled in the browser (#3020, #2836)
Bugfixes
- Fix a redundant dot in the path of search elements (#2289)
- Fix unknown asset paths leaking into HTML body (#3061)
- Fix invisible/hidden packages for modules with a space in the name (#3011)
Java interoperability
- Fix multi-param methods being classified as field setters (#2992)
Javadoc format
- Add basic support for
@author
,@since
and@return
tags (#1770). Thanks to @irina-turova!
Other
- Decompose Kotlin/Java analysis (#3034)
- Improve copying base-frontend files between subprojects (#2970). Thanks to @aSemy!
Known problems
Some Multiplatform Gradle 8 projects might experience build failures when resolving native/platform dependencies. Please, see #3153 for more details and workarounds.
Breaking changes
This release introduces some breaking changes that are expected to affect only a fraction of Dokka users.
HTML
Note: this section only applies to those customizing Dokka's HTML format by overriding styles or HTML templates. If you are not doing any customizations, you may skip this section.
To lay a solid foundation to making the HTML format responsive, some page layouts and many styles had to be changed in a backward-incompatible manner.
If you are overriding logo-styles.css
to provide your own header logo, please update it to be in line with the new styles - there is significantly less position hardcoding now. See this example for how it can be done.
If you are overriding styles.css
with your own file, please update the baseline styles to the latest, and see if anything is broken. If you get stuck with adapting your styles to the changes, the diff might help.
If you are overriding base.ftl
or header.ftl
templates, please update them to the latest, and adapt your changes.
CLI runner
Due to the analysis refactoring needed for the migration to K2 (#3099), the JARs required to run Dokka have slightly changed.
The following JARs are no longer supported or published:
Please, replace them with a single JAR:
Plugin API
An internal refactoring of Dokka's analysis API was much needed for the migration to K2, leading to breaking changes in some cases.
If your Dokka plugin compiles without any problems — you may ignore this information, you are likely not affected.
If something doesn't compile or doesn't work anymore, please see #3099 for more details.
1.8.20
Improvements
- Update Kotlin Gradle Plugin to 1.8.10 and Android Gradle Plugin to 4.1.3.
- Move the "Properties" block to be above functions inside the "Members" tab (#2908)
- Make Javadoc tag parsing case-sensitive as per Javadoc specification (#2907)
- Improve performance by reducing allocations and thus decreasing time spent in GC (#2729)
Bugfixes
- Fix unresolved links leading to declarations from another source set #2878
- Fix Dokka not failing the build if there are errors (#2934), regression from 1.8.10. Thanks to @jush!
- Fix
TypeNotPresentException
thrown in projects without KGP (#2890), regression from 1.8.10.
Gradle plugin
- Start using
kotlin-dsl
plugin (#2702, #2833). Thanks to @aSemy! - Use Gradle filesystem types for task properties and apply default values lazily (#2707, #2983). Thanks to @aSemy!
Plugin API
- Change the default logging level of console apps (
DokkaConsoleLogger
) toPROGRESS
(#2871) - Introduce
@InternalDokkaApi
annotation (#2904) - Mark various utility API as Dokka-internal (#2937)
Infrastructure
Big thanks to @aSemy, @Goooler and @3flex for their valuable contributions and for improving the internal
developer experience when working on Dokka!
- Use convention plugins to configure the subprojects (#2704 by @aSemy)
- Use Gradle Version Catalog and type-safe project dependencies (#2884 by @aSemy)
- Migrate
buildSrc
to a composite build (#2912 by @Goooler) - Tidy up build configurations and project files (#2911, #2930, #2909, #2946, #2910, #2705 by @aSemy)
- Execute unit tests in parallel (#2953 by @Goooler)
- Add the ability to use different Java versions for build and test tasks (#2918 by @aSemy)
- Add reproducible archive build config (#2947 by @aSemy)
- Configure Kotlin compiler options lazily (#2883 by @Goooler)
- Improve GitHub Actions workflows (#2939, #2938 by @Goooler)
- Stop testing on Java 15 as it has reached EOL (#2892 by @3flex)
- Remove a workaround for a fixed Gradle issue (#2891 by @3flex)
Documentation
- Add informational badges to the main
README.md
(#2940). Thanks to @Goooler! - Fix typos, inconsistencies and incorrect links in documentation (#2979, #2973, #2952). Thanks to @LiYing2010, @strangesource and @ansman!
- Add more information about the infrastructure to
CONTRIBUTING.md
(#2952)
Security
Other
1.8.10
Dokka's documentation has been entirely rewritten and can now be found on kotlinlang.org:
- More examples, including Groovy DSL for Gradle project configuration
- More guidelines to help beginners
- More details for complex projects
Note: Version 1.8.0 was skipped due to a Metaspace memory leak in Kotlin's reflection (KT-56093). Dokka 1.8.10 should be fully compatible with Kotlin 1.8.0.
Improvements
- Revise project documentation and examples (#2728, #2737, #2736). Thanks to @sarahhaggarty for helping!
- Support generating documentation for Kotlin/Wasm projects (#2814). Thanks to @igoriakovlev!
- Move the contents of
Inheritors
,Parameters
,See also
andSamples
tabs into the main declaration description (#2688). - Add
Members
andMembers & Extensions
tabs to class-like declaration pages (#2764). - Display source set / platform indicators at all times, which should help identify the supported platform of single-platform libraries and modules. (#2847).
- Generate the default no-arg constructor for Java declarations (#2765).
Bugfixes
- Fixed analysis environment not being properly disposed (#2755).
- Fixed nondeterministic sorting of function/property overloads (#2784).
- Fixed inconsistent alphabetical order of element groups in index and navigation (#2861).
- Fixed constructors being rendered as functions (#2689).
- Fixed default values for
var
properties being displayed (#2717). - Fixed source links leading to the KDoc instead of the declaration (#2724).
- Fixed thread-safety issues in
DokkaLogger
(#2827). - Fixed documentation not being inherited in case of diamond inheritance (#2686).
Gradle Plugin
- Fixed
NoSuchMethodError
when running under Gradle 8 (#2796). - Fixed possible metaspace leaks due to external thread locals not being disposed (#2678).
- Fixed premature initialization of
outputDirectory
input property (#556). - Fixed premature initialization of
moduleVersion
input property (#2799). Thanks to @JavierSegoviaCordoba! - Fixed unnecessary snapshotting of source link directory input which led to performance problems (#2807).
- Fixed missing group and description for
MultiModule
tasks (#2806). Thanks to @TWiStErRob!
Javadoc
- Fixed truncation of module and package description after the first sentence (#2055). Thanks to @BlackAnubis7!
- Fixed rendering of empty/useless Kotlin companion objects (#200, #2086)
- Fixed leaking configuration/environment details in generated links (#2803).
- Fixed incorrect links when
javadoc.jar
produced by Dokka is imported into IntelliJ IDEA / Android Studio (#2734). Thanks to @bomberaya!
Plugin API
- Mark Plugin API as experimental (#2716).
Infrastructure
- Enable Gradle build cache, and add caching of Maven dependencies for GitHub Actions (#2711, #2722). Thanks to @aSemy!
- Add concurrency cancellation for build/test GitHub Actions (#2710). Thanks to @aSemy!
Other
- Update
jackson-databind
to avoid CVE-2022-42003 (#2733). Thanks to @ryanlewis! - Update
Jsoup
to avoid CVE-2022-36033 (#2772). - Deprecate methods for adding/removing task dependencies in Dokka's Gradle plugin (#2857).
- Documentation improvements and fixes (#2719, #2718, #2744). Thanks to @SimonMarquis and @ansman!
1.7.20
This release focuses primarily on improving user experience and HTML format in particular.
Improvements
General
- Display inherited extensions (can be disabled by setting
suppressInheritedMembers
configuration property) (#2625) - Display details for
@Deprecated
declarations such as deprecation message, level and proposed replacement (#2622) - Display and document
Enum
's syntheticvalues()
andvalueOf()
functions (#2650) - Do not render constructors for annotation classes (#2642)
- Display values of
Java
constants (#2609) - Trim spaces inside indented code blocks (#2661, #2232, #2233)
- Replace package name on the cover of package pages with "Package-level declarations" (#2586)
HTML format
- Add IntelliJ icons to the navigation side menu (#2578)
- Add auto-scrolling to selected navigation item (#2575)
- Use OS color scheme to initialize light/dark mode, thanks to @pt2121! (#2611)
- Update styling of all section tabs (including platform tabs) to match kotlinlang.org (#2589)
- Format long signatures dynamically based on client width (#2659)
- Add a horizontal divider between function overloads that are displayed on the same page (#2585)
- Add
Cmd + K
/Ctrl + K
hotkey for opening search dialog, thanks to @atyrin! (#2633) - Make current breadcrumb element not clickable and of default font color (#2588)
- Update code highlighting colors (#2670)
- Do not render platform tabs for common-only content (#2613)
- Apply the same style to all KDoc tag headers, making it more consistent (#2587)
- Move source links into signature, especially helpful on pages with many overloads (#2476)
- Add inner/nested declarations to the navigation side menu (#2597)
- Disable copy button for signatures (#2577)
Javadoc format
Kotlin-as-Java plugin
- Render annotation blocks for transformed classes, previously ignored (#2549)
Gradle runner
- Remove
kotlin-stdlib
dependency, which should fix errors likeModule was compiled with an incompatible version of Kotlin
, thanks to @martinbonnin! (#2570)
Bugfixes
- Fixed missing spaces between adjacent
Markdown
elements, where_try_ *this*
would be rendered astrythis
(#2640) - Fixed dependency resolution errors when building documentation for multiplatform projects with enabled compatibility metadata variant (#2634)
- Fixed a rare
StackOverflowError
related to type-aliased native references (#2664) - Fixed
IllegalStateException
that was caused by using JS's dynamic types (#2645) - Fixed a bug where certain
private
declarations were rendered aspublic
(#2639) - Fixed incorrect handling of static declarations used within
@see
tag (#2627) - Fixed
Java
Enum types being rendered asAny
(#2647) - Fixed incorrect signature generation that was caused by generic types caching (#2619)
- Fixed incorrect parsing of static imports in
Java
annotation params (#2593) - Fixed
sourceRoots
configuration param not handling single.java
files, thanks to @2017398956! (#2604) - Fixed unresponsive HTML anchor button (#2644)
- Fixed
dokka-customFormat-example
project to use up-to-date logo styles (#2608)
Developer experience
- Enable
Gradle Enterprise
build scans, thanks to @Goooler! (#2641) - Use
GitHub Actions
artifacts to store generated documentation snapshots, thanks to @StefMa! (#2630)
Other
- Warn users that GFM, Javadoc and Jekyll formats are in early alpha stages by printing a build log message during execution (#2550)
- Revise developer guides documentation that should help plugin authors and new contributors (#2523)
- Bump Gradle to 7.5.1, thanks to @Goooler! (#2618)
- Fix spelling errors, thanks to @FelixDombek! (#2594)
1.7.10
Bugfix release that addresses several blockers and regressions.
General
- Support
Kotlin
1.7.10
Gradle plugin
- Do not expose
Kotlin
stdlib in plugin dependencies, this should fix errors likeModule was compiled with an incompatible version of Kotlin
when usingDokka
. Thanks to @martinbonnin (#2543)
Java sources
- Fixed build failure caused by having configured source links for
Java
code (#2544) - Fixed several exotic problems that led to build failures, all related to using annotation in
Java
sources (#2509, #2551, #2350) - Fixed
IntelliJ
platformWARN: Attempt to load key
messages that appeared when analyzingJava
sources (#2559)
1.7.0
Improvements
General
- Update to
Kotlin
1.7.0,IntelliJ
Platform 213 - Support definitely non-nullable types (#2520)
- Don't expose enum entry constructor arguments, thanks to @ebraminio (#2497)
- Preserve ordering of enum entries as in source code, previously reversed (#2469)
- Improve support for inherited
Java
fields with accessors, now properly interpreted asval
/var
properties (#2481, #2532, #2540) - Skip
@Deprecated
members withHIDDEN
level (#2486) - Make rendered default value dependent on source set for expect/actual declarations (#2449)
HTML format
- Render quotes as blockquotes instead of code blocks, thanks to @TheOnlyTails (#2496)
Javadoc format
- Make
Javadoc
pages generation deterministic (#2479) - Update shipped
jQuery
to avoid multiple CVEs, thanks to @ToppleTheNun (#1938)
GFM format
- Support rendering of code blocks and inline code used in KDocs, thanks to @cosinekitty (#2485)
Kotlin-as-Java plugin
- Include
Java
access modifiers into function signatures, thanks to @tripolkaandrey (#2510)
Gradle runner
- Make
dokka-analysis
dependencycompileOnly
, this should help avoid compatibility problems if different versions ofKotlin
are bundled inGradle
andDokka
(#2521) - Enable stricter validation for cacheable
Gradle
tasks, thanks to @3flex (#2500) - Remove unused & redundant dependencies for
Gradle
runner, thanks to @3flex (#2502) - Remove outdated suppression in
Gradle
runner, thanks to @3flex (#2501)
Fixes
General bugfixes
- Fixed a compiler deadlock issue which led to stalling builds in some KMP projects (#2480)
- Fixed incorrect argument names of functional type parameters (#2478)
- Fixed missing external docs for AndroidX libraries, thanks to @EdricChan03 (#2456)
- Fixed tests failing on Windows, thanks to @3flex (#2507)
Security
- Get rid of bundled
log4j
1.2 that came as a transitive dependency (#2488) - Update Jackson to avoid CVE-2020-36518, thanks to @1mt (#2525)
Plugin API
- Decompose
base.ftl
template: nowheader.ftl
,footer.ftl
andpage_metadata.ftl
can be overridden individually (#2432)
Other
- Add Kotlin stability & support badges, thanks to @etolstoy (#2511)
- Remove an unused runner parameter, thanks to @3flex (#2498)
- Correct typos, thanks to @PaladiRka (#2504) and @mahozad (#2506)!
Thanks to all the contributors!