Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions compose/integrations/composable-test-cases/README.MD
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
## Run:

`./gradlew build -Pcompose.kotlinCompilerPluginVersion=1.4.2-rc03 -Pkotlin.version=1.8.10`
`./gradlew build -Pkotlin_version=2.1.21`
to build and run the tests,

or
`./gradlew allTests -Pcompose.kotlinCompilerPluginVersion=1.4.2-rc03 -Pkotlin.version=1.8.10`
`./gradlew allTests -Pkotlin_version=2.1.21`
to only run the tests.

It will build and run the tests for all available targets (depends on a host machine).
See [TargetsConfiguration](./buildSrc/src/main/kotlin/TargetsConfiguration.kt) to update the targets.


## Test cases

Expand Down
103 changes: 65 additions & 38 deletions compose/integrations/composable-test-cases/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,60 +1,87 @@
import internal.InternalComposeSupportPlugin
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask

group "com.example"
version "1.0-SNAPSHOT"
//group "com.example"
//version "1.0-SNAPSHOT"

fun Project.disableYarnLockMismatchReport() {
plugins.withType<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin> {
the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension>().apply {
yarnLockMismatchReport = org.jetbrains.kotlin.gradle.targets.js.yarn.YarnLockMismatchReport.NONE
}
}
}

allprojects {
repositories {
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev/") // to test with kotlin dev builds
// mavenLocal()

maven("https://packages.jetbrains.team/maven/p/kt/dev")
maven("https://redirector.kotlinlang.org/maven/dev")
// mavenLocal()
}

// Apply here for all subprojects instead of applying in each build.gradle.kts separately.
// It applies the compiler plugin
this.apply<InternalComposeSupportPlugin>()
disableYarnLockMismatchReport()
}

afterEvaluate {
val pluginOptionPrefix = "plugin:androidx.compose.compiler.plugins.kotlin:"
val project = this
val kotlinVersion = project.properties["kotlin.version"] as? String
plugins {
kotlin("multiplatform").version(libs.versions.kotlin).apply(false)
alias(libs.plugins.compose.compiler).apply(false)
}

project.tasks.withType(KotlinCompile::class.java).configureEach {
kotlinOptions.apply {
freeCompilerArgs +=
listOf(
"-P",
"${pluginOptionPrefix}suppressKotlinVersionCompatibilityCheck=$kotlinVersion"
)
subprojects {
apply(plugin = "org.jetbrains.kotlin.multiplatform")

}
configure<org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension> {
jvm("desktop")
applyDefaultHierarchyTemplate()
js(IR) {
// browser()
nodejs() // Commented to save a bit of CI time. Testing in a browser should be enough.
}

tasks.withType<KotlinJsCompile>().configureEach {
kotlinOptions.freeCompilerArgs += listOf(
"-Xklib-enable-signature-clash-checks=false",
)
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
d8 {}
}

tasks.withType<KotlinCompile<*>>().configureEach {
kotlinOptions.freeCompilerArgs += "-Xpartial-linkage=disable"
}
}
disableYarnLockMismatchReport()
}
iosArm64()
iosSimulatorArm64()
iosX64()
macosX64()
macosArm64()
// 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()
linuxX64()

plugins {
kotlin("multiplatform") apply false
}
sourceSets {
val commonMain by getting {
val projectName = project.name
dependencies {
if (projectName != "common") {
implementation(project(":common"))
}

fun Project.disableYarnLockMismatchReport() {
plugins.withType<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin> {
the<org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension>().apply {
yarnLockMismatchReport = org.jetbrains.kotlin.gradle.targets.js.yarn.YarnLockMismatchReport.NONE
if (projectName.endsWith("-main")) {
implementation(project(":" + projectName.replace("-main", "-lib")))
}
}
}
}

targets
.filter { it.name != "desktop" } // Exclude JVM target
.forEach { target ->
target.compilations.all {
compileTaskProvider.configure{
compilerOptions {
freeCompilerArgs.add("-Xpartial-linkage=disable")
}
}
}
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading