From 6aafe0a9b73a9ca951292b07e9e1223b72284721 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Tue, 21 Nov 2023 14:22:44 -0500 Subject: [PATCH] Includes source links in dokka docs (#646) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now they're clickable directly from the dokka docs (see the "source" link in the screenshot) Screenshot 2023-11-21 at 12 45 21 PM --- build.gradle.kts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 9e74107af..2dd484994 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -283,6 +283,17 @@ subprojects { .toURL() ) } + sourceLink { + localDirectory.set(layout.projectDirectory.dir("src").asFile) + val relPath = rootProject.projectDir.toPath().relativize(projectDir.toPath()) + remoteUrl.set( + providers.gradleProperty("POM_SCM_URL") + .map { scmUrl -> + URI("$scmUrl/tree/main/$relPath/src").toURL() + } + ) + remoteLineSuffix.set("#L") + } } }