Browse Source

Make sure compiler test cases support kotlin 2.0.0-Beta2 (#4051)

Co-authored-by: Oleksandr.Karpovich <oleksandr.karpovich@jetbrains.com>
ok/repr_link_ise_knative_beta2
Oleksandr Karpovich 11 months ago committed by GitHub
parent
commit
84de7a1f41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      compose/integrations/composable-test-cases/buildSrc/build.gradle.kts
  2. 12
      compose/integrations/composable-test-cases/buildSrc/src/main/kotlin/TargetsConfiguration.kt
  3. 2
      compose/integrations/composable-test-cases/gradle.properties

10
compose/integrations/composable-test-cases/buildSrc/build.gradle.kts

@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
repositories { repositories {
mavenCentral() mavenCentral()
gradlePluginPortal() gradlePluginPortal()
@ -17,3 +19,11 @@ java {
dependencies { dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin") implementation("org.jetbrains.kotlin:kotlin-gradle-plugin")
} }
tasks.withType<KotlinCompile<*>>().configureEach {
kotlinOptions {
languageVersion = "1.9"
apiVersion = "1.9"
}
}

12
compose/integrations/composable-test-cases/buildSrc/src/main/kotlin/TargetsConfiguration.kt

@ -1,12 +1,8 @@
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Project import org.gradle.api.Project
import org.gradle.api.artifacts.ProjectDependency import org.gradle.api.artifacts.ProjectDependency
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.kpm.external.ExternalVariantApi
import org.jetbrains.kotlin.gradle.kpm.external.project
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetContainer
import org.jetbrains.kotlin.gradle.plugin.extraProperties import org.jetbrains.kotlin.gradle.plugin.extraProperties
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
@ -24,9 +20,9 @@ val Project.isFailingJsCase: Boolean
get() = this.name.contains("-failingJs-") get() = this.name.contains("-failingJs-")
val Project.isMingwX64Enabled: Boolean val Project.isMingwX64Enabled: Boolean
get() = this.isInIdea get() = false //this.isInIdea
@OptIn(ExternalVariantApi::class, ExperimentalWasmDsl::class) @OptIn(ExperimentalWasmDsl::class)
fun KotlinMultiplatformExtension.configureTargets() { fun KotlinMultiplatformExtension.configureTargets() {
jvm("desktop") jvm("desktop")
configureJsTargets() configureJsTargets()
@ -37,7 +33,7 @@ fun KotlinMultiplatformExtension.configureTargets() {
macosX64() macosX64()
macosArm64() macosArm64()
// We use linux agents on CI. So it doesn't run the tests, but it builds the klib anyway which is time consuming. // We use linux agents on CI. So it doesn't run the tests, but it builds the klib anyway which is time consuming.
if (project.isMingwX64Enabled) mingwX64() // if (project.isMingwX64Enabled) mingwX64()
linuxX64() linuxX64()
} }
@ -48,13 +44,11 @@ fun KotlinMultiplatformExtension.configureJsTargets() {
} }
} }
@OptIn(ExternalVariantApi::class)
fun KotlinDependencyHandler.getLibDependencyForMain(): ProjectDependency { fun KotlinDependencyHandler.getLibDependencyForMain(): ProjectDependency {
if (!project.name.endsWith("-main")) error("Unexpected main module name: ${project.name}") if (!project.name.endsWith("-main")) error("Unexpected main module name: ${project.name}")
return project(":" + project.name.replace("-main", "-lib")) return project(":" + project.name.replace("-main", "-lib"))
} }
@OptIn(ExternalVariantApi::class)
fun KotlinDependencyHandler.getCommonLib(): ProjectDependency { fun KotlinDependencyHandler.getCommonLib(): ProjectDependency {
return project(":common") return project(":common")
} }

2
compose/integrations/composable-test-cases/gradle.properties

@ -9,7 +9,7 @@ kotlinx.coroutines.version=1.8.0-RC
#empty by default - a default version will be used #empty by default - a default version will be used
#compose.kotlinCompilerPluginVersion=23.12.18 #compose.kotlinCompilerPluginVersion=23.12.18
compose.kotlinCompilerPluginVersion=1.5.3 compose.kotlinCompilerPluginVersion=1.5.4
# default|failingJs - see enum class CasesToRun # default|failingJs - see enum class CasesToRun
tests.casesToRun=default tests.casesToRun=default

Loading…
Cancel
Save