Skip to content

Commit 3c190b9

Browse files
authored
Do not generate dokka for snapshots and EAPs (#4985)
1 parent 355822b commit 3c190b9

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

build-logic/src/main/kotlin/ktorbuild.dokka.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ dokka {
2828
}
2929

3030
tasks.withType<DokkaGeneratePublicationTask>().configureEach {
31+
// Generate Dokka only for stable releases 'X.Y.Z' to save time when building snapshots, EAPs, etc.
32+
// Comment these lines if you want to test Dokka generation locally
33+
val projectVersion = project.version.toString()
34+
onlyIf { isStableVersion(projectVersion) }
35+
3136
// Reduce memory consumption on CI
3237
if (ktorBuild.isCI.get()) {
3338
withLimitedParallelism("dokka", maxParallelTasks = 2)

build-logic/src/main/kotlin/ktorbuild/internal/Version.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ internal fun Project.resolveVersion(): String {
2424
else -> projectVersion
2525
}
2626
}
27+
28+
private val stableVersionRegex = Regex("""^\d+\.\d+\.\d+$""")
29+
30+
/** Checks whether the given [version] stable or not. */
31+
internal fun isStableVersion(version: String) = version matches stableVersionRegex

0 commit comments

Comments
 (0)