Skip to content

Commit

Permalink
Improve Kotlin Multiplatform functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
JavierSegoviaCordoba committed Sep 3, 2024
1 parent e40c755 commit 4685471
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test
internal class KopyGradlePluginTest : GradleTestKitTest() {

@Test
fun `kotlin multiplatform empty`() = gradleTestKitTest("kotlin-multiplatform-empty") {
fun `kotlin multiplatform`() = gradleTestKitTest("kotlin-multiplatform") {
gradlew("assemble").output.shouldContain("BUILD SUCCESSFUL")
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
plugins {
id("com.javiersc.kotlin.kopy")
id("org.jetbrains.kotlin.multiplatform")
id("org.jetbrains.kotlin.plugin.atomicfu")
}

kotlin {
jvm()
linuxArm64()
linuxX64()
macosArm64()
mingwX64()
}

kopy {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kotlinx.atomicfu.enableJvmIrTransformation=true
kotlinx.atomicfu.enableJsIrTransformation=true
kotlinx.atomicfu.enableNativeIrTransformations=true
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ dependencyResolutionManagement {
}
}
}

include(
":lib-a",
// ":lib-b",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.javiersc.kotlin.kopy.functional.test.lib.a

import com.javiersc.kotlin.kopy.Kopy

fun a() {
val house = House(
squareMeters = 53,
kitchen = Kitchen(
squareMeters = 10,
),
)
house.copy {
kitchen.squareMeters = 77
}
}

@Kopy data class House(val squareMeters: Int, val kitchen: Kitchen)
@Kopy data class Kitchen(val squareMeters: Int)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kotlinx.atomicfu.enableJvmIrTransformation=true
kotlinx.atomicfu.enableJsIrTransformation=true
kotlinx.atomicfu.enableNativeIrTransformations=true

0 comments on commit 4685471

Please sign in to comment.