[atomicfu-K/N]: Support Native backend in atomicfu compiler plugin
Atomicfu compiler plugin supported transformations for K/N: * atomic properties are replaced with volatile properties and all the operations are delegated to native atomic intrinsics * atomic arrays are replaced with kotlin.concurrent.Atomic*Arrays * all other features available on JVM are covered as well (custom atomic extensions, delegated properties, debug tracing) See (KT-58358, https://github.com/Kotlin/kotlinx-atomicfu/issues/261) Merge-request: KT-MR-11253 Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
This commit is contained in:
+5
-1
@@ -37,7 +37,8 @@ class AtomicfuKotlinGradleSubplugin :
|
||||
val project = kotlinCompilation.target.project
|
||||
val config = project.extensions.getByType(AtomicfuKotlinGradleExtension::class.java)
|
||||
return (config.isJsIrTransformationEnabled && kotlinCompilation.target.isJs()) ||
|
||||
(config.isJvmIrTransformationEnabled && kotlinCompilation.target.isJvm())
|
||||
(config.isJvmIrTransformationEnabled && kotlinCompilation.target.isJvm()) ||
|
||||
(config.isNativeIrTransformationEnabled && kotlinCompilation.target.isNative())
|
||||
}
|
||||
|
||||
override fun applyToCompilation(
|
||||
@@ -48,6 +49,7 @@ class AtomicfuKotlinGradleSubplugin :
|
||||
open class AtomicfuKotlinGradleExtension {
|
||||
var isJsIrTransformationEnabled = false
|
||||
var isJvmIrTransformationEnabled = false
|
||||
var isNativeIrTransformationEnabled = false
|
||||
}
|
||||
|
||||
override fun getPluginArtifact(): SubpluginArtifact =
|
||||
@@ -58,4 +60,6 @@ class AtomicfuKotlinGradleSubplugin :
|
||||
private fun KotlinTarget.isJs() = platformType == KotlinPlatformType.js
|
||||
|
||||
private fun KotlinTarget.isJvm() = platformType == KotlinPlatformType.jvm || platformType == KotlinPlatformType.androidJvm
|
||||
|
||||
private fun KotlinTarget.isNative() = platformType == KotlinPlatformType.native // todo wasm?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user