Skip to content

Commit

Permalink
Simplify Dokka source link configuration (#2524)
Browse files Browse the repository at this point in the history
  • Loading branch information
whyoleg committed Dec 5, 2023
1 parent 7201ab3 commit 704610d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions gradle/dokka.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ def documentedSubprojects = ["kotlinx-serialization-core",
"kotlinx-serialization-hocon",
"kotlinx-serialization-protobuf"]

def jvmOnlySubprojects = ["kotlinx-serialization-hocon"]

subprojects {
if (!(name in documentedSubprojects)) return
apply plugin: 'org.jetbrains.dokka'
Expand Down Expand Up @@ -77,12 +75,8 @@ subprojects {
}

sourceLink {
// sources directory for MPP configured in gradle/configure-source-sets.gradle:61
// in short - kotlin.srcDirs = ["$sourceSet.name/src"]
def sourcesPath = project.name in jvmOnlySubprojects ? "src/main/kotlin" : "$name/src"
def relProjectPath = rootProject.projectDir.toPath().relativize(projectDir.toPath())
localDirectory.set(file(sourcesPath))
remoteUrl.set(new URL("https://github.com/Kotlin/kotlinx.serialization/tree/master/$relProjectPath/$sourcesPath"))
localDirectory.set(rootDir)
remoteUrl.set(new URL("https://github.com/Kotlin/kotlinx.serialization/tree/master"))
remoteLineSuffix.set("#L")
}
}
Expand Down

0 comments on commit 704610d

Please sign in to comment.