diff --git a/kopy-gradle-plugin/testFunctional/kotlin/com/javiersc/kotlin/kopy/gradle/plugin/KopyGradlePluginTest.kt b/kopy-gradle-plugin/testFunctional/kotlin/com/javiersc/kotlin/kopy/gradle/plugin/KopyGradlePluginTest.kt index 0f3438c..83155ef 100644 --- a/kopy-gradle-plugin/testFunctional/kotlin/com/javiersc/kotlin/kopy/gradle/plugin/KopyGradlePluginTest.kt +++ b/kopy-gradle-plugin/testFunctional/kotlin/com/javiersc/kotlin/kopy/gradle/plugin/KopyGradlePluginTest.kt @@ -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") } diff --git a/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/build.gradle.kts b/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/build.gradle.kts new file mode 100644 index 0000000..50fb6da --- /dev/null +++ b/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/build.gradle.kts @@ -0,0 +1,3 @@ +plugins { + id("org.jetbrains.kotlin.multiplatform") apply false +} diff --git a/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform-empty/build.gradle.kts b/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/lib-a/build.gradle.kts similarity index 75% rename from kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform-empty/build.gradle.kts rename to kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/lib-a/build.gradle.kts index 54627c1..11a4dc2 100644 --- a/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform-empty/build.gradle.kts +++ b/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/lib-a/build.gradle.kts @@ -4,8 +4,10 @@ plugins { } kotlin { + jvm() linuxArm64() - linuxX64() + macosArm64() + mingwX64() } kopy { diff --git a/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/lib-a/src/main/kotlin/A.kt b/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/lib-a/src/main/kotlin/A.kt new file mode 100644 index 0000000..3fba6dd --- /dev/null +++ b/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/lib-a/src/main/kotlin/A.kt @@ -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) diff --git a/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/lib-b/build.gradle.kts b/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/lib-b/build.gradle.kts new file mode 100644 index 0000000..d135e4e --- /dev/null +++ b/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/lib-b/build.gradle.kts @@ -0,0 +1,23 @@ +plugins { + id("com.javiersc.kotlin.kopy") + id("org.jetbrains.kotlin.multiplatform") +} + +kotlin { + jvm() + linuxArm64() + macosArm64() + mingwX64() + + sourceSets { + commonMain { + dependencies { + implementation(project(":lib-a")) + } + } + } +} + +kopy { + +} diff --git a/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/lib-b/src/main/kotlin/B.kt b/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/lib-b/src/main/kotlin/B.kt new file mode 100644 index 0000000..9972914 --- /dev/null +++ b/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/lib-b/src/main/kotlin/B.kt @@ -0,0 +1,21 @@ +package com.javiersc.kotlin.kopy.functional.test.lib.b + +import com.javiersc.kotlin.kopy.functional.test.lib.a.House +import com.javiersc.kotlin.kopy.functional.test.lib.a.Kitchen +import com.javiersc.kotlin.kopy.Kopy + +fun b() { + val street = Street( + house = House( + squareMeters = 53, + kitchen = Kitchen( + squareMeters = 10, + ), + ), + ) + street.copy { + house.kitchen.squareMeters = 77 + } +} + +@Kopy data class Street(val house: House) diff --git a/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform-empty/settings.gradle.kts b/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/settings.gradle.kts similarity index 93% rename from kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform-empty/settings.gradle.kts rename to kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/settings.gradle.kts index f23f154..0218724 100644 --- a/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform-empty/settings.gradle.kts +++ b/kopy-gradle-plugin/testFunctional/resources/kotlin-multiplatform/settings.gradle.kts @@ -24,3 +24,8 @@ dependencyResolutionManagement { } } } + +include( + ":lib-a", + // ":lib-b", +)