From a058fc01de5f3ef5748fb86c4e3359aed16c5e01 Mon Sep 17 00:00:00 2001 From: Filipp Zhinkin Date: Wed, 30 Oct 2024 13:52:50 -0400 Subject: [PATCH 1/5] Updated Dokka Gradle Plugin --- .../kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts | 6 +++--- build.gradle.kts | 4 ++++ gradle.properties | 1 + gradle/libs.versions.toml | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts b/build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts index dd849b19..8a6036f5 100644 --- a/build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts +++ b/build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts @@ -4,7 +4,7 @@ */ import org.jetbrains.dokka.gradle.* -import java.net.URL +import java.net.URI plugins { id("org.jetbrains.dokka") @@ -21,13 +21,13 @@ tasks.withType().configureEach { ) } -tasks.withType().configureEach { +dokka { dokkaSourceSets.configureEach { includes.from("Module.md") sourceLink { localDirectory = rootDir - remoteUrl = URL("https://github.com/kotlin/kotlinx-io/tree/master") + remoteUrl("https://github.com/kotlin/kotlinx-io/tree/master") remoteLineSuffix = "#L" } diff --git a/build.gradle.kts b/build.gradle.kts index 2e45281b..2ce0547f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,6 +34,10 @@ dependencies { kover(project(":kotlinx-io-core")) kover(project(":kotlinx-io-bytestring")) kover(project(":kotlinx-io-okio")) + + dokka(project(":kotlinx-io-bytestring")) + dokka(project(":kotlinx-io-core")) + dokka(project(":kotlinx-io-okio")) } kover { diff --git a/gradle.properties b/gradle.properties index 6d0f34ee..df50cff7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,3 +9,4 @@ kotlin.code.style=official org.gradle.jvmargs=-Xmx4G nativeBenchmarksEnabled=true kotlin.mpp.applyDefaultHierarchyTemplate=false +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9bfad93b..57db7f57 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ kotlin = "2.0.0" java = "8" multi-release-toolchain = "17" -dokka = "1.9.20" +dokka = "2.0.0-Beta" kover = "0.8.2" bcv = "0.16.3" benchmark = "0.4.11" From cfb7d446acf33a086c8433abb46ff18f0cf3158d Mon Sep 17 00:00:00 2001 From: Filipp Zhinkin Date: Wed, 30 Oct 2024 16:36:08 -0400 Subject: [PATCH 2/5] Updated templates dir configuration --- .../io/conventions/kotlinx-io-dokka.gradle.kts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts b/build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts index 8a6036f5..8976e261 100644 --- a/build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts +++ b/build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts @@ -3,6 +3,7 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the LICENCE file. */ +import org.gradle.kotlin.dsl.execution.templateIdFor import org.jetbrains.dokka.gradle.* import java.net.URI @@ -10,17 +11,6 @@ plugins { id("org.jetbrains.dokka") } -// shared configuration for all dokka tasks (both partial and multi-module) -tasks.withType().configureEach { - pluginsMapConfiguration.set( - mapOf( - "org.jetbrains.dokka.base.DokkaBase" to """{ "templatesDir" : "${ - rootDir.resolve("dokka-templates") - }" }""" - ) - ) -} - dokka { dokkaSourceSets.configureEach { includes.from("Module.md") @@ -43,5 +33,9 @@ dokka { "common/test/samples", "$platform/test/samples" ) + + pluginsConfiguration.html { + templatesDir = rootDir.resolve("dokka-templates") + } } } From ba65f6d8c116c8852df89d8ca3b734fd49954021 Mon Sep 17 00:00:00 2001 From: Filipp Zhinkin Date: Mon, 16 Dec 2024 13:52:57 -0500 Subject: [PATCH 3/5] Bump up DGP version --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 57db7f57..2b8fd064 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ kotlin = "2.0.0" java = "8" multi-release-toolchain = "17" -dokka = "2.0.0-Beta" +dokka = "2.0.0" kover = "0.8.2" bcv = "0.16.3" benchmark = "0.4.11" From 416a5913dfd2c1a8261fe80eb9ab8f727c2cc19c Mon Sep 17 00:00:00 2001 From: Filipp Zhinkin Date: Mon, 16 Dec 2024 14:10:24 -0500 Subject: [PATCH 4/5] Fixed sample sourcesets setup --- .../kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts b/build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts index 8976e261..43646b88 100644 --- a/build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts +++ b/build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts @@ -29,10 +29,7 @@ dokka { // as in kotlinx-io-multiplatform.gradle.kts:configureSourceSet val platform = name.dropLast(4) - samples.from( - "common/test/samples", - "$platform/test/samples" - ) + samples.from("$platform/test/samples") pluginsConfiguration.html { templatesDir = rootDir.resolve("dokka-templates") From b51e8db8020476f7eed52cb0117f8e6923129f51 Mon Sep 17 00:00:00 2001 From: Filipp Zhinkin Date: Mon, 16 Dec 2024 14:16:08 -0500 Subject: [PATCH 5/5] Updated external links setup --- integration/kotlinx-io-okio/build.gradle.kts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration/kotlinx-io-okio/build.gradle.kts b/integration/kotlinx-io-okio/build.gradle.kts index f952c08f..c756418d 100644 --- a/integration/kotlinx-io-okio/build.gradle.kts +++ b/integration/kotlinx-io-okio/build.gradle.kts @@ -41,11 +41,11 @@ kotlin { } } -tasks.withType(DokkaTaskPartial::class) { +dokka { dokkaSourceSets.configureEach { - externalDocumentationLink { - url = URL("https://square.github.io/okio/3.x/okio/") - packageListUrl = URL("https://square.github.io/okio/3.x/okio/okio/package-list") + externalDocumentationLinks.register("okio") { + url("https://square.github.io/okio/3.x/okio/") + packageListUrl("https://square.github.io/okio/3.x/okio/okio/package-list") } } }