aboutsummaryrefslogtreecommitdiff
path: root/build-logic/src/main/kotlin/org/jetbrains/DokkaVersion.kt
diff options
context:
space:
mode:
Diffstat (limited to 'build-logic/src/main/kotlin/org/jetbrains/DokkaVersion.kt')
-rw-r--r--build-logic/src/main/kotlin/org/jetbrains/DokkaVersion.kt19
1 files changed, 19 insertions, 0 deletions
diff --git a/build-logic/src/main/kotlin/org/jetbrains/DokkaVersion.kt b/build-logic/src/main/kotlin/org/jetbrains/DokkaVersion.kt
new file mode 100644
index 00000000..517c7731
--- /dev/null
+++ b/build-logic/src/main/kotlin/org/jetbrains/DokkaVersion.kt
@@ -0,0 +1,19 @@
+package org.jetbrains
+
+import org.gradle.api.Project
+import org.gradle.kotlin.dsl.extra
+import org.gradle.kotlin.dsl.provideDelegate
+
+@Suppress("LocalVariableName") // property name with underscore as taken from gradle.properties
+fun Project.configureDokkaVersion(): String {
+ val dokka_version: String? by this.extra
+ return checkNotNull(dokka_version)
+}
+
+val Project.dokkaVersion: String
+ get() = configureDokkaVersion()
+
+val Project.dokkaVersionType: DokkaVersionType?
+ get() = DokkaVersionType.values().find {
+ it.suffix.matches(dokkaVersion.substringAfter("-", ""))
+ }