Migrate to Dokka Gradle plugin v2

Last modified: 21 February 2025

The Dokka Gradle plugin (DGP) is a tool for generating comprehensive API documentation for Kotlin projects built with Gradle.

DGP seamlessly processes both Kotlin's KDoc comments and Java's Javadoc comments to extract information and create structured documentation in HTML or Javadoc format.

Starting with Dokka 2.0.0, you can try the Dokka Gradle plugin v2, the new version of DGP. With Dokka 2.0.0, you can use the Dokka Gradle plugin either in v1 or v2 modes.

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.