From 5315c6a8cf2e08947dc013fdd60f293f76a0a1bd Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Tue, 25 Apr 2023 14:42:39 +0200 Subject: [PATCH] Simplify multimodule source link configuration example (#2974) --- .../parentProject/build.gradle.kts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/examples/gradle/dokka-multimodule-example/parentProject/build.gradle.kts b/examples/gradle/dokka-multimodule-example/parentProject/build.gradle.kts index 7fb7c11542..3563ecca24 100644 --- a/examples/gradle/dokka-multimodule-example/parentProject/build.gradle.kts +++ b/examples/gradle/dokka-multimodule-example/parentProject/build.gradle.kts @@ -19,18 +19,12 @@ subprojects { Visibility.PROTECTED )) - // In multi-project builds, `remoteUrl` must point to that project's dir specifically, so if you - // want to configure sourceLinks at once in `subprojects {}`, you have to find the relative path. - // Alternatively, you can move this configuration up into subproject build scripts, - // and just hardcode the exact paths as demonstrated in the basic dokka-gradle-example. - // // Read docs for more details: https://kotlinlang.org/docs/dokka-gradle.html#source-link-configuration sourceLink { val exampleDir = "https://github.com/Kotlin/dokka/tree/master/examples/gradle/dokka-multimodule-example" - val projectRelativePath = rootProject.projectDir.toPath().relativize(projectDir.toPath()) - localDirectory.set(projectDir.resolve("src")) - remoteUrl.set(URL("$exampleDir/$projectRelativePath/src")) + localDirectory.set(rootProject.projectDir) + remoteUrl.set(URL("$exampleDir")) remoteLineSuffix.set("#L") } }