From a17eeef3790d33aaadf45edd75cacc0d31cb3726 Mon Sep 17 00:00:00 2001 From: Cedrick Cooke Date: Fri, 24 May 2024 13:24:01 -0700 Subject: [PATCH] Support Compose/iOS (#359) --- compose/build.gradle.kts | 21 +++++++++++++++---- .../kotlin/DrawText.kt | 0 .../kotlin/ResourceCache.kt | 0 .../kotlin/SkiaIsPointInPath.kt | 0 4 files changed, 17 insertions(+), 4 deletions(-) rename compose/src/{desktopMain => skiaMain}/kotlin/DrawText.kt (100%) rename compose/src/{desktopMain => skiaMain}/kotlin/ResourceCache.kt (100%) rename compose/src/{desktopMain => skiaMain}/kotlin/SkiaIsPointInPath.kt (100%) diff --git a/compose/build.gradle.kts b/compose/build.gradle.kts index d71dffdc..7ee975b1 100644 --- a/compose/build.gradle.kts +++ b/compose/build.gradle.kts @@ -1,5 +1,3 @@ -import org.jetbrains.compose.compose - plugins { id("com.android.library") kotlin("multiplatform") @@ -15,9 +13,15 @@ kotlin { jvmToolchain(libs.versions.jvm.toolchain.get().toInt()) androidTarget().publishAllLibraryVariants() + iosArm64() + iosSimulatorArm64() + iosX64() jvm("desktop") sourceSets { + + applyDefaultHierarchyTemplate() + commonMain.dependencies { api(projects.kanvas) api(projects.element) @@ -29,8 +33,17 @@ kotlin { commonTest.dependencies { implementation(kotlin("test")) } - getByName("desktopMain").dependencies { - api(compose.preview) + + val skiaMain by creating { + dependsOn(commonMain.get()) + } + + val desktopMain by getting { + dependsOn(skiaMain) + } + + val iosMain by getting { + dependsOn(skiaMain) } } } diff --git a/compose/src/desktopMain/kotlin/DrawText.kt b/compose/src/skiaMain/kotlin/DrawText.kt similarity index 100% rename from compose/src/desktopMain/kotlin/DrawText.kt rename to compose/src/skiaMain/kotlin/DrawText.kt diff --git a/compose/src/desktopMain/kotlin/ResourceCache.kt b/compose/src/skiaMain/kotlin/ResourceCache.kt similarity index 100% rename from compose/src/desktopMain/kotlin/ResourceCache.kt rename to compose/src/skiaMain/kotlin/ResourceCache.kt diff --git a/compose/src/desktopMain/kotlin/SkiaIsPointInPath.kt b/compose/src/skiaMain/kotlin/SkiaIsPointInPath.kt similarity index 100% rename from compose/src/desktopMain/kotlin/SkiaIsPointInPath.kt rename to compose/src/skiaMain/kotlin/SkiaIsPointInPath.kt