From 2cbee3e93e4d83ccd9ac80559a94785b6cbb0a76 Mon Sep 17 00:00:00 2001 From: Jesse Wilson Date: Thu, 17 Oct 2024 09:15:15 -0400 Subject: [PATCH] Test multiplatform native (#29) Co-authored-by: Jesse Wilson --- burst-gradle-plugin/build.gradle.kts | 4 ++++ .../app/cash/burst/gradle/BurstGradlePluginTest.kt | 12 ++++++++++++ .../test/projects/multiplatform/lib/build.gradle.kts | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/burst-gradle-plugin/build.gradle.kts b/burst-gradle-plugin/build.gradle.kts index a1baebb..3e389c0 100644 --- a/burst-gradle-plugin/build.gradle.kts +++ b/burst-gradle-plugin/build.gradle.kts @@ -51,9 +51,13 @@ tasks { systemProperty("burstVersion", project.version) dependsOn(":burst-gradle-plugin:publishAllPublicationsToTestMavenRepository") dependsOn(":burst-kotlin-plugin:publishAllPublicationsToTestMavenRepository") + + // Depend on the host platforms exercised by BurstGradlePluginTest. dependsOn(":burst:publishJsPublicationToTestMavenRepository") dependsOn(":burst:publishJvmPublicationToTestMavenRepository") dependsOn(":burst:publishKotlinMultiplatformPublicationToTestMavenRepository") + dependsOn(":burst:publishLinuxX64PublicationToTestMavenRepository") + dependsOn(":burst:publishMacosArm64PublicationToTestMavenRepository") } } diff --git a/burst-gradle-plugin/src/test/kotlin/app/cash/burst/gradle/BurstGradlePluginTest.kt b/burst-gradle-plugin/src/test/kotlin/app/cash/burst/gradle/BurstGradlePluginTest.kt index f724ed1..fee5eb6 100644 --- a/burst-gradle-plugin/src/test/kotlin/app/cash/burst/gradle/BurstGradlePluginTest.kt +++ b/burst-gradle-plugin/src/test/kotlin/app/cash/burst/gradle/BurstGradlePluginTest.kt @@ -26,6 +26,8 @@ import assertk.assertions.isTrue import java.io.File import org.gradle.testkit.runner.GradleRunner import org.gradle.testkit.runner.TaskOutcome +import org.jetbrains.kotlin.konan.target.HostManager +import org.jetbrains.kotlin.konan.target.presetName import org.junit.Test class BurstGradlePluginTest { @@ -45,6 +47,16 @@ class BurstGradlePluginTest { ) } + @Test + fun multiplatformNative() { + // Like 'linuxX64' or 'macosArm64'. + val platformName = HostManager.host.presetName + multiplatform( + testTaskName = "${platformName}Test", + platformName = platformName, + ) + } + private fun multiplatform( testTaskName: String, platformName: String, diff --git a/burst-gradle-plugin/src/test/projects/multiplatform/lib/build.gradle.kts b/burst-gradle-plugin/src/test/projects/multiplatform/lib/build.gradle.kts index dbbc712..adf36b5 100644 --- a/burst-gradle-plugin/src/test/projects/multiplatform/lib/build.gradle.kts +++ b/burst-gradle-plugin/src/test/projects/multiplatform/lib/build.gradle.kts @@ -9,6 +9,10 @@ kotlin { nodejs() } + // Cover the host platforms where we run Burst tests. + linuxX64() + macosArm64() + sourceSets { commonTest { dependencies {