From 3dd279c4b79b507f9abf04a5e9e2106c98dcb75b Mon Sep 17 00:00:00 2001 From: Ilya Evtushenko Date: Tue, 18 Nov 2025 16:15:37 +0100 Subject: [PATCH 1/5] First migration step: extract androidApp, replace androidApplication with androidLibrary, keeping AGP 8.13 --- androidApp/build.gradle.kts | 43 ++++++++++++++++++ .../src/main}/AndroidManifest.xml | 0 .../project/demo/composedemo/MainActivity.kt | 0 .../drawable-v24/ic_launcher_foreground.xml | 0 .../res/drawable/ic_launcher_background.xml | 0 .../res/mipmap-anydpi-v26/ic_launcher.xml | 0 .../mipmap-anydpi-v26/ic_launcher_round.xml | 0 .../src/main}/res/mipmap-hdpi/ic_launcher.png | Bin .../res/mipmap-hdpi/ic_launcher_round.png | Bin .../src/main}/res/mipmap-mdpi/ic_launcher.png | Bin .../res/mipmap-mdpi/ic_launcher_round.png | Bin .../main}/res/mipmap-xhdpi/ic_launcher.png | Bin .../res/mipmap-xhdpi/ic_launcher_round.png | Bin .../main}/res/mipmap-xxhdpi/ic_launcher.png | Bin .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin .../main}/res/mipmap-xxxhdpi/ic_launcher.png | Bin .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin .../src/main}/res/values/strings.xml | 0 build.gradle.kts | 1 + composeApp/build.gradle.kts | 6 +-- gradle/libs.versions.toml | 5 +- gradle/wrapper/gradle-wrapper.properties | 3 +- settings.gradle.kts | 3 +- 23 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 androidApp/build.gradle.kts rename {composeApp/src/androidMain => androidApp/src/main}/AndroidManifest.xml (100%) rename {composeApp/src/androidMain => androidApp/src/main}/kotlin/compose/project/demo/composedemo/MainActivity.kt (100%) rename {composeApp/src/androidMain => androidApp/src/main}/res/drawable-v24/ic_launcher_foreground.xml (100%) rename {composeApp/src/androidMain => androidApp/src/main}/res/drawable/ic_launcher_background.xml (100%) rename {composeApp/src/androidMain => androidApp/src/main}/res/mipmap-anydpi-v26/ic_launcher.xml (100%) rename {composeApp/src/androidMain => androidApp/src/main}/res/mipmap-anydpi-v26/ic_launcher_round.xml (100%) rename {composeApp/src/androidMain => androidApp/src/main}/res/mipmap-hdpi/ic_launcher.png (100%) rename {composeApp/src/androidMain => androidApp/src/main}/res/mipmap-hdpi/ic_launcher_round.png (100%) rename {composeApp/src/androidMain => androidApp/src/main}/res/mipmap-mdpi/ic_launcher.png (100%) rename {composeApp/src/androidMain => androidApp/src/main}/res/mipmap-mdpi/ic_launcher_round.png (100%) rename {composeApp/src/androidMain => androidApp/src/main}/res/mipmap-xhdpi/ic_launcher.png (100%) rename {composeApp/src/androidMain => androidApp/src/main}/res/mipmap-xhdpi/ic_launcher_round.png (100%) rename {composeApp/src/androidMain => androidApp/src/main}/res/mipmap-xxhdpi/ic_launcher.png (100%) rename {composeApp/src/androidMain => androidApp/src/main}/res/mipmap-xxhdpi/ic_launcher_round.png (100%) rename {composeApp/src/androidMain => androidApp/src/main}/res/mipmap-xxxhdpi/ic_launcher.png (100%) rename {composeApp/src/androidMain => androidApp/src/main}/res/mipmap-xxxhdpi/ic_launcher_round.png (100%) rename {composeApp/src/androidMain => androidApp/src/main}/res/values/strings.xml (100%) diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts new file mode 100644 index 0000000..4dd1c72 --- /dev/null +++ b/androidApp/build.gradle.kts @@ -0,0 +1,43 @@ +plugins { + alias(libs.plugins.kotlinAndroid) + alias(libs.plugins.androidApplication) + alias(libs.plugins.composeMultiplatform) + alias(libs.plugins.composeCompiler) +} + +kotlin { + dependencies { + implementation(projects.composeApp) + + implementation(libs.androidx.activity.compose) + + implementation(compose.components.uiToolingPreview) + } +} + +android { + namespace = "compose.project.demo.composedemo" + compileSdk = libs.versions.android.compileSdk.get().toInt() + + defaultConfig { + applicationId = "compose.project.demo.composedemo" + minSdk = libs.versions.android.minSdk.get().toInt() + targetSdk = libs.versions.android.targetSdk.get().toInt() + versionCode = 1 + versionName = "1.0" + } + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } + buildTypes { + getByName("release") { + isMinifyEnabled = false + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } +} diff --git a/composeApp/src/androidMain/AndroidManifest.xml b/androidApp/src/main/AndroidManifest.xml similarity index 100% rename from composeApp/src/androidMain/AndroidManifest.xml rename to androidApp/src/main/AndroidManifest.xml diff --git a/composeApp/src/androidMain/kotlin/compose/project/demo/composedemo/MainActivity.kt b/androidApp/src/main/kotlin/compose/project/demo/composedemo/MainActivity.kt similarity index 100% rename from composeApp/src/androidMain/kotlin/compose/project/demo/composedemo/MainActivity.kt rename to androidApp/src/main/kotlin/compose/project/demo/composedemo/MainActivity.kt diff --git a/composeApp/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml b/androidApp/src/main/res/drawable-v24/ic_launcher_foreground.xml similarity index 100% rename from composeApp/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml rename to androidApp/src/main/res/drawable-v24/ic_launcher_foreground.xml diff --git a/composeApp/src/androidMain/res/drawable/ic_launcher_background.xml b/androidApp/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from composeApp/src/androidMain/res/drawable/ic_launcher_background.xml rename to androidApp/src/main/res/drawable/ic_launcher_background.xml diff --git a/composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml b/androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml rename to androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml b/androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png b/androidApp/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png rename to androidApp/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png b/androidApp/src/main/res/mipmap-hdpi/ic_launcher_round.png similarity index 100% rename from composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png rename to androidApp/src/main/res/mipmap-hdpi/ic_launcher_round.png diff --git a/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png b/androidApp/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png rename to androidApp/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png b/androidApp/src/main/res/mipmap-mdpi/ic_launcher_round.png similarity index 100% rename from composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png rename to androidApp/src/main/res/mipmap-mdpi/ic_launcher_round.png diff --git a/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.png b/androidApp/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.png rename to androidApp/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png b/androidApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png similarity index 100% rename from composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png rename to androidApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png b/androidApp/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png rename to androidApp/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png b/androidApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png similarity index 100% rename from composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png rename to androidApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png b/androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png rename to androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png b/androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png similarity index 100% rename from composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png rename to androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/composeApp/src/androidMain/res/values/strings.xml b/androidApp/src/main/res/values/strings.xml similarity index 100% rename from composeApp/src/androidMain/res/values/strings.xml rename to androidApp/src/main/res/values/strings.xml diff --git a/build.gradle.kts b/build.gradle.kts index 98ddb8c..cbc77ac 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,4 +7,5 @@ plugins { alias(libs.plugins.composeMultiplatform) apply false alias(libs.plugins.composeCompiler) apply false alias(libs.plugins.kotlinMultiplatform) apply false + alias(libs.plugins.kotlinAndroid) apply false } \ No newline at end of file diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index 775ab1e..b4ab6a7 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -6,7 +6,7 @@ import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig plugins { alias(libs.plugins.kotlinMultiplatform) - alias(libs.plugins.androidApplication) + alias(libs.plugins.androidLibrary) alias(libs.plugins.composeMultiplatform) alias(libs.plugins.composeCompiler) alias(libs.plugins.composeHotReload) @@ -82,11 +82,7 @@ android { compileSdk = libs.versions.android.compileSdk.get().toInt() defaultConfig { - applicationId = "compose.project.demo.composedemo" minSdk = libs.versions.android.minSdk.get().toInt() - targetSdk = libs.versions.android.targetSdk.get().toInt() - versionCode = 1 - versionName = "1.0" } packaging { resources { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 703c4f3..762a7e0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -agp = "8.11.2" +agp = "8.13.1" android-compileSdk = "36" android-minSdk = "24" android-targetSdk = "36" @@ -34,4 +34,5 @@ androidLibrary = { id = "com.android.library", version.ref = "agp" } composeHotReload = { id = "org.jetbrains.compose.hot-reload", version.ref = "composeHotReload" } composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "composeMultiplatform" } composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } -kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } \ No newline at end of file +kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } +kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d4081da..dbdf1eb 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ +#Tue Nov 18 15:51:55 CET 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle.kts b/settings.gradle.kts index c1978f2..f86d212 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -32,4 +32,5 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" } -include(":composeApp") \ No newline at end of file +include(":composeApp") +include(":androidApp") \ No newline at end of file From f7924d38d88df8852fe1f634d4190caf45aa21b4 Mon Sep 17 00:00:00 2001 From: Ilya Evtushenko Date: Tue, 18 Nov 2025 16:40:06 +0100 Subject: [PATCH 2/5] Second migration step: replace androidLibrary with androidMultiplatformLibrary, bump AGP to 9.0, remove kotlinAndroid plugin (use built-in Kotlin) Fix target jvm compatibility --- androidApp/build.gradle.kts | 13 +++++++++--- build.gradle.kts | 3 +-- composeApp/build.gradle.kts | 41 +++++++++++++------------------------ gradle/libs.versions.toml | 8 ++++---- 4 files changed, 29 insertions(+), 36 deletions(-) diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index 4dd1c72..e923e36 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -1,11 +1,18 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + plugins { - alias(libs.plugins.kotlinAndroid) alias(libs.plugins.androidApplication) alias(libs.plugins.composeMultiplatform) alias(libs.plugins.composeCompiler) } kotlin { + target { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_11) + } + } + dependencies { implementation(projects.composeApp) @@ -37,7 +44,7 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 } } diff --git a/build.gradle.kts b/build.gradle.kts index cbc77ac..0e6df4c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,10 +2,9 @@ plugins { // this is necessary to avoid the plugins to be loaded multiple times // in each subproject's classloader alias(libs.plugins.androidApplication) apply false - alias(libs.plugins.androidLibrary) apply false + alias(libs.plugins.androidMultiplatformLibrary) apply false alias(libs.plugins.composeHotReload) apply false alias(libs.plugins.composeMultiplatform) apply false alias(libs.plugins.composeCompiler) apply false alias(libs.plugins.kotlinMultiplatform) apply false - alias(libs.plugins.kotlinAndroid) apply false } \ No newline at end of file diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index b4ab6a7..a96a9da 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -6,16 +6,26 @@ import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig plugins { alias(libs.plugins.kotlinMultiplatform) - alias(libs.plugins.androidLibrary) + alias(libs.plugins.androidMultiplatformLibrary) alias(libs.plugins.composeMultiplatform) alias(libs.plugins.composeCompiler) alias(libs.plugins.composeHotReload) } kotlin { - androidTarget { + androidLibrary { + namespace = "org.example.project.composeApp" + compileSdk = libs.versions.android.compileSdk.get().toInt() + minSdk = libs.versions.android.minSdk.get().toInt() + compilerOptions { - jvmTarget.set(JvmTarget.JVM_11) + jvmTarget = JvmTarget.JVM_11 + } + androidResources { + enable = true + } + withHostTest { + isIncludeAndroidResources = true } } @@ -77,31 +87,8 @@ kotlin { } } -android { - namespace = "compose.project.demo.composedemo" - compileSdk = libs.versions.android.compileSdk.get().toInt() - - defaultConfig { - minSdk = libs.versions.android.minSdk.get().toInt() - } - packaging { - resources { - excludes += "/META-INF/{AL2.0,LGPL2.1}" - } - } - buildTypes { - getByName("release") { - isMinifyEnabled = false - } - } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } -} - dependencies { - debugImplementation(compose.uiTooling) + "androidRuntimeClasspath"(libs.androidx.compose.ui.tooling) } compose.desktop { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 762a7e0..02e00c6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -agp = "8.13.1" +agp = "9.0.0-beta03" android-compileSdk = "36" android-minSdk = "24" android-targetSdk = "36" @@ -26,13 +26,13 @@ androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "a androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" } androidx-lifecycle-viewmodelCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" } androidx-lifecycle-runtimeCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle" } +androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "composeMultiplatform" } kotlinx-coroutinesSwing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" } [plugins] androidApplication = { id = "com.android.application", version.ref = "agp" } -androidLibrary = { id = "com.android.library", version.ref = "agp" } +androidMultiplatformLibrary = { id = "com.android.kotlin.multiplatform.library", version.ref = "agp" } composeHotReload = { id = "org.jetbrains.compose.hot-reload", version.ref = "composeHotReload" } composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "composeMultiplatform" } composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } -kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } -kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } \ No newline at end of file +kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } \ No newline at end of file From 72fe948e6fedbcd38be07bef32080ddaed0afa40 Mon Sep 17 00:00:00 2001 From: Ilya Evtushenko Date: Fri, 19 Sep 2025 21:19:59 +0200 Subject: [PATCH 3/5] Third migration step: extract remaining app entry points --- androidApp/build.gradle.kts | 4 +- build.gradle.kts | 1 + desktopApp/build.gradle.kts | 29 +++++++++++ .../compose/project/demo/composedemo/main.kt | 0 gradle/libs.versions.toml | 3 +- gradle/wrapper/gradle-wrapper.properties | 1 - iosApp/iosApp.xcodeproj/project.pbxproj | 10 ++-- iosApp/iosApp/Info.plist | 8 +-- settings.gradle.kts | 5 +- {composeApp => shared}/build.gradle.kts | 28 ---------- .../drawable/compose-multiplatform.xml | 0 .../composeResources/drawable/eg.png | Bin .../composeResources/drawable/fr.png | Bin .../composeResources/drawable/id.png | Bin .../composeResources/drawable/jp.png | Bin .../composeResources/drawable/mx.png | Bin .../src/commonMain/kotlin}/App.kt | 48 ++++-------------- shared/src/commonMain/kotlin/Time.kt | 17 +++++++ .../demo/composedemo/MainViewController.kt | 0 webApp/build.gradle.kts | 30 +++++++++++ .../compose/project/demo/composedemo/main.kt | 0 .../src/webMain/resources/index.html | 2 +- .../src/webMain/resources/styles.css | 0 23 files changed, 107 insertions(+), 79 deletions(-) create mode 100644 desktopApp/build.gradle.kts rename {composeApp/src/jvmMain => desktopApp/src/main}/kotlin/compose/project/demo/composedemo/main.kt (100%) rename {composeApp => shared}/build.gradle.kts (66%) rename {composeApp => shared}/src/commonMain/composeResources/drawable/compose-multiplatform.xml (100%) rename {composeApp => shared}/src/commonMain/composeResources/drawable/eg.png (100%) rename {composeApp => shared}/src/commonMain/composeResources/drawable/fr.png (100%) rename {composeApp => shared}/src/commonMain/composeResources/drawable/id.png (100%) rename {composeApp => shared}/src/commonMain/composeResources/drawable/jp.png (100%) rename {composeApp => shared}/src/commonMain/composeResources/drawable/mx.png (100%) rename {composeApp/src/commonMain/kotlin/compose/project/demo/composedemo => shared/src/commonMain/kotlin}/App.kt (64%) create mode 100644 shared/src/commonMain/kotlin/Time.kt rename {composeApp => shared}/src/iosMain/kotlin/compose/project/demo/composedemo/MainViewController.kt (100%) create mode 100644 webApp/build.gradle.kts rename {composeApp => webApp}/src/webMain/kotlin/compose/project/demo/composedemo/main.kt (100%) rename {composeApp => webApp}/src/webMain/resources/index.html (78%) rename {composeApp => webApp}/src/webMain/resources/styles.css (100%) diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index e923e36..c41a555 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -14,11 +14,11 @@ kotlin { } dependencies { - implementation(projects.composeApp) + implementation(projects.shared) implementation(libs.androidx.activity.compose) - implementation(compose.components.uiToolingPreview) + debugImplementation(compose.components.uiToolingPreview) } } diff --git a/build.gradle.kts b/build.gradle.kts index 0e6df4c..6bf6b46 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,4 +7,5 @@ plugins { alias(libs.plugins.composeMultiplatform) apply false alias(libs.plugins.composeCompiler) apply false alias(libs.plugins.kotlinMultiplatform) apply false + alias(libs.plugins.kotlinJvm) apply false } \ No newline at end of file diff --git a/desktopApp/build.gradle.kts b/desktopApp/build.gradle.kts new file mode 100644 index 0000000..d516119 --- /dev/null +++ b/desktopApp/build.gradle.kts @@ -0,0 +1,29 @@ +import org.jetbrains.compose.desktop.application.dsl.TargetFormat + +plugins { + alias(libs.plugins.kotlinJvm) + alias(libs.plugins.composeMultiplatform) + alias(libs.plugins.composeCompiler) + alias(libs.plugins.composeHotReload) +} + +kotlin { + dependencies { + implementation(projects.shared) + + implementation(compose.desktop.currentOs) + implementation(libs.kotlinx.coroutinesSwing) + } +} + +compose.desktop { + application { + mainClass = "compose.project.demo.composedemo.MainKt" + + nativeDistributions { + targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) + packageName = "compose.project.demo.composedemo" + packageVersion = "1.0.0" + } + } +} diff --git a/composeApp/src/jvmMain/kotlin/compose/project/demo/composedemo/main.kt b/desktopApp/src/main/kotlin/compose/project/demo/composedemo/main.kt similarity index 100% rename from composeApp/src/jvmMain/kotlin/compose/project/demo/composedemo/main.kt rename to desktopApp/src/main/kotlin/compose/project/demo/composedemo/main.kt diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 02e00c6..e3e58b9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -35,4 +35,5 @@ androidMultiplatformLibrary = { id = "com.android.kotlin.multiplatform.library", composeHotReload = { id = "org.jetbrains.compose.hot-reload", version.ref = "composeHotReload" } composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "composeMultiplatform" } composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } -kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } \ No newline at end of file +kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } +kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index dbdf1eb..2e11132 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,4 +1,3 @@ -#Tue Nov 18 15:51:55 CET 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip diff --git a/iosApp/iosApp.xcodeproj/project.pbxproj b/iosApp/iosApp.xcodeproj/project.pbxproj index 39b5fe8..2af8a4c 100644 --- a/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/iosApp/iosApp.xcodeproj/project.pbxproj @@ -152,7 +152,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "if [ \"YES\" = \"$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED\" ]; then\n echo \"Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \\\"YES\\\"\"\n exit 0\nfi\ncd \"$SRCROOT/..\"\n./gradlew :composeApp:embedAndSignAppleFrameworkForXcode\n"; + shellScript = "if [ \"YES\" = \"$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED\" ]; then\n echo \"Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \\\"YES\\\"\"\n exit 0\nfi\ncd \"$SRCROOT/..\"\n./gradlew :shared:embedAndSignAppleFrameworkForXcode\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -296,7 +296,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; - DEVELOPMENT_TEAM = "${TEAM_ID}"; + DEVELOPMENT_TEAM = 62N94DGQ7K; ENABLE_PREVIEWS = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -313,6 +313,7 @@ "$(inherited)", "@executable_path/Frameworks", ); + PRODUCT_BUNDLE_IDENTIFIER = compose.project.demo.composedemo2; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -329,7 +330,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; - DEVELOPMENT_TEAM = "${TEAM_ID}"; + DEVELOPMENT_TEAM = 62N94DGQ7K; ENABLE_PREVIEWS = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -346,6 +347,7 @@ "$(inherited)", "@executable_path/Frameworks", ); + PRODUCT_BUNDLE_IDENTIFIER = compose.project.demo.composedemo2; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -376,4 +378,4 @@ /* End XCConfigurationList section */ }; rootObject = B9DA97A92DC1472C00A4DA20 /* Project object */; -} \ No newline at end of file +} diff --git a/iosApp/iosApp/Info.plist b/iosApp/iosApp/Info.plist index 99d16fa..11845e1 100644 --- a/iosApp/iosApp/Info.plist +++ b/iosApp/iosApp/Info.plist @@ -1,8 +1,8 @@ - - CADisableMinimumFrameDurationOnPhone - - + + CADisableMinimumFrameDurationOnPhone + + diff --git a/settings.gradle.kts b/settings.gradle.kts index f86d212..69f0e2c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -32,5 +32,8 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" } -include(":composeApp") +include(":shared") +include(":desktopApp") +include(":androidApp") +include(":webApp") include(":androidApp") \ No newline at end of file diff --git a/composeApp/build.gradle.kts b/shared/build.gradle.kts similarity index 66% rename from composeApp/build.gradle.kts rename to shared/build.gradle.kts index a96a9da..1ce2ff8 100644 --- a/composeApp/build.gradle.kts +++ b/shared/build.gradle.kts @@ -1,8 +1,5 @@ -import org.jetbrains.compose.desktop.application.dsl.TargetFormat -import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.dsl.JvmTarget -import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig plugins { alias(libs.plugins.kotlinMultiplatform) @@ -43,13 +40,11 @@ kotlin { js { browser() - binaries.executable() } @OptIn(ExperimentalWasmDsl::class) wasmJs { browser() - binaries.executable() } sourceSets { @@ -59,10 +54,6 @@ kotlin { } } - androidMain.dependencies { - implementation(compose.preview) - implementation(libs.androidx.activity.compose) - } commonMain.dependencies { implementation(compose.runtime) implementation(compose.foundation) @@ -77,28 +68,9 @@ kotlin { commonTest.dependencies { implementation(libs.kotlin.test) } - jvmMain.dependencies { - implementation(compose.desktop.currentOs) - implementation(libs.kotlinx.coroutinesSwing) - } - webMain.dependencies { - implementation(npm("@js-joda/timezone", "2.22.0")) - } } } dependencies { "androidRuntimeClasspath"(libs.androidx.compose.ui.tooling) } - -compose.desktop { - application { - mainClass = "compose.project.demo.composedemo.MainKt" - - nativeDistributions { - targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) - packageName = "compose.project.demo.composedemo" - packageVersion = "1.0.0" - } - } -} diff --git a/composeApp/src/commonMain/composeResources/drawable/compose-multiplatform.xml b/shared/src/commonMain/composeResources/drawable/compose-multiplatform.xml similarity index 100% rename from composeApp/src/commonMain/composeResources/drawable/compose-multiplatform.xml rename to shared/src/commonMain/composeResources/drawable/compose-multiplatform.xml diff --git a/composeApp/src/commonMain/composeResources/drawable/eg.png b/shared/src/commonMain/composeResources/drawable/eg.png similarity index 100% rename from composeApp/src/commonMain/composeResources/drawable/eg.png rename to shared/src/commonMain/composeResources/drawable/eg.png diff --git a/composeApp/src/commonMain/composeResources/drawable/fr.png b/shared/src/commonMain/composeResources/drawable/fr.png similarity index 100% rename from composeApp/src/commonMain/composeResources/drawable/fr.png rename to shared/src/commonMain/composeResources/drawable/fr.png diff --git a/composeApp/src/commonMain/composeResources/drawable/id.png b/shared/src/commonMain/composeResources/drawable/id.png similarity index 100% rename from composeApp/src/commonMain/composeResources/drawable/id.png rename to shared/src/commonMain/composeResources/drawable/id.png diff --git a/composeApp/src/commonMain/composeResources/drawable/jp.png b/shared/src/commonMain/composeResources/drawable/jp.png similarity index 100% rename from composeApp/src/commonMain/composeResources/drawable/jp.png rename to shared/src/commonMain/composeResources/drawable/jp.png diff --git a/composeApp/src/commonMain/composeResources/drawable/mx.png b/shared/src/commonMain/composeResources/drawable/mx.png similarity index 100% rename from composeApp/src/commonMain/composeResources/drawable/mx.png rename to shared/src/commonMain/composeResources/drawable/mx.png diff --git a/composeApp/src/commonMain/kotlin/compose/project/demo/composedemo/App.kt b/shared/src/commonMain/kotlin/App.kt similarity index 64% rename from composeApp/src/commonMain/kotlin/compose/project/demo/composedemo/App.kt rename to shared/src/commonMain/kotlin/App.kt index 111eb3d..f00f484 100644 --- a/composeApp/src/commonMain/kotlin/compose/project/demo/composedemo/App.kt +++ b/shared/src/commonMain/kotlin/App.kt @@ -1,54 +1,28 @@ package compose.project.demo.composedemo import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.safeContentPadding -import androidx.compose.foundation.layout.size -import androidx.compose.material3.Button -import androidx.compose.material3.DropdownMenu -import androidx.compose.material3.DropdownMenuItem -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue +import androidx.compose.foundation.layout.* +import androidx.compose.material3.* +import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import composedemo.composeapp.generated.resources.Res -import composedemo.composeapp.generated.resources.eg -import composedemo.composeapp.generated.resources.fr -import composedemo.composeapp.generated.resources.id -import composedemo.composeapp.generated.resources.jp -import composedemo.composeapp.generated.resources.mx -import kotlin.time.Clock -import kotlinx.datetime.LocalTime +import composedemo.shared.generated.resources.Res +import composedemo.shared.generated.resources.eg +import composedemo.shared.generated.resources.fr +import composedemo.shared.generated.resources.id +import composedemo.shared.generated.resources.jp +import composedemo.shared.generated.resources.mx import kotlinx.datetime.TimeZone -import kotlinx.datetime.toLocalDateTime import org.jetbrains.compose.resources.DrawableResource import org.jetbrains.compose.resources.painterResource import org.jetbrains.compose.ui.tooling.preview.Preview data class Country(val name: String, val zone: TimeZone, val image: DrawableResource) -fun currentTimeAt(location: String, zone: TimeZone): String { - fun LocalTime.formatted() = "$hour:$minute:$second" - - val time = Clock.System.now() - val localTime = time.toLocalDateTime(zone).time - - return "The time in $location is ${localTime.formatted()}" -} - val defaultCountries = listOf( Country("Japan", TimeZone.of("Asia/Tokyo"), Res.drawable.jp), Country("France", TimeZone.of("Europe/Paris"), Res.drawable.fr), @@ -59,7 +33,7 @@ val defaultCountries = listOf( @Composable @Preview -fun App(countries: List = defaultCountries) { +fun App() { MaterialTheme { var showCountries by remember { mutableStateOf(false) } var timeAtLocation by remember { mutableStateOf("No location selected") } @@ -81,7 +55,7 @@ fun App(countries: List = defaultCountries) { expanded = showCountries, onDismissRequest = { showCountries = false } ) { - countries.forEach { (name, zone, image) -> + defaultCountries.forEach { (name, zone, image) -> DropdownMenuItem( text = { Row(verticalAlignment = Alignment.CenterVertically) { diff --git a/shared/src/commonMain/kotlin/Time.kt b/shared/src/commonMain/kotlin/Time.kt new file mode 100644 index 0000000..93a6978 --- /dev/null +++ b/shared/src/commonMain/kotlin/Time.kt @@ -0,0 +1,17 @@ +package compose.project.demo.composedemo + +import kotlinx.datetime.LocalTime +import kotlinx.datetime.TimeZone +import kotlinx.datetime.toLocalDateTime +import kotlin.time.Clock +import kotlin.time.ExperimentalTime + +@OptIn(ExperimentalTime::class) +fun currentTimeAt(location: String, zone: TimeZone): String { + fun LocalTime.formatted() = "$hour:$minute:$second" + + val time = Clock.System.now() + val localTime = time.toLocalDateTime(zone).time + + return "The time in $location is ${localTime.formatted()}" +} \ No newline at end of file diff --git a/composeApp/src/iosMain/kotlin/compose/project/demo/composedemo/MainViewController.kt b/shared/src/iosMain/kotlin/compose/project/demo/composedemo/MainViewController.kt similarity index 100% rename from composeApp/src/iosMain/kotlin/compose/project/demo/composedemo/MainViewController.kt rename to shared/src/iosMain/kotlin/compose/project/demo/composedemo/MainViewController.kt diff --git a/webApp/build.gradle.kts b/webApp/build.gradle.kts new file mode 100644 index 0000000..6f06b30 --- /dev/null +++ b/webApp/build.gradle.kts @@ -0,0 +1,30 @@ +import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl + +plugins { + alias(libs.plugins.kotlinMultiplatform) + alias(libs.plugins.composeMultiplatform) + alias(libs.plugins.composeCompiler) +} + + +kotlin { + js { + browser() + binaries.executable() + } + + @OptIn(ExperimentalWasmDsl::class) + wasmJs { + browser() + binaries.executable() + } + + sourceSets { + commonMain.dependencies { + implementation(projects.shared) + + implementation(compose.ui) + implementation(npm("@js-joda/timezone", "2.22.0")) + } + } +} \ No newline at end of file diff --git a/composeApp/src/webMain/kotlin/compose/project/demo/composedemo/main.kt b/webApp/src/webMain/kotlin/compose/project/demo/composedemo/main.kt similarity index 100% rename from composeApp/src/webMain/kotlin/compose/project/demo/composedemo/main.kt rename to webApp/src/webMain/kotlin/compose/project/demo/composedemo/main.kt diff --git a/composeApp/src/webMain/resources/index.html b/webApp/src/webMain/resources/index.html similarity index 78% rename from composeApp/src/webMain/resources/index.html rename to webApp/src/webMain/resources/index.html index 0efc1d6..0038506 100644 --- a/composeApp/src/webMain/resources/index.html +++ b/webApp/src/webMain/resources/index.html @@ -5,7 +5,7 @@ composedemo - + diff --git a/composeApp/src/webMain/resources/styles.css b/webApp/src/webMain/resources/styles.css similarity index 100% rename from composeApp/src/webMain/resources/styles.css rename to webApp/src/webMain/resources/styles.css From 79a42aeeecf79153077a6ef69689de9dd745ddaf Mon Sep 17 00:00:00 2001 From: Ilya Evtushenko Date: Fri, 21 Nov 2025 13:53:20 +0100 Subject: [PATCH 4/5] Extract compose dependencies to version catalog --- androidApp/build.gradle.kts | 6 +++++- gradle/libs.versions.toml | 13 +++++++++++-- shared/build.gradle.kts | 16 ++++++++-------- shared/src/commonMain/kotlin/App.kt | 2 +- webApp/build.gradle.kts | 2 +- 5 files changed, 26 insertions(+), 13 deletions(-) diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index c41a555..cebc38e 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -18,7 +18,7 @@ kotlin { implementation(libs.androidx.activity.compose) - debugImplementation(compose.components.uiToolingPreview) + debugImplementation(libs.compose.ui.tooling.preview) } } @@ -48,3 +48,7 @@ android { targetCompatibility = JavaVersion.VERSION_11 } } + +dependencies { + debugImplementation(libs.compose.ui.tooling) +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e3e58b9..1935471 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -9,11 +9,13 @@ androidx-core = "1.17.0" androidx-espresso = "3.7.0" androidx-lifecycle = "2.9.6" androidx-testExt = "1.3.0" +compose-material3 = "1.9.0" composeHotReload = "1.0.0" -composeMultiplatform = "1.9.3" +composeMultiplatform = "1.10.0-beta02" junit = "4.13.2" kotlin = "2.2.21" kotlinx-coroutines = "1.10.2" +kotlinx-datetime = "0.7.1" [libraries] kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } @@ -26,8 +28,15 @@ androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "a androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" } androidx-lifecycle-viewmodelCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" } androidx-lifecycle-runtimeCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle" } -androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "composeMultiplatform" } kotlinx-coroutinesSwing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" } +compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "composeMultiplatform" } +compose-ui = { module = "org.jetbrains.compose.ui:ui", version.ref = "composeMultiplatform" } +compose-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "composeMultiplatform" } +compose-material3 = { module = "org.jetbrains.compose.material3:material3", version.ref = "compose-material3" } +compose-resources = { module = "org.jetbrains.compose.components:components-resources", version.ref = "composeMultiplatform" } +compose-ui-tooling = { module = "org.jetbrains.compose.ui:ui-tooling", version.ref = "composeMultiplatform" } +compose-ui-tooling-preview = { module = "org.jetbrains.compose.ui:ui-tooling-preview", version.ref = "composeMultiplatform" } +kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" } [plugins] androidApplication = { id = "com.android.application", version.ref = "agp" } diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 1ce2ff8..7846390 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -55,15 +55,15 @@ kotlin { } commonMain.dependencies { - implementation(compose.runtime) - implementation(compose.foundation) - implementation(compose.material3) - implementation(compose.ui) - implementation(compose.components.resources) - implementation(compose.components.uiToolingPreview) + implementation(libs.compose.runtime) + implementation(libs.compose.foundation) + implementation(libs.compose.material3) + implementation(libs.compose.ui) + implementation(libs.compose.resources) implementation(libs.androidx.lifecycle.viewmodelCompose) implementation(libs.androidx.lifecycle.runtimeCompose) - implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.7.1") + implementation(libs.compose.ui.tooling.preview) + implementation(libs.kotlinx.datetime) } commonTest.dependencies { implementation(libs.kotlin.test) @@ -72,5 +72,5 @@ kotlin { } dependencies { - "androidRuntimeClasspath"(libs.androidx.compose.ui.tooling) + "androidRuntimeClasspath"(libs.compose.ui.tooling) } diff --git a/shared/src/commonMain/kotlin/App.kt b/shared/src/commonMain/kotlin/App.kt index f00f484..ea55507 100644 --- a/shared/src/commonMain/kotlin/App.kt +++ b/shared/src/commonMain/kotlin/App.kt @@ -8,6 +8,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import composedemo.shared.generated.resources.Res @@ -19,7 +20,6 @@ import composedemo.shared.generated.resources.mx import kotlinx.datetime.TimeZone import org.jetbrains.compose.resources.DrawableResource import org.jetbrains.compose.resources.painterResource -import org.jetbrains.compose.ui.tooling.preview.Preview data class Country(val name: String, val zone: TimeZone, val image: DrawableResource) diff --git a/webApp/build.gradle.kts b/webApp/build.gradle.kts index 6f06b30..f50b4e0 100644 --- a/webApp/build.gradle.kts +++ b/webApp/build.gradle.kts @@ -23,7 +23,7 @@ kotlin { commonMain.dependencies { implementation(projects.shared) - implementation(compose.ui) + implementation(libs.compose.ui) implementation(npm("@js-joda/timezone", "2.22.0")) } } From 63281dd1ceea7a701888526ba5f936f2d0a74fd8 Mon Sep 17 00:00:00 2001 From: Ilya Evtushenko Date: Fri, 5 Dec 2025 16:42:59 +0100 Subject: [PATCH 5/5] Use project-level dependencies declaration --- shared/build.gradle.kts | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 7846390..38f69b3 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -1,3 +1,4 @@ +import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.dsl.JvmTarget @@ -47,27 +48,27 @@ kotlin { browser() } + @OptIn(ExperimentalKotlinGradlePluginApi::class) + dependencies { + implementation(libs.compose.runtime) + implementation(libs.compose.foundation) + implementation(libs.compose.material3) + implementation(libs.compose.ui) + implementation(libs.compose.resources) + implementation(libs.androidx.lifecycle.viewmodelCompose) + implementation(libs.androidx.lifecycle.runtimeCompose) + implementation(libs.compose.ui.tooling.preview) + implementation(libs.kotlinx.datetime) + + testImplementation(libs.kotlin.test) + } + sourceSets { all { languageSettings { optIn("kotlin.time.ExperimentalTime") } } - - commonMain.dependencies { - implementation(libs.compose.runtime) - implementation(libs.compose.foundation) - implementation(libs.compose.material3) - implementation(libs.compose.ui) - implementation(libs.compose.resources) - implementation(libs.androidx.lifecycle.viewmodelCompose) - implementation(libs.androidx.lifecycle.runtimeCompose) - implementation(libs.compose.ui.tooling.preview) - implementation(libs.kotlinx.datetime) - } - commonTest.dependencies { - implementation(libs.kotlin.test) - } } }