1+ import org.jetbrains.compose.ExperimentalComposeLibrary
2+ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
3+ import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree
14import java.util.Properties
25
36plugins {
@@ -20,6 +23,16 @@ kotlin {
2023 iosSimulatorArm64()
2124 androidTarget {
2225 publishLibraryVariants(" release" , " debug" )
26+
27+ @OptIn(ExperimentalKotlinGradlePluginApi ::class )
28+ instrumentedTestVariant {
29+ sourceSetTree.set(KotlinSourceSetTree .test)
30+
31+ dependencies {
32+ implementation(" androidx.compose.ui:ui-test-junit4-android:1.5.4" )
33+ debugImplementation(" androidx.compose.ui:ui-test-manifest:1.5.4" )
34+ }
35+ }
2336 }
2437 jvm {
2538 compilations.all {
@@ -32,13 +45,18 @@ kotlin {
3245 js(IR ) {
3346 browser()
3447 }
48+ wasmJs {
49+ browser()
50+ binaries.executable()
51+ }
3552 sourceSets {
3653 val commonMain by getting {
3754 dependencies {
3855 compileOnly(compose.foundation)
3956 compileOnly(compose.animation)
4057 compileOnly(compose.material)
4158 api(libs.kotlinx.coroutines.core)
59+ implementation(libs.uuid)
4260 }
4361 }
4462 val commonTest by getting {
@@ -48,6 +66,8 @@ kotlin {
4866 implementation(kotlin(" test-common" ))
4967 implementation(kotlin(" test-annotations-common" ))
5068 implementation(libs.kotlinx.coroutines.test)
69+ @OptIn(ExperimentalComposeLibrary ::class )
70+ implementation(compose.uiTest)
5171 // @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
5272 // implementation(compose.uiTestJUnit4)
5373 }
@@ -91,6 +111,7 @@ kotlin {
91111 implementation(kotlin(" test-junit5" ))
92112 implementation(libs.junit.jupiter.api)
93113 runtimeOnly(libs.junit.jupiter.engine)
114+ implementation(compose.desktop.currentOs)
94115 }
95116 }
96117 val jsMain by getting {
@@ -112,15 +133,26 @@ kotlin {
112133 implementation(compose.material)
113134 }
114135 }
136+ val wasmJsMain by getting {
137+ dependencies {
138+ implementation(compose.foundation)
139+ implementation(compose.animation)
140+ implementation(compose.material)
141+ }
142+ }
115143 }
116144}
117-
145+ // adding it here to make sure skiko is unpacked and available in web tests
146+ compose.experimental {
147+ web.application {}
148+ }
118149android {
119150 compileSdk = rootProject.extra.get(" android-compile" ) as Int
120151 buildToolsVersion = rootProject.extra.get(" android-build-tools" ) as String
121152 namespace = " moe.tlaster.precompose"
122153 defaultConfig {
123154 minSdk = rootProject.extra.get(" androidMinSdk" ) as Int
155+ testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
124156 }
125157 compileOptions {
126158 sourceCompatibility = JavaVersion .toVersion(rootProject.extra.get(" jvmTarget" ) as String )
0 commit comments