From e0b7977e12a66c65e929f61f2117168821b7934f Mon Sep 17 00:00:00 2001 From: skydoves Date: Sat, 29 Jun 2024 17:10:58 +0900 Subject: [PATCH] Support wasm and macos --- colorpicker-compose/build.gradle.kts | 38 ++++++++++++++++++++++++---- gradle.properties | 14 +++++++++- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/colorpicker-compose/build.gradle.kts b/colorpicker-compose/build.gradle.kts index 1df5930..5a9be8b 100644 --- a/colorpicker-compose/build.gradle.kts +++ b/colorpicker-compose/build.gradle.kts @@ -28,14 +28,42 @@ mavenPublishing { } kotlin { - applyDefaultHierarchyTemplate() - - androidTarget { - publishLibraryVariants("release") - } + androidTarget { publishLibraryVariants("release") } + jvm("desktop") iosX64() iosArm64() iosSimulatorArm64() + macosX64() + macosArm64() + js(IR) { + browser() + nodejs() + } + @Suppress("OPT_IN_USAGE") + applyHierarchyTemplate { + common { + group("jvm") { + withAndroidTarget() + withJvm() + } + group("skia") { + withJvm() + group("darwin") { + group("apple") { + group("ios") { + withIosX64() + withIosArm64() + withIosSimulatorArm64() + } + group("macos") { + withMacosX64() + withMacosArm64() + } + } + } + } + } + } task("testClasses") diff --git a/gradle.properties b/gradle.properties index cffaea9..866e753 100644 --- a/gradle.properties +++ b/gradle.properties @@ -43,7 +43,19 @@ android.defaults.buildfeatures.shaders=false # thereby reducing the size of the R class for that library # https://developer.android.com/studio/releases/gradle-plugin#4.1-nontransitive-r-class android.nonTransitiveRClass=true -android.suppressUnsupportedCompileSdk=34 + +# MPP +kotlin.mpp.enableCInteropCommonization=true +kotlin.mpp.stability.nowarn=true +kotlin.mpp.androidSourceSetLayoutVersion=2 +kotlin.native.binary.memoryModel=experimental +kotlin.native.cacheKind=none + +# Compose +org.jetbrains.compose.experimental.uikit.enabled=true +org.jetbrains.compose.experimental.macos.enabled=true +org.jetbrains.compose.experimental.jscanvas.enabled=true +compose.kotlin.native.manageCacheKind=false # Required to publish to Nexus (see https://github.com/gradle/gradle/issues/11308) systemProp.org.gradle.internal.publish.checksums.insecure=true