From 03c2574138df09ffbce032cd256284a46d6a7dc3 Mon Sep 17 00:00:00 2001
From: alepedroza <39709865+AlejandraPedroza@users.noreply.github.com>
Date: Mon, 17 Nov 2025 13:49:08 -0600
Subject: [PATCH 1/2] Dokka Gradle plugin doc update
This PR updates all the documents relevant to Dokka Gradle plugin v2
# Conflicts:
# docs/topics/dokka-get-started.md
# docs/topics/dokka-plugins.md
# docs/topics/formats/dokka-html.md
# docs/topics/formats/dokka-markdown.md
---
docs/dokka.tree | 3 +-
docs/labels.list | 18 +
docs/topics/dokka-get-started.md | 50 +-
.../topics/dokka-gradle-troubleshooting-md.md | 71 ++
docs/topics/dokka-migration.md | 74 +-
docs/topics/dokka-plugins.md | 97 +-
docs/topics/formats/dokka-html.md | 91 +-
docs/topics/formats/dokka-javadoc.md | 28 +-
docs/topics/formats/dokka-markdown.md | 121 +-
docs/topics/runners/dokka-gradle.md | 1100 +++++++++--------
10 files changed, 851 insertions(+), 802 deletions(-)
create mode 100644 docs/labels.list
create mode 100644 docs/topics/dokka-gradle-troubleshooting-md.md
diff --git a/docs/dokka.tree b/docs/dokka.tree
index 49a8b4bbce..76ec6f967f 100644
--- a/docs/dokka.tree
+++ b/docs/dokka.tree
@@ -1,11 +1,12 @@
-
+
+
diff --git a/docs/labels.list b/docs/labels.list
new file mode 100644
index 0000000000..b8cd77c802
--- /dev/null
+++ b/docs/labels.list
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ The feature is Experimental. It may be dropped or changed at any time. Use it only for evaluation purposes.
+ The feature is Experimental. It may be dropped or changed at any time. Opt-in is required (see the details below), and you should use it only for evaluation purposes.
+ The feature is in Alpha. It may change incompatibly and require manual migration in the future.
+ The feature is in Beta. It is almost stable, but migration steps may be required in the future. We'll do our best to minimize any changes you have to make.
+
+ This functionality is available only in the latest EAP version.
+
+ This functionality is available only in the latest EAP version.
+
\ No newline at end of file
diff --git a/docs/topics/dokka-get-started.md b/docs/topics/dokka-get-started.md
index e08eb2ba10..a5d3d45b17 100644
--- a/docs/topics/dokka-get-started.md
+++ b/docs/topics/dokka-get-started.md
@@ -5,18 +5,9 @@ Below you can find simple instructions to help you get started with Dokka.
-> These instructions reflect Dokka Gradle plugin v1 configuration and tasks. Starting from Dokka 2.0.0, several configuration options, Gradle tasks, and steps to generate your documentation have been updated, including:
->
-> * [Adjust configuration options](dokka-migration.md#adjust-configuration-options)
-> * [Work with multi-module projects](dokka-migration.md#share-dokka-configuration-across-modules)
-> * [Generate documentation with the updated tasks](dokka-migration.md#generate-documentation-with-the-updated-task)
-> * [Specify an output directory](dokka-migration.md#output-directory)
->
-> For more details and the full list of changes in Dokka Gradle Plugin v2, see the [Migration guide](dokka-migration.md).
->
-{style="note"}
+**Apply the Gradle Dokka plugin**
-Apply the Gradle plugin for Dokka in the root build script of your project:
+Apply the Dokka Gradle plugin (DGP) in the root build script of your project:
```kotlin
plugins {
@@ -24,21 +15,34 @@ plugins {
}
```
-When documenting [multi-project](https://docs.gradle.org/current/userguide/multi_project_builds.html) builds, you need
-to apply the Gradle plugin within subprojects as well:
+**Document multi-module projects**
-```kotlin
-subprojects {
- apply(plugin = "org.jetbrains.dokka")
-}
+When documenting [multi-module projects (multi-project builds)](https://docs.gradle.org/current/userguide/multi_project_builds.html),
+you don't need to apply the plugin to every module or subproject you want to document. Instead, share Dokka configuration across modules
+by using one of the following approaches:
+
+* Convention plugin
+* Direct configuration in each module if you’re not using convention plugins
+
+For more information about sharing Dokka configuration in multi-module projects,
+see [Multi-project configuration](dokka-gradle.md#multi-project-configuration).
+
+**Generate documentation**
+
+To generate documentation, run the following Gradle task:
+
+```Bash
+./gradlew :dokkaGenerate
```
-To generate documentation, run the following Gradle tasks:
+This task works for both single and multi-module projects.
+You can use different tasks to generate output in [HTML](dokka-html.md),
+[Javadoc](dokka-javadoc.md) or both [HTML and Javadoc](dokka-gradle.md#configure-documentation-output-format).
-* `dokkaHtml` for single-project builds
-* `dokkaHtmlMultiModule` for multi-project builds
+**Set output directory**
-By default, the output directory is set to `/build/dokka/html` and `/build/dokka/htmlMultiModule`.
+By default, the output directory is set to `/build/dokka/html` for both multi-module and single-module projects,
+but you can [configure it](dokka-gradle.md#general-configuration).
To learn more about using Dokka with Gradle, see [Gradle](dokka-gradle.md).
@@ -69,7 +73,9 @@ To generate documentation, run the following Gradle tasks:
By default, the output directory is set to `/build/dokka/html` and `/build/dokka/htmlMultiModule`.
-To learn more about using Dokka with Gradle, see [Gradle](dokka-gradle.md).
+> To learn more about using Dokka with Gradle, see [Gradle](dokka-gradle.md).
+>
+{style="tip"}
diff --git a/docs/topics/dokka-gradle-troubleshooting-md.md b/docs/topics/dokka-gradle-troubleshooting-md.md
new file mode 100644
index 0000000000..64a9c489e9
--- /dev/null
+++ b/docs/topics/dokka-gradle-troubleshooting-md.md
@@ -0,0 +1,71 @@
+[//]: # (title: Dokka Gradle troubleshooting)
+
+In large projects, Dokka can consume a significant amount of memory to generate documentation.
+This can exceed Gradle’s memory limits, especially when processing large volumes of data.
+
+When Dokka generation runs out of memory, the build fails,
+and Gradle can throw exceptions like `java.lang.OutOfMemoryError: Metaspace`.
+
+Active efforts are underway to improve Dokka's performance, although some limitations stem from Gradle.
+
+If you encounter memory issues, try these workarounds:
+
+* [Increasing heap space](#increase-heap-space)
+* [Running Dokka within the Gradle process](#run-dokka-within-the-gradle-process)
+
+### Increase heap space
+
+One way to resolve memory issues is to increase the amount of Java heap memory for the Dokka generator process.
+In the `build.gradle.kts` file, adjust the
+following configuration option:
+
+```kotlin
+ dokka {
+ // Dokka generates a new process managed by Gradle
+ dokkaGeneratorIsolation = ProcessIsolation {
+ // Configures heap size
+ maxHeapSize = "4g"
+ }
+ }
+```
+
+In this example, the maximum heap size is set to 4 GB (`"4g"`).
+Adjust and test the value to find the optimal setting for your build.
+
+If you find that Dokka requires a considerably expanded heap size,
+for example, significantly higher than Gradle's own memory usage,
+[create an issue on Dokka's GitHub repository](https://kotl.in/dokka-issues).
+
+> You have to apply this configuration to each subproject.
+> It is recommended that you configure Dokka in a convention
+> plugin applied to all subprojects.
+>
+{style="note"}
+
+### Run Dokka within the Gradle process
+
+When both the Gradle build and Dokka generation require a lot of memory, they may run as separate processes,
+consuming significant memory on a single machine.
+
+To optimize memory usage, you can run Dokka within the same Gradle process instead of as a separate process.
+This allows you to configure the memory for Gradle once instead of allocating it separately for each process.
+
+To run Dokka within the same Gradle process, adjust the following configuration option in the `build.gradle.kts` file:
+
+```kotlin
+ dokka {
+ // Runs Dokka in the current Gradle process
+ dokkaGeneratorIsolation = ClassLoaderIsolation()
+ }
+```
+
+As with [increasing heap space](#increase-heap-space), test this configuration to confirm it works well for your project.
+
+For more details on configuring Gradle's JVM memory,
+see the [Gradle documentation](https://docs.gradle.org/current/userguide/config_gradle.html#sec:configuring_jvm_memory).
+
+> Changing the Java options for Gradle launches a new Gradle daemon, which may stay alive for a long time. You can [manually stop any other Gradle processes](https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:stopping_an_existing_daemon).
+>
+> Additionally, Gradle issues with the `ClassLoaderIsolation()` configuration may [cause memory leaks](https://github.com/gradle/gradle/issues/18313).
+>
+{style="note"}
\ No newline at end of file
diff --git a/docs/topics/dokka-migration.md b/docs/topics/dokka-migration.md
index dd0f145cf0..4bb3b3e9ce 100644
--- a/docs/topics/dokka-migration.md
+++ b/docs/topics/dokka-migration.md
@@ -5,10 +5,7 @@ The Dokka Gradle plugin (DGP) is a tool for generating comprehensive API documen
DGP seamlessly processes both Kotlin's KDoc comments and Java's Javadoc comments to extract information and create
structured documentation in [HTML or Javadoc](#select-documentation-output-format) 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:
+The Dokka Gradle plugin v2 mode is enabled by default and aligns 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.
@@ -17,6 +14,8 @@ DGP v2 introduces significant improvements to DGP, aligning more closely with Gr
* Fully supports Gradle [configuration cache](https://docs.gradle.org/current/userguide/configuration_cache.html) and
[build cache](https://docs.gradle.org/current/userguide/build_cache.html), which improves performance and simplifies build work.
+Read this guide for further information between changes and migration from DGP v1 to v2 modes.
+
## Before you start
Before starting the migration, complete the following steps.
@@ -786,73 +785,6 @@ DGP v2 now supports Gradle build cache and configuration cache, improving build
* To enable build cache, follow instructions in the [Gradle build cache documentation](https://docs.gradle.org/current/userguide/build_cache.html#sec:build_cache_enable).
* To enable configuration cache, follow instructions in the [Gradle configuration cache documentation](https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:usage:enable ).
-## Troubleshooting
-
-In large projects, Dokka can consume a significant amount of memory to generate documentation.
-This can exceed Gradle’s memory limits, especially when processing large volumes of data.
-
-When Dokka generation runs out of memory, the build fails, and Gradle can throw exceptions like `java.lang.OutOfMemoryError: Metaspace`.
-
-Active efforts are underway to improve Dokka's performance, although some limitations stem from Gradle.
-
-If you encounter memory issues, try these workarounds:
-
-* [Increasing heap space](#increase-heap-space)
-* [Running Dokka within the Gradle process](#run-dokka-within-the-gradle-process)
-
-### Increase heap space
-
-One way to resolve memory issues is to increase the amount of Java heap memory for the Dokka generator process.
-In the `build.gradle.kts` file, adjust the
-following configuration option:
-
-```kotlin
- dokka {
- // Dokka generates a new process managed by Gradle
- dokkaGeneratorIsolation = ProcessIsolation {
- // Configures heap size
- maxHeapSize = "4g"
- }
- }
-```
-
-In this example, the maximum heap size is set to 4 GB (`"4g"`). Adjust and test the value to find the optimal setting for your build.
-
-If you find that Dokka requires a considerably expanded heap size, for example, significantly higher than Gradle's own memory usage,
-[create an issue on Dokka's GitHub repository](https://kotl.in/dokka-issues).
-
-> You have to apply this configuration to each subproject. It is recommended that you configure Dokka in a convention
-> plugin applied to all subprojects.
->
-{style="note"}
-
-### Run Dokka within the Gradle process
-
-When both the Gradle build and Dokka generation require a lot of memory, they may run as separate processes,
-consuming significant memory on a single machine.
-
-To optimize memory usage, you can run Dokka within the same Gradle process instead of as a separate process. This
-allows you to configure the memory for Gradle once instead of allocating it separately for each process.
-
-To run Dokka within the same Gradle process, adjust the following configuration option in the `build.gradle.kts` file:
-
-```kotlin
- dokka {
- // Runs Dokka in the current Gradle process
- dokkaGeneratorIsolation = ClassLoaderIsolation()
- }
-```
-
-As with [increasing heap space](#increase-heap-space), test this configuration to confirm it works well for your project.
-
-For more details on configuring Gradle's JVM memory, see the [Gradle documentation](https://docs.gradle.org/current/userguide/config_gradle.html#sec:configuring_jvm_memory).
-
-> Changing the Java options for Gradle launches a new Gradle daemon, which may stay alive for a long time. You can [manually stop any other Gradle processes](https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:stopping_an_existing_daemon).
->
-> Additionally, Gradle issues with the `ClassLoaderIsolation()` configuration may [cause memory leaks](https://github.com/gradle/gradle/issues/18313).
->
-{style="note"}
-
## What's next
* [Explore more DGP v2 project examples](https://github.com/Kotlin/dokka/tree/master/examples/gradle-v2).
diff --git a/docs/topics/dokka-plugins.md b/docs/topics/dokka-plugins.md
index 8fe048d7c5..a0ebf6c9c0 100644
--- a/docs/topics/dokka-plugins.md
+++ b/docs/topics/dokka-plugins.md
@@ -13,11 +13,11 @@ If you want to learn how to create Dokka plugins, see
## Apply Dokka plugins
-Dokka plugins are published as separate artifacts, so to apply a Dokka plugin you only need to add it as a dependency.
-From there, the plugin extends Dokka by itself - no further action is needed.
+Dokka plugins are published as separate artifacts, so to apply a Dokka plugin, you only need to add it as a dependency.
+From there, the plugin extends Dokka by itself—no further action is needed.
> Plugins that use the same extension points or work in a similar way can interfere with each other.
-> This may lead to visual bugs, general undefined behaviour or even failed builds. However, it should not lead to
+> This may lead to visual bugs, general undefined behavior or even failed builds. However, it should not lead to
> concurrency issues since Dokka does not expose any mutable data structures or objects.
>
> If you notice problems like this, it's a good idea to check which plugins are applied and what they do.
@@ -30,34 +30,25 @@ to your project:
-> These instructions reflect Dokka Gradle plugin v1 configuration and tasks. Starting from Dokka 2.0.0, several configuration options, Gradle tasks, and steps to generate your documentation have been updated, including:
->
-> * [Configure Dokka plugins](dokka-migration.md#configure-dokka-plugins)
-> * [Work with multi-module projects](dokka-migration.md#share-dokka-configuration-across-modules)
->
-> For more details and the full list of changes in Dokka Gradle Plugin v2, see the [Migration guide](dokka-migration.md).
->
-> {style="note"}
-
-The Gradle plugin for Dokka creates convenient dependency configurations that allow you to apply plugins universally or
-for a specific output format only.
+The way to apply Dokka plugins is unified under the `dokka {}` DSL:
```kotlin
-dependencies {
- // Is applied universally
- dokkaPlugin("org.jetbrains.dokka:mathjax-plugin:%dokkaVersion%")
+plugins {
+ id("org.jetbrains.dokka") version "2.0.0"
+}
- // Is applied for the single-module dokkaHtml task only
- dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:%dokkaVersion%")
+dokka {
+ dependencies {
+ dokkaPlugin("org.jetbrains.dokka:mathjax-plugin:2.0.0")
+ }
- // Is applied for HTML format in multi-project builds
- dokkaHtmlPartialPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:%dokkaVersion%")
}
```
-> When documenting [multi-project](dokka-gradle.md#multi-project-builds) builds, you need to apply Dokka plugins within
-> subprojects as well as in their parent project.
+> * Built-in plugins (like HTML and Javadoc) are always applied automatically. You only configure them and do not need dependencies for them.
>
+> * When documenting multi-module projects (multi-project builds), you need to [share Dokka configuration and plugins across modules](dokka-gradle.md#multi-project-configuration).
+>
{style="note"}
@@ -79,7 +70,8 @@ dependencies {
}
```
-> When documenting [multi-project](dokka-gradle.md#multi-project-builds) builds, you need to apply Dokka plugins within
+> When documenting [multi-project](dokka-gradle.md#multi-project-configuration) builds,
+> you need to apply Dokka plugins within
> subprojects as well as in their parent project.
>
{style="note"}
@@ -139,57 +131,32 @@ If you are using [JSON configuration](dokka-cli.md#run-with-json-configuration),
Dokka plugins can also have configuration options of their own. To see which options are available, consult
the documentation of the plugins you are using.
-Let's have a look at how you can configure the `DokkaBase` plugin, which is responsible for generating [HTML](dokka-html.md)
-documentation, by adding a custom image to the assets (`customAssets` option), by adding custom style sheets
-(`customStyleSheets` option), and by modifying the footer message (`footerMessage` option):
+Let's have a look at how you can configure the built-in HTML plugin by adding a custom image to the assets
+(`customAssets` option),
+custom style sheets (`customStyleSheets` option), and a modified footer message (`footerMessage` option):
-Gradle's Kotlin DSL allows for type-safe plugin configuration. This is achievable by adding the plugin's artifact to
-the classpath dependencies in the `buildscript` block, and then importing plugin and configuration classes:
+To configure Dokka plugins in a type-safe way, use the `pluginsConfiguration{}` block:
```kotlin
-import org.jetbrains.dokka.base.DokkaBase
-import org.jetbrains.dokka.gradle.DokkaTask
-import org.jetbrains.dokka.base.DokkaBaseConfiguration
-
-buildscript {
- dependencies {
- classpath("org.jetbrains.dokka:dokka-base:%dokkaVersion%")
- }
-}
-
-tasks.withType().configureEach {
- pluginConfiguration {
- customAssets = listOf(file("my-image.png"))
- customStyleSheets = listOf(file("my-styles.css"))
- footerMessage = "(c) 2022 MyOrg"
+dokka {
+ pluginsConfiguration.html {
+ customAssets.from("logo.png")
+ customStyleSheets.from("styles.css")
+ footerMessage.set("(c) Your Company")
}
}
```
-Alternatively, plugins can be configured via JSON. With this method, no additional dependencies are needed.
+For an example of Dokka plugins configuration, see the
+[Dokka's versioning plugin](https://github.com/Kotlin/dokka/tree/master/examples/gradle-v2/versioning-multimodule-example).
-```kotlin
-import org.jetbrains.dokka.gradle.DokkaTask
-
-tasks.withType().configureEach {
- val dokkaBaseConfiguration = """
- {
- "customAssets": ["${file("assets/my-image.png")}"],
- "customStyleSheets": ["${file("assets/my-styles.css")}"],
- "footerMessage": "(c) 2022 MyOrg"
- }
- """
- pluginsMapConfiguration.set(
- mapOf(
- // fully qualified plugin name to json configuration
- "org.jetbrains.dokka.base.DokkaBase" to dokkaBaseConfiguration
- )
- )
-}
-```
+Dokka allows you
+to extend its functionality
+by [configuring custom plugins](https://github.com/Kotlin/dokka/blob/ae3840edb4e4afd7b3e3768a5fddfe8ec0e08f31/examples/gradle-v2/custom-dokka-plugin-example/demo-library/build.gradle.kts).
+Custom plugins enable additional processing or modifications to the documentation generation process.
@@ -281,7 +248,7 @@ Here are some notable Dokka plugins that you might find useful:
| [Versioning plugin](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/dokka-subprojects/plugin-versioning) | Adds version selector and helps to organize documentation for different versions of your application/library |
| [MermaidJS HTML plugin](https://github.com/glureau/dokka-mermaid) | Renders [MermaidJS](https://mermaid-js.github.io/mermaid/#/) diagrams and visualizations found in KDocs |
| [Mathjax HTML plugin](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/dokka-subprojects/plugin-mathjax) | Pretty prints mathematics found in KDocs |
-| [Kotlin as Java plugin](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/dokka-subprojects/plugin-kotlin-as-java) | Renders Kotlin signatures as seen from Java's perspective |
+| [Kotlin as Java plugin](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/dokka-subprojects/plugin-kotlin-as-java) | Renders Kotlin signatures as seen from Java's perspective |
If you are a Dokka plugin author and would like to add your plugin to this list, get in touch with maintainers
via [Slack](dokka-introduction.md#community) or [GitHub](https://github.com/Kotlin/dokka/).
diff --git a/docs/topics/formats/dokka-html.md b/docs/topics/formats/dokka-html.md
index f8e9b11b43..0c23735328 100644
--- a/docs/topics/formats/dokka-html.md
+++ b/docs/topics/formats/dokka-html.md
@@ -1,7 +1,6 @@
[//]: # (title: HTML)
-HTML is Dokka's default and recommended output format. It is currently in Beta and approaching the Stable release.
-
+HTML is Dokka's default and recommended output format.
You can see an example of the output by browsing documentation
for [kotlinx.coroutines](https://kotlinlang.org/api/kotlinx.coroutines/).
@@ -10,14 +9,9 @@ for [kotlinx.coroutines](https://kotlinlang.org/api/kotlinx.coroutines/).
HTML as an output format is supported by all runners. To generate HTML documentation, follow these steps depending on
your build tool or runner:
-* For [Gradle](dokka-gradle.md#generate-documentation), run `dokkaHtml` or `dokkaHtmlMultiModule` tasks.
-
- > These instructions reflect Dokka Gradle plugin v1 configuration and tasks. Starting from Dokka 2.0.0, [the Gradle tasks to generate documentation changed](dokka-migration.md#generate-documentation-with-the-updated-task).
- >
- > For more details and the full list of changes in Dokka Gradle Plugin v2, see the [Migration guide](dokka-migration.md).
- >
- {style="note"}
-
+* For [Gradle](dokka-gradle.md#generate-documentation), run the following tasks:
+ * `dokkaGeneratePublicationHtml` to generate documentation only in HTML format.
+ * `dokkaGenerate` to generate documentation in [all available formats based on the applied plugins](dokka-gradle.md#configure-documentation-output-format).
* For [Maven](dokka-maven.md#generate-documentation), run the `dokka:dokka` goal.
* For [CLI runner](dokka-cli.md#generate-documentation), run with HTML dependencies set.
@@ -32,62 +26,26 @@ your build tool or runner:
## Configuration
-HTML format is Dokka's base format, so it is configurable through `DokkaBase` and `DokkaBaseConfiguration`
-classes:
+HTML format is Dokka's base format, and you can include configuration options:
-Via type-safe Kotlin DSL:
-
```kotlin
-import org.jetbrains.dokka.base.DokkaBase
-import org.jetbrains.dokka.gradle.DokkaTask
-import org.jetbrains.dokka.base.DokkaBaseConfiguration
-
-buildscript {
- dependencies {
- classpath("org.jetbrains.dokka:dokka-base:%dokkaVersion%")
- }
-}
-
-tasks.withType().configureEach {
- pluginConfiguration {
- customAssets = listOf(file("my-image.png"))
- customStyleSheets = listOf(file("my-styles.css"))
- footerMessage = "(c) 2022 MyOrg"
- separateInheritedMembers = false
- templatesDir = file("dokka/templates")
- mergeImplicitExpectActualDeclarations = false
+// build.gradle.kts
+
+dokka {
+ pluginsConfiguration.html {
+ customAssets.from("logo.png")
+ customStyleSheets.from("styles.css")
+ footerMessage.set("(c) Your Company")
+ separateInheritedMembers.set(false)
+ templatesDir.set(file("dokka/templates"))
+ mergeImplicitExpectActualDeclarations.set(false)
}
}
```
-Via JSON:
-
-```kotlin
-import org.jetbrains.dokka.gradle.DokkaTask
-
-tasks.withType().configureEach {
- val dokkaBaseConfiguration = """
- {
- "customAssets": ["${file("assets/my-image.png")}"],
- "customStyleSheets": ["${file("assets/my-styles.css")}"],
- "footerMessage": "(c) 2022 MyOrg",
- "separateInheritedMembers": false,
- "templatesDir": "${file("dokka/templates")}",
- "mergeImplicitExpectActualDeclarations": false
- }
- """
- pluginsMapConfiguration.set(
- mapOf(
- // fully qualified plugin name to json configuration
- "org.jetbrains.dokka.base.DokkaBase" to dokkaBaseConfiguration
- )
- )
-}
-```
-
@@ -173,7 +131,7 @@ Via [JSON configuration](dokka-cli.md#run-with-json-configuration):
### Configuration options
-The table below contains all of the possible configuration options and their purpose.
+The table below contains all the possible configuration options and their purpose:
| **Option** | **Description** |
|-----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -213,8 +171,16 @@ You can provide your own images to be bundled with documentation by using the `c
These files are copied to the `
This setting works well with failOnWarning.
- This can be configured on source set level.
+ This can be configured on the source set level.
Default: false
- The set of visibility modifiers that should be documented.
+ Defines which visibility modifiers Dokka should include in the generated documentation.
+
+ Use them if you want to document Protected/Internal/Private
+ declarations within this package,
+ as well as if you want to exclude Public declarations and only document internal API.
+
- This can be used if you want to document protected/internal/private declarations within this package,
- as well as if you want to exclude public declarations and only document internal API.
+ Additionally, you can use Dokka's
+ documentedVisibilities() function
+ to add documented visibilities.
- This can be configured on source set level.
- Default: DokkaConfiguration.Visibility.PUBLIC
+ This can be configured on the source set level.
+ Default: VisibilityModifier.Public
### External documentation links configuration
-The `externalDocumentationLink` block allows the creation of links that lead to the externally hosted documentation of
+The `externalDocumentationLinks {}`
+block allows the creation of links that lead to the externally hosted documentation of
your dependencies.
For example, if you are using types from `kotlinx.serialization`, by default they are unclickable in your
@@ -1303,33 +1323,20 @@ is built by Dokka and is [published on kotlinlang.org](https://kotlinlang.org/ap
configure external documentation links for it. Thus allowing Dokka to generate links for types from the library, making
them resolve successfully and clickable.
-By default, external documentation links for Kotlin standard library, JDK, Android SDK and AndroidX are configured.
+By default, external documentation links for Kotlin standard library, JDK, Android SDK, and AndroidX are configured.
+
+Register external documentation links using the `register()` method to define each link.
+The `externalDocumentationLinks` API uses this method aligning with Gradle DSL conventions:
```kotlin
-import org.jetbrains.dokka.gradle.DokkaTask
-import java.net.URL
-
-// Note: To configure multi-project builds, you need
-// to configure Partial tasks of the subprojects.
-// See "Configuration example" section of documentation.
-tasks.withType().configureEach {
- // ..
- // general configuration section
- // ..
-
+dokka {
dokkaSourceSets.configureEach {
- // ..
- // source set configuration section
- // ..
-
- externalDocumentationLink {
- url.set(URL("https://kotlinlang.org/api/kotlinx.serialization/"))
- packageListUrl.set(
- rootProject.projectDir.resolve("serialization.package.list").toURL()
- )
+ externalDocumentationLinks.register("example-docs") {
+ url("https://example.com/docs/")
+ packageListUrl("https://example.com/docs/package-list")
}
}
}
@@ -1395,82 +1402,82 @@ tasks.withType(DokkaTask.class) {
### Complete configuration
-Below you can see all possible configuration options applied at the same time.
+Below you can see all possible configuration options applied at the same time:
```kotlin
-import org.jetbrains.dokka.DokkaConfiguration.Visibility
-import org.jetbrains.dokka.gradle.DokkaTask
-import org.jetbrains.dokka.Platform
-import java.net.URL
+import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
-// Note: To configure multi-project builds, you need
-// to configure Partial tasks of the subprojects.
-// See "Configuration example" section of documentation.
-tasks.withType().configureEach {
- moduleName.set(project.name)
- moduleVersion.set(project.version.toString())
- outputDirectory.set(layout.buildDirectory.dir("dokka/$name"))
- failOnWarning.set(false)
- suppressObviousFunctions.set(true)
- suppressInheritedMembers.set(false)
- offlineMode.set(false)
+plugins {
+ id("org.jetbrains.dokka") version "2.0.0"
+}
- dokkaSourceSets {
- named("linux") {
- dependsOn("native")
- sourceRoots.from(file("linux/src"))
+dokka {
+ dokkaPublications.html {
+ moduleName.set(project.name)
+ moduleVersion.set(project.version.toString())
+ outputDirectory.set(layout.buildDirectory.dir("dokka/html"))
+ failOnWarning.set(false)
+ suppressInheritedMembers.set(false)
+ offlineMode.set(false)
+ suppressObviousFunctions.set(true)
+ includes.from(project.files(), "packages.md", "extra.md")
+ }
+}
+
+dokkaSourceSets {
+ // Example: Configuration exclusive to the 'linux' source set
+ named("linux") {
+ dependsOn("native")
+ sourceRoots.from(file("linux/src"))
+ }
+
+ configureEach {
+ suppress.set(false)
+ displayName.set(name)
+ documentedVisibilities.set(setOf(VisibilityModifier.Public)) // OR documentedVisibilities(VisibilityModifier.Public)
+ reportUndocumented.set(false)
+ skipEmptyPackages.set(true)
+ skipDeprecated.set(false)
+ suppressGeneratedFiles.set(true)
+ jdkVersion.set(8)
+ languageVersion.set("1.7")
+ apiVersion.set("1.7")
+ noStdlibLink.set(false)
+ noJdkLink.set(false)
+ noAndroidSdkLink.set(false)
+ platform.set(Platform.DEFAULT)
+ sourceRoots.from(file("src"))
+ classpath.from(project.files(), file("libs/dependency.jar"))
+ samples.from(project.files(), "samples/Basic.kt", "samples/Advanced.kt")
+
+ sourceLink {
+ localDirectory.set(file("src/main/kotlin"))
+ remoteUrl("https://example.com/src")
+ remoteLineSuffix.set("#L")
}
- configureEach {
- suppress.set(false)
- displayName.set(name)
- documentedVisibilities.set(setOf(Visibility.PUBLIC))
- reportUndocumented.set(false)
- skipEmptyPackages.set(true)
- skipDeprecated.set(false)
- suppressGeneratedFiles.set(true)
- jdkVersion.set(8)
- languageVersion.set("1.7")
- apiVersion.set("1.7")
- noStdlibLink.set(false)
- noJdkLink.set(false)
- noAndroidSdkLink.set(false)
- includes.from(project.files(), "packages.md", "extra.md")
- platform.set(Platform.DEFAULT)
- sourceRoots.from(file("src"))
- classpath.from(project.files(), file("libs/dependency.jar"))
- samples.from(project.files(), "samples/Basic.kt", "samples/Advanced.kt")
-
- sourceLink {
- localDirectory.set(projectDir.resolve("src"))
- remoteUrl.set(URL("https://github.com/kotlin/dokka/tree/master/src"))
- remoteLineSuffix.set("#L")
- }
- externalDocumentationLink {
- url.set(URL("https://kotlinlang.org/api/core/kotlin-stdlib/"))
- packageListUrl.set(
- rootProject.projectDir.resolve("stdlib.package.list").toURL()
- )
- }
+ externalDocumentationLink {
+ url = URL("https://example.com/docs/")
+ packageListUrl = File("/path/to/package-list").toURI().toURL()
+ }
- perPackageOption {
- matchingRegex.set(".*api.*")
- suppress.set(false)
- skipDeprecated.set(false)
- reportUndocumented.set(false)
- documentedVisibilities.set(
- setOf(
- Visibility.PUBLIC,
- Visibility.PRIVATE,
- Visibility.PROTECTED,
- Visibility.INTERNAL,
- Visibility.PACKAGE
- )
+ perPackageOption {
+ matchingRegex.set(".*api.*")
+ suppress.set(false)
+ skipDeprecated.set(false)
+ reportUndocumented.set(false)
+ documentedVisibilities.set(
+ setOf(
+ VisibilityModifier.Public,
+ VisibilityModifier.Private,
+ VisibilityModifier.Protected,
+ VisibilityModifier.Internal,
+ VisibilityModifier.Package
)
- }
+ )
}
}
}
@@ -1549,3 +1556,10 @@ tasks.withType(DokkaTask.class) {
+
+## Enable build cache and configuration cache
+
+DGP supports Gradle build cache and configuration cache, improving build performance.
+
+* To enable build cache, follow instructions in the [Gradle build cache documentation](https://docs.gradle.org/current/userguide/build_cache.html#sec:build_cache_enable).
+* To enable configuration cache, follow instructions in the [Gradle configuration cache documentation](https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:usage:enable ).
From dbfcbe15af6325d0ab37de529ef120cb03e34841 Mon Sep 17 00:00:00 2001
From: alepedroza <39709865+AlejandraPedroza@users.noreply.github.com>
Date: Wed, 19 Nov 2025 16:48:24 -0600
Subject: [PATCH 2/2] Developer's reviews
---
docs/topics/dokka-get-started.md | 19 +-
docs/topics/dokka-migration.md | 34 +--
docs/topics/dokka-module-and-package-docs.md | 16 +-
docs/topics/dokka-plugins.md | 22 +-
docs/topics/formats/dokka-html.md | 29 +-
docs/topics/formats/dokka-javadoc.md | 17 +-
docs/topics/formats/dokka-markdown.md | 8 +-
docs/topics/runners/dokka-gradle.md | 276 ++++++++-----------
8 files changed, 205 insertions(+), 216 deletions(-)
diff --git a/docs/topics/dokka-get-started.md b/docs/topics/dokka-get-started.md
index a5d3d45b17..6edc9c29f4 100644
--- a/docs/topics/dokka-get-started.md
+++ b/docs/topics/dokka-get-started.md
@@ -5,6 +5,11 @@ Below you can find simple instructions to help you get started with Dokka.
+> This guide applies to Dokka Gradle Plugin (DGP) v2 mode. The previous DGP v1 mode is no longer supported.
+> If you're upgrading from v1 to v2 mode, see the [Migration guide](dokka-migration.md).
+>
+{style="note"}
+
**Apply the Gradle Dokka plugin**
Apply the Dokka Gradle plugin (DGP) in the root build script of your project:
@@ -15,16 +20,16 @@ plugins {
}
```
-**Document multi-module projects**
+**Document multi-project builds**
-When documenting [multi-module projects (multi-project builds)](https://docs.gradle.org/current/userguide/multi_project_builds.html),
-you don't need to apply the plugin to every module or subproject you want to document. Instead, share Dokka configuration across modules
+When documenting [multi-project builds](https://docs.gradle.org/current/userguide/multi_project_builds.html),
+you need to apply the plugin to every subproject you want to document. Share Dokka configuration across subprojects
by using one of the following approaches:
* Convention plugin
-* Direct configuration in each module if you’re not using convention plugins
+* Direct configuration in each subproject if you’re not using convention plugins
-For more information about sharing Dokka configuration in multi-module projects,
+For more information about sharing Dokka configuration in multi-project builds,
see [Multi-project configuration](dokka-gradle.md#multi-project-configuration).
**Generate documentation**
@@ -35,13 +40,13 @@ To generate documentation, run the following Gradle task:
./gradlew :dokkaGenerate
```
-This task works for both single and multi-module projects.
+This task works for both single and multi-project builds.
You can use different tasks to generate output in [HTML](dokka-html.md),
[Javadoc](dokka-javadoc.md) or both [HTML and Javadoc](dokka-gradle.md#configure-documentation-output-format).
**Set output directory**
-By default, the output directory is set to `/build/dokka/html` for both multi-module and single-module projects,
+By default, the output directory is set to `/build/dokka/html` for both multi-project and single-project builds,
but you can [configure it](dokka-gradle.md#general-configuration).
To learn more about using Dokka with Gradle, see [Gradle](dokka-gradle.md).
diff --git a/docs/topics/dokka-migration.md b/docs/topics/dokka-migration.md
index 4bb3b3e9ce..1d23fdb3f1 100644
--- a/docs/topics/dokka-migration.md
+++ b/docs/topics/dokka-migration.md
@@ -43,7 +43,7 @@ Update the Dokka version to 2.0.0 in the `plugins {}` block of your project’s
```kotlin
plugins {
kotlin("jvm") version "2.1.10"
- id("org.jetbrains.dokka") version "2.0.0"
+ id("org.jetbrains.dokka") version "%dokkaVersion%"
}
```
@@ -525,15 +525,15 @@ For an example of the DGP v2 configuration, see the
DGP v2 allows you to extend its functionality by [configuring custom plugins](https://github.com/Kotlin/dokka/blob/ae3840edb4e4afd7b3e3768a5fddfe8ec0e08f31/examples/gradle-v2/custom-dokka-plugin-example/demo-library/build.gradle.kts).
Custom plugins enable additional processing or modifications to the documentation generation process.
-### Share Dokka configuration across modules
+### Share Dokka configuration across subprojects
-DPG v2 moves away from using `subprojects {}` or `allprojects {}` to share configuration across modules. In future Gradle versions,
+DPG v2 moves away from using `subprojects {}` or `allprojects {}` to share configuration across subprojects. In future Gradle versions,
using these approaches will [lead to errors](https://docs.gradle.org/current/userguide/isolated_projects.html).
Follow the steps below to properly share Dokka configuration in multi-module projects [with existing convention plugins](#multi-module-projects-with-convention-plugins)
or [without convention plugins](#multi-module-projects-without-convention-plugins).
-After sharing the Dokka configuration, you can aggregate the documentation from multiple modules into a single output. For more information, see
+After sharing the Dokka configuration, you can aggregate the documentation from multiple subprojects into a single output. For more information, see
[Update documentation aggregation in multi-module projects](#update-documentation-aggregation-in-multi-module-projects).
> For a multi-module project example, see the [Dokka GitHub repository](https://github.com/Kotlin/dokka/tree/master/examples/gradle-v2/multimodule-example).
@@ -542,12 +542,12 @@ After sharing the Dokka configuration, you can aggregate the documentation from
#### Multi-module projects without convention plugins
-If your project doesn't use convention plugins, you can still share Dokka configurations by directly configuring each module.
-This involves manually setting up the shared configuration in each module's `build.gradle.kts` file. While this approach is less centralized,
+If your project doesn't use convention plugins, you can still share Dokka configurations by directly configuring each subproject.
+This involves manually setting up the shared configuration in each subproject's `build.gradle.kts` file. While this approach is less centralized,
it avoids the need for additional setups like convention plugins.
Otherwise, if your project uses convention plugins, you can also share the Dokka configuration in multi-module projects
-by creating a convention plugin in the `buildSrc` directory, and then applying the plugin to your modules (subprojects).
+by creating a convention plugin in the `buildSrc` directory, and then applying the plugin to your subprojects.
##### Set up the buildSrc directory
@@ -599,9 +599,9 @@ After setting up the `buildSrc` directory:
You need to add the shared Dokka [configuration](#adjust-configuration-options) common to all subprojects within the `dokka {}` block.
Also, you don't need to specify a Dokka version. The version is already set in the `buildSrc/build.gradle.kts` file.
-##### Apply the convention plugin to your modules
+##### Apply the convention plugin to your subprojects
-Apply the Dokka convention plugin across your modules (subprojects) by adding it to each subproject's `build.gradle.kts` file:
+Apply the Dokka convention plugin across your subprojects by adding it to each subproject's `build.gradle.kts` file:
```kotlin
plugins {
@@ -614,13 +614,13 @@ plugins {
If you already have convention plugins, create a dedicated Dokka convention plugin following [Gradle's documentation](https://docs.gradle.org/current/userguide/custom_plugins.html#sec:convention_plugins).
Then, follow the steps to [set up the Dokka convention plugin](#set-up-the-dokka-convention-plugin) and
-[apply it across your modules](#apply-the-convention-plugin-to-your-modules).
+[apply it across your subprojects](#apply-the-convention-plugin-to-your-subprojects).
### Update documentation aggregation in multi-module projects
-Dokka can aggregate the documentation from multiple modules (subprojects) into a single output or publication.
+Dokka can aggregate the documentation from multiple subprojects into a single output or publication.
-As [explained](#apply-the-convention-plugin-to-your-modules), apply the Dokka plugin to all documentable subprojects before aggregating the documentation.
+As [explained](#apply-the-convention-plugin-to-your-subprojects), apply the Dokka plugin to all documentable subprojects before aggregating the documentation.
Aggregation in DGP v2 uses the `dependencies {}` block instead of tasks and can be added in any `build.gradle.kts` file.
@@ -646,7 +646,7 @@ dependencies {
### Change directory of aggregated documentation
-When DGP aggregates modules, each subproject has its own subdirectory within the aggregated documentation.
+When DGP aggregates subprojects, each subproject has its own subdirectory within the aggregated documentation.
In DGP v2, the aggregation mechanism has been updated to better align with Gradle conventions.
DGP v2 now preserves the full subproject directory to prevent conflicts when aggregating
@@ -676,7 +676,7 @@ may become outdated, potentially causing `404` errors.
#### Revert to the DGP v1 directory behavior
-If your project depends on the directory structure used in DGP v1, you can revert this behavior by manually specifying the module directory.
+If your project depends on the directory structure used in DGP v1, you can revert this behavior by manually specifying the subproject directory.
Add the following configuration to the `build.gradle.kts` file of each subproject:
```kotlin
@@ -687,7 +687,7 @@ plugins {
}
dokka {
- // Overrides the module directory to match the V1 structure
+ // Overrides the subproject directory to match the V1 structure
modulePath.set("maths")
}
```
@@ -733,10 +733,10 @@ or both formats at the same time:
```kotlin
plugins {
// Generates HTML documentation
- id("org.jetbrains.dokka") version "2.0.0"
+ id("org.jetbrains.dokka") version "%dokkaVersion%"
// Generates Javadoc documentation
- id("org.jetbrains.dokka-javadoc") version "2.0.0"
+ id("org.jetbrains.dokka-javadoc") version "%dokkaVersion%"
// Keeping both plugin IDs generates both formats
}
diff --git a/docs/topics/dokka-module-and-package-docs.md b/docs/topics/dokka-module-and-package-docs.md
index d6c7af0baa..fdb6de0b0f 100644
--- a/docs/topics/dokka-module-and-package-docs.md
+++ b/docs/topics/dokka-module-and-package-docs.md
@@ -1,15 +1,15 @@
-[//]: # (title: Module documentation)
+[//]: # (title: Subproject documentation)
-Documentation for a module as a whole, as well as packages in that module, can be provided as separate Markdown files.
+Documentation for a subproject as a whole, as well as packages in that subproject, can be provided as separate Markdown files.
## File format
-Inside the Markdown file, the documentation for the module as a whole and for individual packages is introduced by the corresponding
-first-level headings. The text of the heading **must** be **Module ``** for a module, and **Package ``**
+Inside the Markdown file, the documentation for the subproject as a whole and for individual packages is introduced by the corresponding
+first-level headings. The text of the heading **must** be **Module ``** for a subproject, and **Package ``**
for a package.
-The file doesn't have to contain both module and package documentation. You can have files that contain only package or
-module documentation. You can even have a Markdown file per module or package.
+The file doesn't have to contain both subproject and package documentation. You can have files that contain only package or
+subproject documentation. You can even have a Markdown file per subproject or package.
Using [Markdown syntax](https://www.markdownguide.org/basic-syntax/), you can add:
* Headings up to level 6
@@ -19,12 +19,12 @@ Using [Markdown syntax](https://www.markdownguide.org/basic-syntax/), you can ad
* Code blocks
* Blockquotes
-Here's an example file containing both module and package documentation:
+Here's an example file containing both subproject and package documentation:
```text
# Module kotlin-demo
-This content appears under your module name.
+This content appears under your subproject name.
# Package org.jetbrains.kotlin.demo
diff --git a/docs/topics/dokka-plugins.md b/docs/topics/dokka-plugins.md
index a0ebf6c9c0..17dd15cdf0 100644
--- a/docs/topics/dokka-plugins.md
+++ b/docs/topics/dokka-plugins.md
@@ -1,5 +1,10 @@
[//]: # (title: Dokka plugins)
+> This guide applies to Dokka Gradle Plugin (DGP) v2 mode. The previous DGP v1 mode is no longer supported.
+> If you're upgrading from v1 to v2 mode, see the [Migration guide](dokka-migration.md).
+>
+{style="note"}
+
Dokka was built from the ground up to be easily extensible and highly customizable, which allows the community
to implement plugins for missing or very specific features that are not provided out of the box.
@@ -30,24 +35,21 @@ to your project:
-The way to apply Dokka plugins is unified under the `dokka {}` DSL:
+The way to apply Dokka plugins is:
```kotlin
plugins {
- id("org.jetbrains.dokka") version "2.0.0"
+ id("org.jetbrains.dokka") version "%dokkaVersion%"
}
-dokka {
- dependencies {
- dokkaPlugin("org.jetbrains.dokka:mathjax-plugin:2.0.0")
- }
-
+dependencies {
+ dokkaPlugin("org.jetbrains.dokka:mathjax-plugin")
}
```
> * Built-in plugins (like HTML and Javadoc) are always applied automatically. You only configure them and do not need dependencies for them.
>
-> * When documenting multi-module projects (multi-project builds), you need to [share Dokka configuration and plugins across modules](dokka-gradle.md#multi-project-configuration).
+> * When documenting multi-module projects (multi-project builds), you need to [share Dokka configuration and plugins across subprojects](dokka-gradle.md#multi-project-configuration).
>
{style="note"}
@@ -138,7 +140,7 @@ custom style sheets (`customStyleSheets` option), and a modified footer message
-To configure Dokka plugins in a type-safe way, use the `pluginsConfiguration{}` block:
+To configure Dokka plugins in a type-safe way, use the `dokka.pluginsConfiguration {}` block:
```kotlin
dokka {
@@ -155,7 +157,7 @@ For an example of Dokka plugins configuration, see the
Dokka allows you
to extend its functionality
-by [configuring custom plugins](https://github.com/Kotlin/dokka/blob/ae3840edb4e4afd7b3e3768a5fddfe8ec0e08f31/examples/gradle-v2/custom-dokka-plugin-example/demo-library/build.gradle.kts).
+by [configuring custom plugins](https://github.com/Kotlin/dokka/blob/v2.1.0/examples/gradle-v2/custom-dokka-plugin-example/demo-library/build.gradle.kts).
Custom plugins enable additional processing or modifications to the documentation generation process.
diff --git a/docs/topics/formats/dokka-html.md b/docs/topics/formats/dokka-html.md
index 0c23735328..eb4079b153 100644
--- a/docs/topics/formats/dokka-html.md
+++ b/docs/topics/formats/dokka-html.md
@@ -1,8 +1,21 @@
[//]: # (title: HTML)
-HTML is Dokka's default and recommended output format.
-You can see an example of the output by browsing documentation
-for [kotlinx.coroutines](https://kotlinlang.org/api/kotlinx.coroutines/).
+> This guide applies to Dokka Gradle Plugin (DGP) v2 mode. The previous DGP v1 mode is no longer supported.
+> If you're upgrading from v1 to v2 mode, see the [Migration guide](dokka-migration.md).
+>
+{style="note"}
+
+HTML is Dokka's default and recommended output format.
+It provides support for Kotlin Multiplatform, Android, and Java projects.
+Additionally, you can use the HTML format to document both single and multi-project builds.
+
+For examples of the HTML output format, check the following docs:
+* [kotlinx.coroutines](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/)
+* [Bitmovin](https://cdn.bitmovin.com/player/android/3/docs/index.html)
+* [Hexagon](https://hexagontk.com/stable/api/)
+* [Ktor](https://api.ktor.io/)
+* [OkHttp](https://square.github.io/okhttp/5.x/okhttp/okhttp3/)
+* [Gradle](https://docs.gradle.org/current/kotlin-dsl/index.html)
## Generate HTML documentation
@@ -10,8 +23,12 @@ HTML as an output format is supported by all runners. To generate HTML documenta
your build tool or runner:
* For [Gradle](dokka-gradle.md#generate-documentation), run the following tasks:
- * `dokkaGeneratePublicationHtml` to generate documentation only in HTML format.
* `dokkaGenerate` to generate documentation in [all available formats based on the applied plugins](dokka-gradle.md#configure-documentation-output-format).
+ This is the recommended task for most users. When using this task in IntelliJ IDEA, it logs a clickable link to the output.
+ * `dokkaGeneratePublicationHtml` to generate documentation only in HTML format. This task exposes the output directory
+ as an `@OutputDirectory`. Use this task when you need to consume the generated files in other Gradle tasks, such
+ as uploading them to a server, moving them into a GitHub Pages directory, or packaging them into a `javadoc.jar`.
+ This task is intentionally not shown in Gradle task groups because it is not meant for everyday use.
* For [Maven](dokka-maven.md#generate-documentation), run the `dokka:dokka` goal.
* For [CLI runner](dokka-cli.md#generate-documentation), run with HTML dependencies set.
@@ -206,7 +223,7 @@ You can modify text in the footer by using the `footerMessage` [configuration op
Dokka provides the ability to modify [FreeMarker](https://freemarker.apache.org/) templates used for generating
documentation pages.
-You can change the header completely, add your own banners/menus/search, load analytics, change body styling and so on.
+You can change the header completely, add your own banners/menus/search, load analytics, change body styling, and so on.
Dokka uses the following templates:
@@ -255,4 +272,4 @@ You can also use the following Dokka-defined [directives](https://freemarker.apa
|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `<@content/>` | The main page content. |
| `<@resources/>` | Resources such as scripts and stylesheets. |
-| `<@version/>` | The module version taken from configuration. If the [versioning plugin](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/dokka-subprojects/plugin-versioning) is applied, it is replaced with a version navigator. |
+| `<@version/>` | The subproject version taken from configuration. If the [versioning plugin](https://github.com/Kotlin/dokka/tree/%dokkaVersion%/dokka-subprojects/plugin-versioning) is applied, it is replaced with a version navigator. |
diff --git a/docs/topics/formats/dokka-javadoc.md b/docs/topics/formats/dokka-javadoc.md
index a458408715..21d1e7b9b9 100644
--- a/docs/topics/formats/dokka-javadoc.md
+++ b/docs/topics/formats/dokka-javadoc.md
@@ -1,6 +1,11 @@
[//]: # (title: Javadoc)
+> This guide applies to Dokka Gradle Plugin (DGP) v2 mode. The previous DGP v1 mode is no longer supported.
+> If you're upgrading from v1 to v2 mode, see the [Migration guide](dokka-migration.md).
+>
+{style="note"}
+
Dokka's Javadoc output format is a lookalike of Java's
[Javadoc HTML format](https://docs.oracle.com/en/java/javase/19/docs/api/index.html).
@@ -19,12 +24,9 @@ and you can find the source code on [GitHub](https://github.com/Kotlin/dokka/tre
## Generate Javadoc documentation
-> These instructions reflect Dokka Gradle plugin v1 configuration and tasks. Starting from Dokka 2.0.0, [the Gradle tasks to generate documentation changed](dokka-migration.md#select-documentation-output-format).
-> For more details and the full list of changes in Dokka Gradle Plugin v2, see the [Migration guide](dokka-migration.md).
->
-> The Javadoc format does not support multiplatform projects.
+> The Javadoc format does not support multi-project builds or Kotlin Multiplatform projects.
>
-{style="warning"}
+{style="tip"}
@@ -35,13 +37,14 @@ You need to apply the corresponding plugin id in the `plugins {}` block of your
```kotlin
plugins {
- id("org.jetbrains.dokka-javadoc") version "2.0.0"
+ id("org.jetbrains.dokka-javadoc") version "%dokkaVersion%"
}
```
Once you applied the plugin, you can run the following tasks:
-* `dokkaGeneratePublicationJavadoc` to generate documentation only in Javadoc format.
+
* `dokkaGenerate` to generate documentation in [all available formats based on the applied plugins](dokka-gradle.md#configure-documentation-output-format).
+* `dokkaGeneratePublicationJavadoc` to generate documentation only in Javadoc format.
The `javadoc.jar` file can be generated separately. For more information, see [Building `javadoc.jar`](dokka-gradle.md#build-javadoc-jar).
diff --git a/docs/topics/formats/dokka-markdown.md b/docs/topics/formats/dokka-markdown.md
index 428c22b894..1e195f4f5d 100644
--- a/docs/topics/formats/dokka-markdown.md
+++ b/docs/topics/formats/dokka-markdown.md
@@ -1,6 +1,12 @@
[//]: # (title: Markdown)
+> This guide applies to Dokka Gradle Plugin (DGP) v2 mode. The previous DGP v1 mode is no longer supported.
+> If you're upgrading from v1 to v2 mode, see the [Migration guide](dokka-migration.md).
+>
+{style="note"}
+
+
Dokka is able to generate documentation in [GitHub Flavored](#gfm) and [Jekyll](#jekyll) compatible Markdown.
These formats give you more freedom in terms of hosting documentation as the output can be embedded right into your
@@ -72,8 +78,8 @@ apply()
```
Once you applied the plugin, you can run the following tasks:
-* `dokkaGenerateMarkdown` to generate documentation only in Markdown format.
* `dokkaGenerate` to generate documentation in [all available formats based on the applied plugins](dokka-gradle.md#configure-documentation-output-format).
+* `dokkaGenerateMarkdown` to generate documentation only in Markdown format.
diff --git a/docs/topics/runners/dokka-gradle.md b/docs/topics/runners/dokka-gradle.md
index b8302e6a90..6ad94b420c 100644
--- a/docs/topics/runners/dokka-gradle.md
+++ b/docs/topics/runners/dokka-gradle.md
@@ -1,17 +1,10 @@
[//]: # (title: Gradle)
-> These instructions reflect Dokka Gradle plugin v1 configuration and tasks. Starting from Dokka 2.0.0, several configuration options, Gradle tasks, and steps to generate your documentation have been updated, including:
->
-> * [Adjust configuration options](dokka-migration.md#adjust-configuration-options)
-> * [Work with multi-module projects](dokka-migration.md#share-dokka-configuration-across-modules)
-> * [Generate documentation with the updated tasks](dokka-migration.md#generate-documentation-with-the-updated-task)
-> * [Specify an output directory](dokka-migration.md#output-directory)
->
-> For more details and the full list of changes in Dokka Gradle Plugin v2, see the [Migration guide](dokka-migration.md).
+> This guide applies to Dokka Gradle Plugin (DGP) v2 mode. The previous DGP v1 mode is no longer supported.
+> If you're upgrading from v1 to v2 mode, see the [Migration guide](dokka-migration.md).
>
{style="note"}
-
To generate documentation for a Gradle-based project, you can use the
[Gradle plugin for Dokka](https://plugins.gradle.org/plugin/org.jetbrains.dokka).
@@ -50,12 +43,11 @@ plugins {
-When documenting multi-module projects (multi-project builds), you don't need to apply the plugin explicitly to every
-module or subproject you want to document.
+When documenting multi-project builds, you don't need to apply the plugin explicitly to every subproject you want to document.
Instead,
-Dokka expects you to share configuration across modules using convention plugins or manual configuration per module.
+Dokka expects you to share configuration across subprojects using convention plugins or manual configuration per subproject.
For more information, see
-how to configure [single-module projects](#single-project-configuration) and [multi-module projects](#multi-project-configuration).
+how to configure [single-project](#single-project-configuration) and [multi-project](#multi-project-configuration) builds.
> * Under the hood,
> Dokka uses the [Kotlin Gradle plugin](https://kotlinlang.org/docs/gradle-configure-project.html#apply-the-plugin)
@@ -73,6 +65,13 @@ how to configure [single-module projects](#single-project-configuration) and [mu
If you are not able to use the plugins DSL, you can apply the plugin using
[the legacy method](https://docs.gradle.org/current/userguide/plugins.html#sec:old_plugin_application).
+## Enable build cache and configuration cache
+
+DGP supports Gradle build cache and configuration cache, improving build performance.
+
+* To enable build cache, follow instructions in the [Gradle build cache documentation](https://docs.gradle.org/current/userguide/build_cache.html#sec:build_cache_enable).
+* To enable configuration cache, follow instructions in the [Gradle configuration cache documentation](https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:usage:enable ).
+
## Generate documentation
The Dokka Gradle plugin comes with [HTML](dokka-html.md) and [Javadoc](dokka-javadoc.md) output formats
@@ -88,12 +87,12 @@ Use the following Gradle task to generate documentation:
The key behavior of the `dokkaGenerate` Gradle task is:
* This task generates documentation for both [single](#single-project-configuration)
- and [multi-module](#multi-project-configuration) projects.
+ and [multi-project](#multi-project-configuration) builds.
* By default, the documentation output format is HTML.
You can also generate Javadoc or both HTML and Javadoc formats
by [adding the appropriate plugins](#configure-documentation-output-format).
* The generated documentation is automatically placed in the `build/dokka/html`
- directory for both multi-module and single-module projects.
+ directory for both single and multi-project builds.
You can [change the location (`outputDirectory`)](#general-configuration).
### Configure documentation output format
@@ -113,10 +112,10 @@ or both formats at the same time:
```kotlin
plugins {
// Generates HTML documentation
- id("org.jetbrains.dokka") version "2.0.0"
+ id("org.jetbrains.dokka") version "%dokkaVersion%"
// Generates Javadoc documentation
- id("org.jetbrains.dokka-javadoc") version "2.0.0"
+ id("org.jetbrains.dokka-javadoc") version "%dokkaVersion%"
// Keeping both plugin IDs generates both formats
}
@@ -141,20 +140,20 @@ or both formats at the same time:
The Markdown output format (including GFM and Jekyll) is not supported by default,
but you can [enable it manually](dokka-markdown.md).
-### Aggregate documentation output in multi-module projects
+### Aggregate documentation output in multi-project builds
-Dokka can aggregate documentation from multiple modules (subprojects) into a single output or publication.
+Dokka can aggregate documentation from multiple subprojects into a single output or publication.
-You have to [apply the Dokka plugin](#apply-the-convention-plugin-to-your-modules) to
-all documentable modules before aggregating the documentation.
+You have to [apply the Dokka plugin](#apply-the-convention-plugin-to-your-subprojects) to
+all documentable subprojects before aggregating the documentation.
-To aggregate documentation from multiple modules, add the `dependencies {}`
+To aggregate documentation from multiple subprojects, add the `dependencies {}`
block in the `build.gradle.kts` file of the root project:
```kotlin
dependencies {
- dokka(project(":some-subproject:"))
- dokka(project(":another-subproject:"))
+ dokka(project(":childProjectA:"))
+ dokka(project(":childProjectB:"))
}
```
@@ -175,22 +174,22 @@ The generated documentation is aggregated as follows:
{width=600}
-See our [multi-module project example](https://github.com/Kotlin/dokka/tree/2.0.0/examples/gradle-v2/multimodule-example)
+See our [multi-project example](https://github.com/Kotlin/dokka/tree/2.0.0/examples/gradle-v2/multimodule-example)
for more details.
#### Directory of aggregated documentation
-When DGP aggregates modules, each module has its own subdirectory within the aggregated documentation.
-DGP ensures each module has a unique directory by retaining the full project structure.
+When DGP aggregates subprojects, each subproject has its own subdirectory within the aggregated documentation.
+DGP ensures each subproject has a unique directory by retaining the full project structure.
-For example, given a project with an aggregation in `:turbo-lib` and a nested module or subproject `:turbo-lib:maths`,
+For example, given a project with an aggregation in `:turbo-lib` and a nested subproject `:turbo-lib:maths`,
the generated documentation is placed under:
```text
turbo-lib/build/dokka/html/turbo-lib/maths/
```
-You can revert this behavior by manually specifying the module directory.
+You can revert this behavior by manually specifying the subproject directory.
Add the following configuration to the `build.gradle.kts` file of each subproject:
```kotlin
@@ -201,7 +200,7 @@ plugins {
}
dokka {
- // Overrides the module directory
+ // Overrides the subproject directory
modulePath.set("maths")
}
```
@@ -270,14 +269,14 @@ Depending on the type of project that you have, the way you apply and configure
[configuration options](#configuration-options) themselves are the same, regardless of the type of your project.
For simple and flat projects with a single `build.gradle.kts` or `build.gradle` file found in the root of your project,
-see [Single-project configuration (single-module projects)](#single-project-configuration).
+see [Single-project configuration](#single-project-configuration).
For a more complex build with subprojects and multiple nested `build.gradle.kts` or `build.gradle` files,
-see [Multi-project configuration (multi-module projects)](#multi-project-configuration).
+see [Multi-project configuration](#multi-project-configuration).
### Single-project configuration
-Single-module projects or single-project builds usually have only one `build.gradle.kts`
+Single-project builds usually have only one `build.gradle.kts`
or `build.gradle` file in the root of the project.
They can be either single-platform or multiplatform and typically have the following structure:
@@ -403,7 +402,7 @@ For more information, see [Configuration options](#configuration-options).
### Multi-project configuration
-[Multi-module projects or multi-project builds](https://docs.gradle.org/current/userguide/multi_project_builds.html)
+[Multi-project builds](https://docs.gradle.org/current/userguide/multi_project_builds.html)
usually contain several
nested `build.gradle.kts` files and have a structure similar to the following:
@@ -452,32 +451,32 @@ nested `build.gradle.kts` files and have a structure similar to the following:
-Single and multi-module documentation share the same
+Single and multi-project documentation share the same
[configuration model using the top-level `dokka {}` DSL](#single-project-configuration).
-In multi-module projects,
-you configure Dokka in the root project and can optionally share settings across subprojects or modules.
+In multi-project builds,
+you configure Dokka in the root project and can optionally share settings across subprojects.
-To share Dokka configuration across modules, you can use either:
+To share Dokka configuration across subprojects, you can use either:
-* [Direct configuration in multi-module projects without convention plugins](#direct-configuration-in-multi-module-projects-without-convention-plugins)
-* [Convention plugins](#multi-module-projects-with-convention-plugins)
+* [Direct configuration in multi-project builds requiring convention plugins](#direct-configuration-in-multi-project-builds-requiring-convention-plugins)
+* [Convention plugins](#multi-project-builds-with-convention-plugins)
-After sharing Dokka configuration, you can aggregate the documentation from multiple modules into a single output.
+After sharing Dokka configuration, you can aggregate the documentation from multiple subprojects into a single output.
For more information, see
-[Aggregate documentation output in multi-module projects](#aggregate-documentation-output-in-multi-module-projects).
+[Aggregate documentation output in multi-project-builds](#aggregate-documentation-output-in-multi-project-builds).
-> For a multi-module project example, see the [Dokka GitHub repository](https://github.com/Kotlin/dokka/tree/master/examples/gradle-v2/multimodule-example).
+> For a multi-project example, see the [Dokka GitHub repository](https://github.com/Kotlin/dokka/tree/master/examples/gradle-v2/multimodule-example).
>
{style="tip"}
-#### Direct configuration in multi-module projects without convention plugins
+#### Direct configuration in multi-project builds requiring convention plugins
-If your project doesn't use convention plugins, you can share Dokka configurations by directly configuring each module.
-This involves manually setting up the shared configuration in each module's `build.gradle.kts` file.
+If your project doesn't use convention plugins, you can share Dokka configurations by directly configuring each subproject.
+This involves manually setting up the shared configuration in each subproject's `build.gradle.kts` file.
While this approach is less centralized,
it avoids the need for additional setups like convention plugins.
-Follow the next steps to configure your multi-module project without convention plugins.
+Follow the next steps to configure your multi-project builds without convention plugins.
##### Set up the buildSrc directory
@@ -526,14 +525,14 @@ After setting up the `buildSrc` directory, set up the Dokka convention plugin:
}
```
- You need to add the shared Dokka [configuration](#configuration-options) common to all modules within the `dokka {}`
+ You need to add the shared Dokka [configuration](#configuration-options) common to all subprojects within the `dokka {}`
block.
Also, you don't need to specify a Dokka version.
The version is already set in the `buildSrc/build.gradle.kts` file.
-##### Apply the convention plugin to your modules
+##### Apply the convention plugin to your subprojects
-Apply the Dokka convention plugin across your modules (subprojects) by adding it to each module's `build.gradle.kts`
+Apply the Dokka convention plugin across your subprojects by adding it to each subproject's `build.gradle.kts`
file:
```kotlin
@@ -542,20 +541,20 @@ plugins {
}
```
-#### Multi-module projects with convention plugins
+#### Multi-project builds with convention plugins
If you already have convention plugins,
create a dedicated Dokka convention plugin following [Gradle's documentation](https://docs.gradle.org/current/userguide/custom_plugins.html#sec:convention_plugins).
Then, follow the steps to [set up the Dokka convention plugin](#set-up-the-dokka-convention-plugin) and
-[apply it across your modules](#apply-the-convention-plugin-to-your-modules).
+[apply it across your subprojects](#apply-the-convention-plugin-to-your-subprojects).
#### Parent project configuration
-In multi-module projects, you can configure settings that apply to the entire documentation in the root project.
-This can include defining the output format, output directory, documentation module name,
-aggregating documentation from all
-modules, and other [configuration options](#configuration-options):
+In multi-project builds, you can configure settings that apply to the entire documentation in the root project.
+This can include defining the output format, output directory, documentation subproject name,
+aggregating documentation from all
+subprojects, and other [configuration options](#configuration-options):
```kotlin
plugins {
@@ -577,13 +576,13 @@ dokka {
// Aggregates subproject documentation
dependencies {
- dokka(project(":subproject-A"))
- dokka(project(":subproject-B"))
+ dokka(project(":childProjectA"))
+ dokka(project(":childProjectB"))
}
```
-Additionally, each module can have its own `dokka {}` block if it needs custom configuration.
-In the following example, the subproject module applies the Dokka plugin, sets a custom module name,
+Additionally, each subproject can have its own `dokka {}` block if it needs custom configuration.
+In the following example, the subproject applies the Dokka plugin, sets a custom subproject name,
and includes additional documentation from its `README.md` file:
```kotlin
@@ -594,7 +593,7 @@ plugins {
dokka {
dokkaPublications.html {
- moduleName.set("Subproject A")
+ moduleName.set("Child Project A")
includes.from("README.md")
}
}
@@ -716,16 +715,16 @@ tasks.withType(DokkaTask.class) {
The display name to refer to the project’s documentation. It appears in the table of contents, navigation,
- headers, and log messages. In multi-module projects, each module or subproject’s moduleName is
+ headers, and log messages. In multi-project builds, each subproject moduleName is
used as its section title in aggregated documentation.
Default: Gradle project name
- The module version displayed in the generated documentation.
- In single-module projects, it is used as the project version.
- In multi-module projects, each module or subproject’s moduleVersion
+ The subproject version displayed in the generated documentation.
+ In single-project builds, it is used as the project version.
+ In multi-project builds, each subproject moduleVersion
is used when aggregating documentation.
Default: Gradle project version
@@ -735,8 +734,8 @@ tasks.withType(DokkaTask.class) {
This setting applies to all documentation formats (HTML, Javadoc, etc.) generated by the dokkaGenerate task.
Default: build/dokka/html
Output directory for additional files
- You can specify the output directory and include additional files for both single-module and multi-module projects.
- For multi-module projects,
+
You can specify the output directory and include additional files for both single and multi-project builds.
+ For multi-project builds,
set the output directory and include additional files (such as README.md)
in the configuration of the root project.
@@ -793,9 +792,9 @@ tasks.withType(DokkaTask.class) {
A list of Markdown files that contain
- module and package documentation.
+ subproject and package documentation.
- The contents of the specified files are parsed and embedded into documentation as module and package descriptions.
+ The contents of the specified files are parsed and embedded into documentation as subproject and package descriptions.
See Dokka gradle example
for an example of what it looks like and how to use it.
@@ -823,7 +822,7 @@ dokka {
dokkaSourceSets {
// Example: Configuration exclusive to the 'linux' source set
named("linux") {
- dependsOn("native")
+ dependentSourceSets{named("native")}
sourceRoots.from(file("linux/src"))
}
@@ -838,10 +837,6 @@ dokka {
jdkVersion.set(8)
languageVersion.set("1.7")
apiVersion.set("1.7")
- noStdlibLink.set(false)
- noJdkLink.set(false)
- noAndroidSdkLink.set(false)
- platform.set(Platform.DEFAULT)
sourceRoots.from(file("src"))
classpath.from(project.files(), file("libs/dependency.jar"))
samples.from(project.files(), "samples/Basic.kt", "samples/Advanced.kt")
@@ -853,7 +848,7 @@ dokka {
// Package options section
}
externalDocumentationLinks {
- // Package options section
+ // External documentation links section
}
}
}
@@ -1008,34 +1003,6 @@ tasks.withType(DokkaTask.class) {
By default, it is deduced from languageVersion.
-
-
- Whether to generate external documentation links that lead to the API reference
- documentation of Kotlin's standard library.
-
- Note: Links are generated when noStdLibLink is set to false.
- Default: false
-
-
- Whether to generate external documentation links to JDK's Javadocs.
- The version of JDK Javadocs is determined by the jdkVersion option.
- Note: Links are generated when noJdkLink is set to false.
- Default: false
-
-
-
- Whether to generate external documentation links to the Android SDK API reference.
- This is only relevant in Android projects, ignored otherwise.
- Note: Links are generated when noAndroidSdkLink is set to false.
- Default: false
-
-
-
- The platform to be used for setting up code analysis and
- @sample environment.
-
- The default value is deduced from information provided by the Kotlin Gradle plugin.
-
The source code roots to be analyzed and documented.
@@ -1394,7 +1361,7 @@ tasks.withType(DokkaTask.class) {
Package lists contain information about the documentation and the project itself,
- such as module and package names.
+ such as subproject and package names.
This can also be a locally cached file to avoid network calls.
@@ -1411,7 +1378,7 @@ Below you can see all possible configuration options applied at the same time:
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
plugins {
- id("org.jetbrains.dokka") version "2.0.0"
+ id("org.jetbrains.dokka") version "%dokkaVersion%"
}
dokka {
@@ -1425,59 +1392,55 @@ dokka {
suppressObviousFunctions.set(true)
includes.from(project.files(), "packages.md", "extra.md")
}
-}
-
-dokkaSourceSets {
- // Example: Configuration exclusive to the 'linux' source set
- named("linux") {
- dependsOn("native")
- sourceRoots.from(file("linux/src"))
- }
- configureEach {
- suppress.set(false)
- displayName.set(name)
- documentedVisibilities.set(setOf(VisibilityModifier.Public)) // OR documentedVisibilities(VisibilityModifier.Public)
- reportUndocumented.set(false)
- skipEmptyPackages.set(true)
- skipDeprecated.set(false)
- suppressGeneratedFiles.set(true)
- jdkVersion.set(8)
- languageVersion.set("1.7")
- apiVersion.set("1.7")
- noStdlibLink.set(false)
- noJdkLink.set(false)
- noAndroidSdkLink.set(false)
- platform.set(Platform.DEFAULT)
- sourceRoots.from(file("src"))
- classpath.from(project.files(), file("libs/dependency.jar"))
- samples.from(project.files(), "samples/Basic.kt", "samples/Advanced.kt")
-
- sourceLink {
- localDirectory.set(file("src/main/kotlin"))
- remoteUrl("https://example.com/src")
- remoteLineSuffix.set("#L")
- }
-
- externalDocumentationLink {
- url = URL("https://example.com/docs/")
- packageListUrl = File("/path/to/package-list").toURI().toURL()
+ dokkaSourceSets {
+ // Example: Configuration exclusive to the 'linux' source set
+ named("linux") {
+ dependentSourceSets{named("native")}
+ sourceRoots.from(file("linux/src"))
}
- perPackageOption {
- matchingRegex.set(".*api.*")
+ configureEach {
suppress.set(false)
- skipDeprecated.set(false)
+ displayName.set(name)
+ documentedVisibilities.set(setOf(VisibilityModifier.Public)) // OR documentedVisibilities(VisibilityModifier.Public)
reportUndocumented.set(false)
- documentedVisibilities.set(
- setOf(
- VisibilityModifier.Public,
- VisibilityModifier.Private,
- VisibilityModifier.Protected,
- VisibilityModifier.Internal,
- VisibilityModifier.Package
+ skipEmptyPackages.set(true)
+ skipDeprecated.set(false)
+ suppressGeneratedFiles.set(true)
+ jdkVersion.set(8)
+ languageVersion.set("1.7")
+ apiVersion.set("1.7")
+ sourceRoots.from(file("src"))
+ classpath.from(project.files(), file("libs/dependency.jar"))
+ samples.from(project.files(), "samples/Basic.kt", "samples/Advanced.kt")
+
+ sourceLink {
+ localDirectory.set(file("src/main/kotlin"))
+ remoteUrl("https://example.com/src")
+ remoteLineSuffix.set("#L")
+ }
+
+ externalDocumentationLinks {
+ url = URL("https://example.com/docs/")
+ packageListUrl = File("/path/to/package-list").toURI().toURL()
+ }
+
+ perPackageOption {
+ matchingRegex.set(".*api.*")
+ suppress.set(false)
+ skipDeprecated.set(false)
+ reportUndocumented.set(false)
+ documentedVisibilities.set(
+ setOf(
+ VisibilityModifier.Public,
+ VisibilityModifier.Private,
+ VisibilityModifier.Protected,
+ VisibilityModifier.Internal,
+ VisibilityModifier.Package
+ )
)
- )
+ }
}
}
}
@@ -1506,7 +1469,7 @@ tasks.withType(DokkaTask.class) {
dokkaSourceSets {
named("linux") {
- dependsOn("native")
+ dependentSourceSets{named("native")}
sourceRoots.from(file("linux/src"))
}
configureEach {
@@ -1556,10 +1519,3 @@ tasks.withType(DokkaTask.class) {
-
-## Enable build cache and configuration cache
-
-DGP supports Gradle build cache and configuration cache, improving build performance.
-
-* To enable build cache, follow instructions in the [Gradle build cache documentation](https://docs.gradle.org/current/userguide/build_cache.html#sec:build_cache_enable).
-* To enable configuration cache, follow instructions in the [Gradle configuration cache documentation](https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:usage:enable ).