Skip to content

Commit

Permalink
Update the gradle plugin tests after kotlin 2.1.0 (#5210)
Browse files Browse the repository at this point in the history
  • Loading branch information
eymar authored Jan 22, 2025
1 parent f9c8448 commit 1e1810c
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 178 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,17 @@ import org.jetbrains.compose.test.utils.checks
import org.junit.jupiter.api.Test

class KotlinCompatibilityTest : GradlePluginTestBase() {
@Test
fun testKotlinMpp_1_9_10() = testMpp("1.9.10")

@Test
fun testKotlinJsMpp_1_9_24() = testJsMpp("1.9.24")

// Note: we can't test non-jvm targets with Kotlin older than 2.1.0, because of klib abi version bump in 2.1.0
@Test
fun testKotlinMpp_1_9_20() = testMpp("1.9.20")
fun testKotlinMpp_2_1_0() = testMpp("2.1.0")

@Test
fun testKotlinJsMpp_1_9_20() = testJsMpp("1.9.20")
fun testKotlinJsMpp_2_1_0() = testJsMpp("2.1.0")

private fun testMpp(kotlinVersion: String) = with(
testProject(
"beforeKotlin2/mpp",
"application/mpp",
testEnvironment = defaultTestEnvironment.copy(kotlinVersion = kotlinVersion)
)
) {
Expand All @@ -39,7 +35,7 @@ class KotlinCompatibilityTest : GradlePluginTestBase() {

private fun testJsMpp(kotlinVersion: String) = with(
testProject(
"beforeKotlin2/jsMpp",
"application/jsMpp",
testEnvironment = defaultTestEnvironment.copy(kotlinVersion = kotlinVersion)
)
) {
Expand Down Expand Up @@ -87,15 +83,6 @@ class KotlinCompatibilityTest : GradlePluginTestBase() {
)
).checkCustomComposeCompiler()

@Test
fun testKotlinCheckDisabled() = testProject(
"beforeKotlin2/custom-compiler-args", defaultTestEnvironment.copy(
kotlinVersion = "1.9.21",
composeCompilerPlugin = "dependencies.compiler.forKotlin(\"1.9.20\")",
composeCompilerArgs = "\"suppressKotlinVersionCompatibilityCheck=1.9.21\""
)
).checkCustomComposeCompiler(checkKJS = true)

private fun TestProject.checkCustomComposeCompiler(checkKJS: Boolean = false) {
gradle(":runDistributable").checks {
val actualMainImage = file("main-image.actual.png")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class ResourcesTest : GradlePluginTestBase() {

@Test
fun testMultiModuleResources() {
val environment = defaultTestEnvironment.copy(kotlinVersion = "2.0.0")
val environment = defaultTestEnvironment
with(
testProject("misc/kmpResourcePublication", environment)
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.compose"
id "org.jetbrains.kotlin.plugin.compose"
}

kotlin {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pluginManagement {
plugins {
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
}
repositories {
Expand Down

This file was deleted.

Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 1e1810c

Please sign in to comment.