From 0a4ff493e5c9361460935e0ee3de57f0e476cad1 Mon Sep 17 00:00:00 2001 From: mvicsokolova <82594708+mvicsokolova@users.noreply.github.com> Date: Fri, 24 Nov 2023 12:47:38 +0100 Subject: [PATCH] Apply Native IR transformations only if Kotlin version in the project is at least 1.9.20 (#372) --- .../kotlinx/atomicfu/plugin/gradle/AtomicFUGradlePlugin.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/atomicfu-gradle-plugin/src/main/kotlin/kotlinx/atomicfu/plugin/gradle/AtomicFUGradlePlugin.kt b/atomicfu-gradle-plugin/src/main/kotlin/kotlinx/atomicfu/plugin/gradle/AtomicFUGradlePlugin.kt index 6e281b04..3d2b933c 100644 --- a/atomicfu-gradle-plugin/src/main/kotlin/kotlinx/atomicfu/plugin/gradle/AtomicFUGradlePlugin.kt +++ b/atomicfu-gradle-plugin/src/main/kotlin/kotlinx/atomicfu/plugin/gradle/AtomicFUGradlePlugin.kt @@ -79,7 +79,10 @@ private fun Project.applyAtomicfuCompilerPlugin() { extensions.getByType(AtomicfuKotlinGradleSubplugin.AtomicfuKotlinGradleExtension::class.java).apply { isJsIrTransformationEnabled = rootProject.getBooleanProperty(ENABLE_JS_IR_TRANSFORMATION) isJvmIrTransformationEnabled = rootProject.getBooleanProperty(ENABLE_JVM_IR_TRANSFORMATION) - isNativeIrTransformationEnabled = rootProject.getBooleanProperty(ENABLE_NATIVE_IR_TRANSFORMATION) + if (kotlinVersion.atLeast(1, 9, 20)) { + // Native IR transformation is available since Kotlin 1.9.20 + isNativeIrTransformationEnabled = rootProject.getBooleanProperty(ENABLE_NATIVE_IR_TRANSFORMATION) + } } } else { // for KGP >= 1.6.20 && KGP <= 1.7.20: