aboutsummaryrefslogtreecommitdiff
path: root/buildSrc/src/main/kotlin
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-07-01 17:38:49 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-07-02 12:48:53 +0200
commit012190fbfd049f56637b1039f4ae1f69becea881 (patch)
treed762840339419bdb9c5e75a4e20817c8207c1db0 /buildSrc/src/main/kotlin
parent2e02e56818609c683f95ba4f17fa749eb9e1c705 (diff)
downloaddokka-012190fbfd049f56637b1039f4ae1f69becea881.tar.gz
dokka-012190fbfd049f56637b1039f4ae1f69becea881.tar.bz2
dokka-012190fbfd049f56637b1039f4ae1f69becea881.zip
Gradle integration tests: Use dokka_it_kotlin_version over kotlin_version
Diffstat (limited to 'buildSrc/src/main/kotlin')
-rw-r--r--buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt20
1 files changed, 12 insertions, 8 deletions
diff --git a/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt b/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt
index 5bd35415..d5fd3e78 100644
--- a/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt
+++ b/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt
@@ -7,13 +7,17 @@ import org.gradle.kotlin.dsl.provideDelegate
fun Project.configureDokkaVersion(): String {
var dokka_version: String? by this.extra
if (dokka_version == null) {
- val buildNumber = System.getenv("BUILD_NUMBER")
val dokka_version_base: String by this
- dokka_version = dokka_version_base + if (buildNumber == null || System.getenv("FORCE_SNAPSHOT") != null) {
- "-SNAPSHOT"
- } else {
- "-$buildNumber"
- }
+ dokka_version = dokkaVersionFromBase(dokka_version_base)
}
- return dokka_version!!
-} \ No newline at end of file
+ return checkNotNull(dokka_version)
+}
+
+private fun dokkaVersionFromBase(baseVersion: String): String {
+ val buildNumber = System.getenv("BUILD_NUMBER")
+ val forceSnapshot = System.getenv("FORCE_SNAPSHOT") != null
+ if (forceSnapshot || buildNumber == null) {
+ return "$baseVersion-SNAPSHOT"
+ }
+ return "$baseVersion-$buildNumber"
+}