From 642f0c5f51ba0d90d6447531c0627a4e56ec6812 Mon Sep 17 00:00:00 2001 From: Oleg Yukhnevich Date: Thu, 30 Nov 2023 22:33:45 +0200 Subject: [PATCH 1/4] Update Gradle dokka configuration to make sure "source" button is visible in all API docs --- core/build.gradle.kts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/build.gradle.kts b/core/build.gradle.kts index edb567b7..3950e914 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -406,6 +406,19 @@ tasks.withType().configureEach { matchingRegex.set(".*\\.internal\\..*") suppress.set(true) } + + if (name.endsWith("Main")) { + sourceLink { + // sources are located in PLATFORM/src, + // where PLATFORM could be jvm, js, darwin, etc + // configuration happens upper in the build script + val platform = name.dropLast(4) + val relPath = rootProject.projectDir.toPath().relativize(projectDir.toPath()) + localDirectory.set(projectDir.resolve("$platform/src")) + remoteUrl.set(URL("https://github.com/kotlin/kotlinx-datetime/tree/master/$relPath/$platform/src")) + remoteLineSuffix.set("#L") + } + } } } From efccc09082e029bbc65d5479e54200a9dc77a6e6 Mon Sep 17 00:00:00 2001 From: Oleg Yukhnevich Date: Mon, 4 Dec 2023 20:43:29 +0200 Subject: [PATCH 2/4] Simplify sourceLink setup --- core/build.gradle.kts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 3950e914..ea9c9a23 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -406,18 +406,10 @@ tasks.withType().configureEach { matchingRegex.set(".*\\.internal\\..*") suppress.set(true) } - - if (name.endsWith("Main")) { - sourceLink { - // sources are located in PLATFORM/src, - // where PLATFORM could be jvm, js, darwin, etc - // configuration happens upper in the build script - val platform = name.dropLast(4) - val relPath = rootProject.projectDir.toPath().relativize(projectDir.toPath()) - localDirectory.set(projectDir.resolve("$platform/src")) - remoteUrl.set(URL("https://github.com/kotlin/kotlinx-datetime/tree/master/$relPath/$platform/src")) - remoteLineSuffix.set("#L") - } + sourceLink { + localDirectory.set(rootDir) + remoteUrl.set(URL("https://github.com/kotlin/kotlinx-datetime/tree/master")) + remoteLineSuffix.set("#L") } } } From f29a4256abddd569387f5de5f19ed3df9a8e7fa5 Mon Sep 17 00:00:00 2001 From: Oleg Yukhnevich Date: Mon, 4 Dec 2023 20:46:40 +0200 Subject: [PATCH 3/4] Use tag in dokka remoteUrl --- core/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/build.gradle.kts b/core/build.gradle.kts index ea9c9a23..001af68d 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -408,7 +408,7 @@ tasks.withType().configureEach { } sourceLink { localDirectory.set(rootDir) - remoteUrl.set(URL("https://github.com/kotlin/kotlinx-datetime/tree/master")) + remoteUrl.set(URL("https://github.com/kotlin/kotlinx-datetime/tree/v${project.version}")) remoteLineSuffix.set("#L") } } From 1b51a3899f23395187dcbe8623653b1f3085f1b0 Mon Sep 17 00:00:00 2001 From: Oleg Yukhnevich Date: Mon, 4 Dec 2023 21:44:53 +0200 Subject: [PATCH 4/4] Use latest-release branch as `remoteUrl` --- core/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 001af68d..d83cc4e6 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -408,7 +408,7 @@ tasks.withType().configureEach { } sourceLink { localDirectory.set(rootDir) - remoteUrl.set(URL("https://github.com/kotlin/kotlinx-datetime/tree/v${project.version}")) + remoteUrl.set(URL("https://github.com/kotlin/kotlinx-datetime/tree/latest-release")) remoteLineSuffix.set("#L") } }