Skip to content

Commit efccc09

Browse files
committed
Simplify sourceLink setup
1 parent 642f0c5 commit efccc09

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

core/build.gradle.kts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -406,18 +406,10 @@ tasks.withType<AbstractDokkaLeafTask>().configureEach {
406406
matchingRegex.set(".*\\.internal\\..*")
407407
suppress.set(true)
408408
}
409-
410-
if (name.endsWith("Main")) {
411-
sourceLink {
412-
// sources are located in PLATFORM/src,
413-
// where PLATFORM could be jvm, js, darwin, etc
414-
// configuration happens upper in the build script
415-
val platform = name.dropLast(4)
416-
val relPath = rootProject.projectDir.toPath().relativize(projectDir.toPath())
417-
localDirectory.set(projectDir.resolve("$platform/src"))
418-
remoteUrl.set(URL("https://github.com/kotlin/kotlinx-datetime/tree/master/$relPath/$platform/src"))
419-
remoteLineSuffix.set("#L")
420-
}
409+
sourceLink {
410+
localDirectory.set(rootDir)
411+
remoteUrl.set(URL("https://github.com/kotlin/kotlinx-datetime/tree/master"))
412+
remoteLineSuffix.set("#L")
421413
}
422414
}
423415
}

0 commit comments

Comments
 (0)