From 082899152fe04be1ffa9800ab67e8e397ecf240f Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Wed, 21 Aug 2024 00:37:29 +0200 Subject: [PATCH] Improvements try to make it run on Android (still unsuccessful) --- commonUI/build.gradle.kts | 61 ++++++++++++++----- .../drawable/compose-multiplatform.xml | 0 .../composeResources/drawable/lightbulb.xml | 0 .../composeResources/drawable/moon.xml | 0 .../composeResources/drawable/neighbour.xml | 0 .../composeResources/drawable/order.xml | 0 .../composeResources/drawable/sun.xml | 0 .../drawable/window-close.xml | 0 .../drawable/window-maximize.xml | 0 .../drawable/window-minimize.xml | 0 .../kotlin/ch/dissem/yaep/ui/common/App.kt | 0 .../ch/dissem/yaep/ui/common/selector.kt | 0 .../ch/dissem/yaep/ui/common/theme/Color.kt | 0 .../ch/dissem/yaep/ui/common/theme/Theme.kt | 0 .../ch/dissem/yaep/ui/common/theme/Type.kt | 0 .../ch/dissem/yaep/ui/common/theme/emoji.kt | 0 domain/build.gradle.kts | 41 +++++++++++-- .../kotlin/ch/dissem/yaep/domain/Game.kt | 0 .../kotlin/ch/dissem/yaep/domain/GameCell.kt | 0 .../kotlin/ch/dissem/yaep/domain/GameRow.kt | 0 .../kotlin/ch/dissem/yaep/domain/Grid.kt | 0 .../kotlin/ch/dissem/yaep/domain/Item.kt | 0 .../ch/dissem/yaep/domain/ObservableSet.kt | 0 .../yaep/domain/UnsolvablePuzzleException.kt | 0 .../kotlin/ch/dissem/yaep/domain/clues.kt | 0 .../kotlin/ch/dissem/yaep/domain/generator.kt | 0 .../kotlin/ch/dissem/yaep/domain/items.kt | 0 .../kotlin/ch/dissem/yaep/domain/ClueTest.kt | 0 .../kotlin/ch/dissem/yaep/domain/GameTest.kt | 0 .../dissem/yaep/domain/NeighbourClueTest.kt | 0 .../ch/dissem/yaep/domain/OrderClueTest.kt | 0 .../dissem/yaep/domain/SameColumnClueTest.kt | 0 .../ch/dissem/yaep/domain/TripletClueTest.kt | 0 gradle/libs.versions.toml | 2 +- 34 files changed, 84 insertions(+), 20 deletions(-) rename commonUI/src/{main => commonMain}/composeResources/drawable/compose-multiplatform.xml (100%) rename commonUI/src/{main => commonMain}/composeResources/drawable/lightbulb.xml (100%) rename commonUI/src/{main => commonMain}/composeResources/drawable/moon.xml (100%) rename commonUI/src/{main => commonMain}/composeResources/drawable/neighbour.xml (100%) rename commonUI/src/{main => commonMain}/composeResources/drawable/order.xml (100%) rename commonUI/src/{main => commonMain}/composeResources/drawable/sun.xml (100%) rename commonUI/src/{main => commonMain}/composeResources/drawable/window-close.xml (100%) rename commonUI/src/{main => commonMain}/composeResources/drawable/window-maximize.xml (100%) rename commonUI/src/{main => commonMain}/composeResources/drawable/window-minimize.xml (100%) rename commonUI/src/{main => commonMain}/kotlin/ch/dissem/yaep/ui/common/App.kt (100%) rename commonUI/src/{main => commonMain}/kotlin/ch/dissem/yaep/ui/common/selector.kt (100%) rename commonUI/src/{main => commonMain}/kotlin/ch/dissem/yaep/ui/common/theme/Color.kt (100%) rename commonUI/src/{main => commonMain}/kotlin/ch/dissem/yaep/ui/common/theme/Theme.kt (100%) rename commonUI/src/{main => commonMain}/kotlin/ch/dissem/yaep/ui/common/theme/Type.kt (100%) rename commonUI/src/{main => commonMain}/kotlin/ch/dissem/yaep/ui/common/theme/emoji.kt (100%) rename domain/src/{main => commonMain}/kotlin/ch/dissem/yaep/domain/Game.kt (100%) rename domain/src/{main => commonMain}/kotlin/ch/dissem/yaep/domain/GameCell.kt (100%) rename domain/src/{main => commonMain}/kotlin/ch/dissem/yaep/domain/GameRow.kt (100%) rename domain/src/{main => commonMain}/kotlin/ch/dissem/yaep/domain/Grid.kt (100%) rename domain/src/{main => commonMain}/kotlin/ch/dissem/yaep/domain/Item.kt (100%) rename domain/src/{main => commonMain}/kotlin/ch/dissem/yaep/domain/ObservableSet.kt (100%) rename domain/src/{main => commonMain}/kotlin/ch/dissem/yaep/domain/UnsolvablePuzzleException.kt (100%) rename domain/src/{main => commonMain}/kotlin/ch/dissem/yaep/domain/clues.kt (100%) rename domain/src/{main => commonMain}/kotlin/ch/dissem/yaep/domain/generator.kt (100%) rename domain/src/{main => commonMain}/kotlin/ch/dissem/yaep/domain/items.kt (100%) rename domain/src/{test => commonTest}/kotlin/ch/dissem/yaep/domain/ClueTest.kt (100%) rename domain/src/{test => commonTest}/kotlin/ch/dissem/yaep/domain/GameTest.kt (100%) rename domain/src/{test => commonTest}/kotlin/ch/dissem/yaep/domain/NeighbourClueTest.kt (100%) rename domain/src/{test => commonTest}/kotlin/ch/dissem/yaep/domain/OrderClueTest.kt (100%) rename domain/src/{test => commonTest}/kotlin/ch/dissem/yaep/domain/SameColumnClueTest.kt (100%) rename domain/src/{test => commonTest}/kotlin/ch/dissem/yaep/domain/TripletClueTest.kt (100%) diff --git a/commonUI/build.gradle.kts b/commonUI/build.gradle.kts index 09ad0af..89e3f1a 100644 --- a/commonUI/build.gradle.kts +++ b/commonUI/build.gradle.kts @@ -1,26 +1,59 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile + plugins { - alias(libs.plugins.kotlin.jvm) + alias(libs.plugins.android.library) + alias(libs.plugins.kotlin.multiplatform) alias(libs.plugins.compose.compiler) alias(libs.plugins.compose) } kotlin { - jvmToolchain(11) + jvm { + tasks.withType().configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) + } + } + } - dependencies { - api(projects.domain) + androidTarget { + tasks.withType().configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_11) + } + } - implementation(compose.components.resources) - implementation(compose.runtime) - implementation(compose.foundation) - implementation(compose.material3) - implementation(compose.ui) - implementation(compose.components.resources) - implementation(compose.components.uiToolingPreview) + android.apply { + compileSdk = libs.versions.android.compileSdk.get().toInt() + namespace = "ch.dissem.yaep.common.ui" + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + } + } + + sourceSets { + commonMain { + dependencies { + api(projects.domain) + + implementation(compose.components.resources) + implementation(compose.runtime) + implementation(compose.foundation) + implementation(compose.material3) + implementation(compose.ui) + implementation(compose.components.uiToolingPreview) // implementation(libs.compose.ui.text.googlefonts) - - testImplementation(libs.kotlin.test) - testImplementation(libs.atrium) + } + } + val commonTest by getting { + dependencies { + implementation(libs.kotlin.test) + implementation(libs.atrium) + } + } } } diff --git a/commonUI/src/main/composeResources/drawable/compose-multiplatform.xml b/commonUI/src/commonMain/composeResources/drawable/compose-multiplatform.xml similarity index 100% rename from commonUI/src/main/composeResources/drawable/compose-multiplatform.xml rename to commonUI/src/commonMain/composeResources/drawable/compose-multiplatform.xml diff --git a/commonUI/src/main/composeResources/drawable/lightbulb.xml b/commonUI/src/commonMain/composeResources/drawable/lightbulb.xml similarity index 100% rename from commonUI/src/main/composeResources/drawable/lightbulb.xml rename to commonUI/src/commonMain/composeResources/drawable/lightbulb.xml diff --git a/commonUI/src/main/composeResources/drawable/moon.xml b/commonUI/src/commonMain/composeResources/drawable/moon.xml similarity index 100% rename from commonUI/src/main/composeResources/drawable/moon.xml rename to commonUI/src/commonMain/composeResources/drawable/moon.xml diff --git a/commonUI/src/main/composeResources/drawable/neighbour.xml b/commonUI/src/commonMain/composeResources/drawable/neighbour.xml similarity index 100% rename from commonUI/src/main/composeResources/drawable/neighbour.xml rename to commonUI/src/commonMain/composeResources/drawable/neighbour.xml diff --git a/commonUI/src/main/composeResources/drawable/order.xml b/commonUI/src/commonMain/composeResources/drawable/order.xml similarity index 100% rename from commonUI/src/main/composeResources/drawable/order.xml rename to commonUI/src/commonMain/composeResources/drawable/order.xml diff --git a/commonUI/src/main/composeResources/drawable/sun.xml b/commonUI/src/commonMain/composeResources/drawable/sun.xml similarity index 100% rename from commonUI/src/main/composeResources/drawable/sun.xml rename to commonUI/src/commonMain/composeResources/drawable/sun.xml diff --git a/commonUI/src/main/composeResources/drawable/window-close.xml b/commonUI/src/commonMain/composeResources/drawable/window-close.xml similarity index 100% rename from commonUI/src/main/composeResources/drawable/window-close.xml rename to commonUI/src/commonMain/composeResources/drawable/window-close.xml diff --git a/commonUI/src/main/composeResources/drawable/window-maximize.xml b/commonUI/src/commonMain/composeResources/drawable/window-maximize.xml similarity index 100% rename from commonUI/src/main/composeResources/drawable/window-maximize.xml rename to commonUI/src/commonMain/composeResources/drawable/window-maximize.xml diff --git a/commonUI/src/main/composeResources/drawable/window-minimize.xml b/commonUI/src/commonMain/composeResources/drawable/window-minimize.xml similarity index 100% rename from commonUI/src/main/composeResources/drawable/window-minimize.xml rename to commonUI/src/commonMain/composeResources/drawable/window-minimize.xml diff --git a/commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/App.kt b/commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/App.kt similarity index 100% rename from commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/App.kt rename to commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/App.kt diff --git a/commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/selector.kt b/commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/selector.kt similarity index 100% rename from commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/selector.kt rename to commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/selector.kt diff --git a/commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/theme/Color.kt b/commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/theme/Color.kt similarity index 100% rename from commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/theme/Color.kt rename to commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/theme/Color.kt diff --git a/commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/theme/Theme.kt b/commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/theme/Theme.kt similarity index 100% rename from commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/theme/Theme.kt rename to commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/theme/Theme.kt diff --git a/commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/theme/Type.kt b/commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/theme/Type.kt similarity index 100% rename from commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/theme/Type.kt rename to commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/theme/Type.kt diff --git a/commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/theme/emoji.kt b/commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/theme/emoji.kt similarity index 100% rename from commonUI/src/main/kotlin/ch/dissem/yaep/ui/common/theme/emoji.kt rename to commonUI/src/commonMain/kotlin/ch/dissem/yaep/ui/common/theme/emoji.kt diff --git a/domain/build.gradle.kts b/domain/build.gradle.kts index bfd157f..0174034 100644 --- a/domain/build.gradle.kts +++ b/domain/build.gradle.kts @@ -1,12 +1,43 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile + plugins { - alias(libs.plugins.kotlin.jvm) + alias(libs.plugins.kotlin.multiplatform) + alias(libs.plugins.android.library) } kotlin { - jvmToolchain(11) + jvm{ + tasks.withType().configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) + } + } + } - dependencies { - testImplementation(libs.kotlin.test) - testImplementation(libs.atrium) + androidTarget{ + tasks.withType().configureEach { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_11) + } + } + } + + android.apply { + compileSdk = libs.versions.android.compileSdk.get().toInt() + namespace = "ch.dissem.yaep.domain" + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + } + + sourceSets { + val commonTest by getting { + dependencies { + implementation(libs.kotlin.test) + implementation(libs.atrium) + } + } } } \ No newline at end of file diff --git a/domain/src/main/kotlin/ch/dissem/yaep/domain/Game.kt b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Game.kt similarity index 100% rename from domain/src/main/kotlin/ch/dissem/yaep/domain/Game.kt rename to domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Game.kt diff --git a/domain/src/main/kotlin/ch/dissem/yaep/domain/GameCell.kt b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/GameCell.kt similarity index 100% rename from domain/src/main/kotlin/ch/dissem/yaep/domain/GameCell.kt rename to domain/src/commonMain/kotlin/ch/dissem/yaep/domain/GameCell.kt diff --git a/domain/src/main/kotlin/ch/dissem/yaep/domain/GameRow.kt b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/GameRow.kt similarity index 100% rename from domain/src/main/kotlin/ch/dissem/yaep/domain/GameRow.kt rename to domain/src/commonMain/kotlin/ch/dissem/yaep/domain/GameRow.kt diff --git a/domain/src/main/kotlin/ch/dissem/yaep/domain/Grid.kt b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Grid.kt similarity index 100% rename from domain/src/main/kotlin/ch/dissem/yaep/domain/Grid.kt rename to domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Grid.kt diff --git a/domain/src/main/kotlin/ch/dissem/yaep/domain/Item.kt b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Item.kt similarity index 100% rename from domain/src/main/kotlin/ch/dissem/yaep/domain/Item.kt rename to domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Item.kt diff --git a/domain/src/main/kotlin/ch/dissem/yaep/domain/ObservableSet.kt b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/ObservableSet.kt similarity index 100% rename from domain/src/main/kotlin/ch/dissem/yaep/domain/ObservableSet.kt rename to domain/src/commonMain/kotlin/ch/dissem/yaep/domain/ObservableSet.kt diff --git a/domain/src/main/kotlin/ch/dissem/yaep/domain/UnsolvablePuzzleException.kt b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/UnsolvablePuzzleException.kt similarity index 100% rename from domain/src/main/kotlin/ch/dissem/yaep/domain/UnsolvablePuzzleException.kt rename to domain/src/commonMain/kotlin/ch/dissem/yaep/domain/UnsolvablePuzzleException.kt diff --git a/domain/src/main/kotlin/ch/dissem/yaep/domain/clues.kt b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/clues.kt similarity index 100% rename from domain/src/main/kotlin/ch/dissem/yaep/domain/clues.kt rename to domain/src/commonMain/kotlin/ch/dissem/yaep/domain/clues.kt diff --git a/domain/src/main/kotlin/ch/dissem/yaep/domain/generator.kt b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/generator.kt similarity index 100% rename from domain/src/main/kotlin/ch/dissem/yaep/domain/generator.kt rename to domain/src/commonMain/kotlin/ch/dissem/yaep/domain/generator.kt diff --git a/domain/src/main/kotlin/ch/dissem/yaep/domain/items.kt b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/items.kt similarity index 100% rename from domain/src/main/kotlin/ch/dissem/yaep/domain/items.kt rename to domain/src/commonMain/kotlin/ch/dissem/yaep/domain/items.kt diff --git a/domain/src/test/kotlin/ch/dissem/yaep/domain/ClueTest.kt b/domain/src/commonTest/kotlin/ch/dissem/yaep/domain/ClueTest.kt similarity index 100% rename from domain/src/test/kotlin/ch/dissem/yaep/domain/ClueTest.kt rename to domain/src/commonTest/kotlin/ch/dissem/yaep/domain/ClueTest.kt diff --git a/domain/src/test/kotlin/ch/dissem/yaep/domain/GameTest.kt b/domain/src/commonTest/kotlin/ch/dissem/yaep/domain/GameTest.kt similarity index 100% rename from domain/src/test/kotlin/ch/dissem/yaep/domain/GameTest.kt rename to domain/src/commonTest/kotlin/ch/dissem/yaep/domain/GameTest.kt diff --git a/domain/src/test/kotlin/ch/dissem/yaep/domain/NeighbourClueTest.kt b/domain/src/commonTest/kotlin/ch/dissem/yaep/domain/NeighbourClueTest.kt similarity index 100% rename from domain/src/test/kotlin/ch/dissem/yaep/domain/NeighbourClueTest.kt rename to domain/src/commonTest/kotlin/ch/dissem/yaep/domain/NeighbourClueTest.kt diff --git a/domain/src/test/kotlin/ch/dissem/yaep/domain/OrderClueTest.kt b/domain/src/commonTest/kotlin/ch/dissem/yaep/domain/OrderClueTest.kt similarity index 100% rename from domain/src/test/kotlin/ch/dissem/yaep/domain/OrderClueTest.kt rename to domain/src/commonTest/kotlin/ch/dissem/yaep/domain/OrderClueTest.kt diff --git a/domain/src/test/kotlin/ch/dissem/yaep/domain/SameColumnClueTest.kt b/domain/src/commonTest/kotlin/ch/dissem/yaep/domain/SameColumnClueTest.kt similarity index 100% rename from domain/src/test/kotlin/ch/dissem/yaep/domain/SameColumnClueTest.kt rename to domain/src/commonTest/kotlin/ch/dissem/yaep/domain/SameColumnClueTest.kt diff --git a/domain/src/test/kotlin/ch/dissem/yaep/domain/TripletClueTest.kt b/domain/src/commonTest/kotlin/ch/dissem/yaep/domain/TripletClueTest.kt similarity index 100% rename from domain/src/test/kotlin/ch/dissem/yaep/domain/TripletClueTest.kt rename to domain/src/commonTest/kotlin/ch/dissem/yaep/domain/TripletClueTest.kt diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e5b446b..a2328cf 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -agp = "8.5.1" +agp = "8.5.2" android-compileSdk = "34" android-minSdk = "24" android-targetSdk = "34"