From 8905ec91cc4e58487ce4facd25894c0eee90818c Mon Sep 17 00:00:00 2001 From: Andrey Kuleshov Date: Fri, 17 Feb 2023 14:30:33 +0100 Subject: [PATCH 1/2] Adding `iosSimulatorArm64` target ### What's done: - iosSimulator target added (will be released in the nearest release) --- ktoml-core/build.gradle.kts | 2 ++ .../com/akuleshov7/ktoml/utils/UtilsSimulator.kt | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 ktoml-core/src/iosSimulatorArm64Main/kotlin/com/akuleshov7/ktoml/utils/UtilsSimulator.kt diff --git a/ktoml-core/build.gradle.kts b/ktoml-core/build.gradle.kts index a96770be..7bd038e5 100644 --- a/ktoml-core/build.gradle.kts +++ b/ktoml-core/build.gradle.kts @@ -28,6 +28,8 @@ kotlin { macosX64() macosArm64() ios() + iosSimulatorArm64() + sourceSets { all { diff --git a/ktoml-core/src/iosSimulatorArm64Main/kotlin/com/akuleshov7/ktoml/utils/UtilsSimulator.kt b/ktoml-core/src/iosSimulatorArm64Main/kotlin/com/akuleshov7/ktoml/utils/UtilsSimulator.kt new file mode 100644 index 00000000..458f07f2 --- /dev/null +++ b/ktoml-core/src/iosSimulatorArm64Main/kotlin/com/akuleshov7/ktoml/utils/UtilsSimulator.kt @@ -0,0 +1,15 @@ +/** + * Specific implementation for utilities + */ + +package com.akuleshov7.ktoml.utils + +@Suppress("MAGIC_NUMBER") +internal actual fun StringBuilder.appendCodePointCompat(codePoint: Int): StringBuilder = when (codePoint) { + in 0 until Char.MIN_SUPPLEMENTARY_CODE_POINT -> append(codePoint.toChar()) + in Char.MIN_SUPPLEMENTARY_CODE_POINT..Char.MAX_CODE_POINT -> { + append(Char.MIN_HIGH_SURROGATE + ((codePoint - 0x10000) shr 10)) + append(Char.MIN_LOW_SURROGATE + (codePoint and 0x3ff)) + } + else -> throw IllegalArgumentException() +} From a05744fdf53a9d5fcb56158ac33720c0682cef1a Mon Sep 17 00:00:00 2001 From: Andrey Kuleshov Date: Fri, 17 Feb 2023 15:10:40 +0100 Subject: [PATCH 2/2] Adding `iosSimulatorArm64` target ### What's done: - iosSimulator target added (will be released in the nearest release) --- ktoml-core/build.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/ktoml-core/build.gradle.kts b/ktoml-core/build.gradle.kts index 7bd038e5..bca8d27b 100644 --- a/ktoml-core/build.gradle.kts +++ b/ktoml-core/build.gradle.kts @@ -30,7 +30,6 @@ kotlin { ios() iosSimulatorArm64() - sourceSets { all { languageSettings.optIn("kotlin.RequiresOptIn")