From e5aaa76b2ef7faf0b4ed38904f8e50cb2f9c0064 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Fri, 10 Sep 2021 23:26:00 +0200 Subject: Update docs for buildscript with dokka plugins (#2134) --- docs/src/doc/docs/user_guide/gradle/usage.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'docs/src/doc') diff --git a/docs/src/doc/docs/user_guide/gradle/usage.md b/docs/src/doc/docs/user_guide/gradle/usage.md index 704b2b94..b5eed4e9 100644 --- a/docs/src/doc/docs/user_guide/gradle/usage.md +++ b/docs/src/doc/docs/user_guide/gradle/usage.md @@ -67,7 +67,9 @@ Most of the configuration options are set per one source set. The available configuration options for are shown below: ```kotlin -dokkaHtml { +import org.jetbrains.dokka.gradle.DokkaTask + +val dokkaHtml by getting(DokkaTask::class) { outputDirectory.set(buildDir.resolve("dokka")) // Set module name displayed in the final output @@ -261,6 +263,9 @@ To generate the documentation, use the appropriate `dokka${format}` Gradle task: Some plugins can be configured separately using a plugin class and configuration class. For example: ```kotlin +import org.jetbrains.dokka.base.DokkaBase +import org.jetbrains.dokka.base.DokkaBaseConfiguration + pluginConfiguration { customAssets = listOf(file("")) customStyleSheets = listOf(file("")) @@ -268,6 +273,16 @@ pluginConfiguration { ``` Keep in mind, that this only works when using a buildscript (with the configured plugin on classpath) since it is not possible to import plugin's class without it. +For example, you can add `DokkaBase` to gain access to aforementioned configuration: + +```kotlin +buildscript { + dependencies { + // classpath(":") + classpath("org.jetbrains.dokka:dokka-base:1.5.0") + } +} +``` If you don't want to use a buildscript or use Kotlin version lower than 1.3.50 you can achieve the same behaviour manually: ```kotlin -- cgit