@@ -37,31 +37,12 @@ tasks.withType(DokkaTaskPartial::class).configureEach {
3737 }
3838}
3939
40- fun GradleDokkaSourceSetBuilder.makeLinkMapping (projectDir : File ) {
41- sourceLink {
42- val relPath = rootProject.projectDir.toPath().relativize(projectDir.toPath())
43- localDirectory.set(projectDir.resolve(" src" ))
44- remoteUrl.set(URL (" https://github.com/kotlin/kotlinx.coroutines/tree/master/$relPath /src" ))
45- remoteLineSuffix.set(" #L" )
46- }
47- }
48-
49- if (project.isMultiplatform) {
50- // Configuration for MPP modules
51- tasks.withType(DokkaTaskPartial ::class ).configureEach {
52- // sources in MPP are located in moduleDir/PLATFORM/src,
53- // where PLATFORM could be jvm, js, jdk8, concurrent, etc
54- // configuration happens in buildSrc/src/main/kotlin/SourceSetsKt.configureMultiplatform
55- dokkaSourceSets.matching { it.name.endsWith(" Main" ) }.configureEach {
56- val platform = name.dropLast(4 )
57- makeLinkMapping(project.file(platform))
58- }
59- }
60- } else {
61- // Configuration for JVM modules
62- tasks.withType(DokkaTaskPartial ::class ).configureEach {
63- dokkaSourceSets.named(" main" ) {
64- makeLinkMapping(projectDir)
40+ tasks.withType(DokkaTaskPartial ::class ).configureEach {
41+ dokkaSourceSets.configureEach {
42+ sourceLink {
43+ localDirectory.set(rootDir)
44+ remoteUrl.set(URL (" https://github.com/kotlin/kotlinx.coroutines/tree/master" ))
45+ remoteLineSuffix.set(" #L" )
6546 }
6647 }
6748}
0 commit comments