Skip to content

Commit

Permalink
Improve dokka-convention.gradle.kts
Browse files Browse the repository at this point in the history
Changes:

1. use the project relative path in the source remote URL to improve its versatility
1. fix the bug that incorrect release tags `v...`` are used, while correct ones should be `plugins-v...`
1. put the `dokka` configuration code in `afterEvaluate` so the project version can be retrieved
  • Loading branch information
ShreckYe committed Nov 7, 2024
1 parent c1c69c3 commit 4f1b2e4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions buildSrc/src/main/kotlin/dokka-convention.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ plugins {
id("org.jetbrains.dokka")
}

dokka {
dokkaSourceSets.all {
sourceLink {
remoteUrl("https://github.com/huanshankeji/gradle-common/tree/v${version}/${project.name}")
remoteLineSuffix.set("#L")
// put in `afterEvaluate` so the project version can be retrieved
afterEvaluate {
dokka {
dokkaSourceSets.all {
sourceLink {
val projectRelativePath = projectDir.relativeTo(rootProject.projectDir)
remoteUrl("https://github.com/huanshankeji/gradle-common/tree/plugins-v${version}/$projectRelativePath")
remoteLineSuffix.set("#L")
}
}
}
}

0 comments on commit 4f1b2e4

Please sign in to comment.