From b86d9d3900a7be7cb7d0db8b74b17c356376895a Mon Sep 17 00:00:00 2001 From: Bruno Wieczorek Date: Tue, 6 Aug 2024 20:25:29 +0200 Subject: [PATCH] Fix version in Dokka docs being "-SNAPSHOT" for release --- compose-remember-setting/build.gradle.kts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compose-remember-setting/build.gradle.kts b/compose-remember-setting/build.gradle.kts index d89d4b9..a3ef962 100644 --- a/compose-remember-setting/build.gradle.kts +++ b/compose-remember-setting/build.gradle.kts @@ -1,4 +1,5 @@ import org.jetbrains.compose.ExperimentalComposeLibrary +import org.jetbrains.dokka.gradle.DokkaTask import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl @@ -101,6 +102,12 @@ val currentProperties = rootProject.file("local.properties") val isRelease: Boolean get() = currentProperties["isRelease"]?.toString()?.toBoolean() == true +tasks.withType().configureEach { + if (isRelease) { + moduleVersion = moduleVersion.get().replace("-SNAPSHOT", "") + } +} + extensions.findByType()?.apply { repositories { maven {