aboutsummaryrefslogtreecommitdiff
path: root/buildSrc/src/main/kotlin/org/jetbrains/DokkaVersion.kt
blob: 5bd3541559628649ef963926b1301fc8c8d2ca44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package org.jetbrains

import org.gradle.api.Project
import org.gradle.kotlin.dsl.extra
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"
        }
    }
    return dokka_version!!
}