diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8d9d5e7f..54abda12 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,6 +10,7 @@ json = "1.7.1" composeGradle = "1.6.11" # Compose Libraries +parcelize = "0.9.0" voyager = "1.0.0" accompanist = "0.30.1" googleAccompanist = "0.30.1" @@ -163,6 +164,7 @@ korge-foundation = { module = "com.soywiz.korge:korge-foundation", version.ref = # Localization moko-core = { module = "dev.icerock.moko:resources", version.ref = "moko" } moko-compose = { module = "dev.icerock.moko:resources-compose", version.ref = "moko" } +moko-parcelize = { module = "dev.icerock.moko:parcelize", version.ref = "parcelize" } # Optimizer proguard = { module = "com.guardsquare:proguard-gradle", version.ref = "proguard" } diff --git a/i18n/build.gradle.kts b/i18n/build.gradle.kts index 0119080e..d4182b83 100644 --- a/i18n/build.gradle.kts +++ b/i18n/build.gradle.kts @@ -53,6 +53,12 @@ kotlin { implementation(kotlin("test-annotations-common")) } } + + getByName("iosMain") { + dependencies { + implementation(libs.moko.parcelize) + } + } } } diff --git a/ios/build.gradle.kts b/ios/build.gradle.kts index 8ed03a94..35c1afb7 100644 --- a/ios/build.gradle.kts +++ b/ios/build.gradle.kts @@ -134,3 +134,5 @@ dependencies { buildkonfig { packageName = "ca.gosyer.jui.ios.build" } + +tasks.register("kspCommonMainKotlinMetadata") diff --git a/ios/src/uikitArm64Main/kotlin/ca/gosyer/jui/ios/AppComponent.arm64.kt b/ios/src/uikitArm64Main/kotlin/ca/gosyer/jui/ios/AppComponent.arm64.kt new file mode 100644 index 00000000..3febd83a --- /dev/null +++ b/ios/src/uikitArm64Main/kotlin/ca/gosyer/jui/ios/AppComponent.arm64.kt @@ -0,0 +1,13 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +package ca.gosyer.jui.ios + +import ca.gosyer.jui.uicore.vm.ContextWrapper + +actual fun create(context: ContextWrapper): AppComponent { + return AppComponent.create(context) +} diff --git a/ios/src/uikitMain/kotlin/ca/gosyer/jui/ios/AppComponent.kt b/ios/src/uikitMain/kotlin/ca/gosyer/jui/ios/AppComponent.kt index 42186baa..ca8bc29c 100644 --- a/ios/src/uikitMain/kotlin/ca/gosyer/jui/ios/AppComponent.kt +++ b/ios/src/uikitMain/kotlin/ca/gosyer/jui/ios/AppComponent.kt @@ -42,3 +42,5 @@ abstract class AppComponent( .also { appComponentInstance = it } } } + +expect fun create(context: ContextWrapper): AppComponent diff --git a/ios/src/uikitSimulatorArm64Main/kotlin/ca/gosyer/jui/ios/AppComponent.simArm64.kt b/ios/src/uikitSimulatorArm64Main/kotlin/ca/gosyer/jui/ios/AppComponent.simArm64.kt new file mode 100644 index 00000000..3febd83a --- /dev/null +++ b/ios/src/uikitSimulatorArm64Main/kotlin/ca/gosyer/jui/ios/AppComponent.simArm64.kt @@ -0,0 +1,13 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +package ca.gosyer.jui.ios + +import ca.gosyer.jui.uicore.vm.ContextWrapper + +actual fun create(context: ContextWrapper): AppComponent { + return AppComponent.create(context) +} diff --git a/ios/src/uikitX64Main/kotlin/ca/gosyer/jui/ios/AppComponent.x64.kt b/ios/src/uikitX64Main/kotlin/ca/gosyer/jui/ios/AppComponent.x64.kt new file mode 100644 index 00000000..3febd83a --- /dev/null +++ b/ios/src/uikitX64Main/kotlin/ca/gosyer/jui/ios/AppComponent.x64.kt @@ -0,0 +1,13 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ + +package ca.gosyer.jui.ios + +import ca.gosyer.jui.uicore.vm.ContextWrapper + +actual fun create(context: ContextWrapper): AppComponent { + return AppComponent.create(context) +} diff --git a/presentation/src/iosMain/kotlin/ca/gosyer/jui/ui/main/about/licenses/components/IosLicenses.kt b/presentation/src/iosMain/kotlin/ca/gosyer/jui/ui/main/about/licenses/components/IosLicenses.kt index 629a3ed9..2e5efa21 100644 --- a/presentation/src/iosMain/kotlin/ca/gosyer/jui/ui/main/about/licenses/components/IosLicenses.kt +++ b/presentation/src/iosMain/kotlin/ca/gosyer/jui/ui/main/about/licenses/components/IosLicenses.kt @@ -19,7 +19,7 @@ actual fun getLicenses(): Libs? { null, ) { withIOContext { - val json = MR.files.aboutlibraries.readText() + val json = MR.files.aboutlibraries_json.readText() value = Libs.Builder().withJson(json).build() } } diff --git a/presentation/src/iosMain/kotlin/ca/gosyer/jui/ui/util/lang/Collator.kt b/presentation/src/iosMain/kotlin/ca/gosyer/jui/ui/util/lang/Collator.kt index d3f0d32c..1104b563 100644 --- a/presentation/src/iosMain/kotlin/ca/gosyer/jui/ui/util/lang/Collator.kt +++ b/presentation/src/iosMain/kotlin/ca/gosyer/jui/ui/util/lang/Collator.kt @@ -10,7 +10,7 @@ import androidx.compose.ui.text.intl.Locale import platform.Foundation.NSString import platform.Foundation.localizedCaseInsensitiveCompare -actual class CollatorComparator : Comparator { +actual class CollatorComparator() : Comparator { actual constructor(locale: Locale) : this() actual override fun compare(