File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
atomicfu-gradle-plugin/src/main/kotlin/kotlinx/atomicfu/plugin/gradle
integration-testing/examples/mpp-sample Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -105,9 +105,10 @@ private fun Project.configureDependencies() {
105105 getAtomicfuDependencyNotation(Platform .JS , version)
106106 )
107107 dependencies.add(TEST_IMPLEMENTATION_CONFIGURATION , getAtomicfuDependencyNotation(Platform .JS , version))
108- addCompilerPluginDependency ()
108+ addJsCompilerPluginRuntimeDependency ()
109109 }
110110 withPluginWhenEvaluatedDependencies(" kotlin-multiplatform" ) { version ->
111+ addJsCompilerPluginRuntimeDependency()
111112 configureMultiplatformPluginDependencies(version)
112113 }
113114}
@@ -178,7 +179,9 @@ private fun Project.isTransformationDisabled(target: KotlinTarget): Boolean {
178179 ! config.transformJs && platformType == KotlinPlatformType .js
179180}
180181
181- private fun Project.addCompilerPluginDependency () {
182+ // Adds kotlinx-atomicfu-runtime as an implementation dependency to the JS IR target:
183+ // it provides inline methods that replace atomic methods from the library and is needed at runtime.
184+ private fun Project.addJsCompilerPluginRuntimeDependency () {
182185 if (isCompilerPluginAvailable()) {
183186 withKotlinTargets { target ->
184187 if (target.isJsIrTarget()) {
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ repositories {
2828
2929kotlin {
3030 jvm()
31+ js {
32+ nodejs()
33+ }
3134
3235 val hostOs = System .getProperty(" os.name" )
3336 val isArm64 = System .getProperty(" os.arch" ) == " aarch64"
@@ -42,8 +45,12 @@ kotlin {
4245 }
4346
4447 sourceSets {
45- val commonMain by getting
46- val commonTest by getting {
48+ commonMain {
49+ dependencies {
50+ implementation(kotlin(" stdlib" ))
51+ }
52+ }
53+ commonTest {
4754 dependencies {
4855 implementation(kotlin(" test" ))
4956 }
You can’t perform that action at this time.
0 commit comments