diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index 2d196674..725cf161 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -120,4 +120,10 @@ dependencies { androidTestImplementation("androidx.test:runner:1.5.2") implementation(project(":common")) +} + + +kotlin.sourceSets.all { + languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi") + languageSettings.enableLanguageFeature("ExplicitBackingFields") } \ No newline at end of file diff --git a/common/build.gradle.kts b/common/build.gradle.kts index ee0fac84..9fc3b518 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -42,10 +42,6 @@ kotlin { } sourceSets { - all { - languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi") - } - commonMain.dependencies { implementation(libs.kotlinx.coroutines) implementation(libs.kotlinx.serialization) @@ -96,6 +92,9 @@ tasks.withType().configureEach } kotlin.sourceSets.all { + languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi") languageSettings.optIn("kotlin.experimental.ExperimentalObjCName") + languageSettings.enableLanguageFeature("ExplicitBackingFields") } + diff --git a/common/src/commonMain/kotlin/dev/johnoreilly/common/repository/CityBikesRepository.kt b/common/src/commonMain/kotlin/dev/johnoreilly/common/repository/CityBikesRepository.kt index cce042d7..95221ec4 100644 --- a/common/src/commonMain/kotlin/dev/johnoreilly/common/repository/CityBikesRepository.kt +++ b/common/src/commonMain/kotlin/dev/johnoreilly/common/repository/CityBikesRepository.kt @@ -26,14 +26,16 @@ class NetworkDb: RealmObject { var longitude: Double = 0.0 } + + class CityBikesRepository: KoinComponent { private val cityBikesApi: CityBikesApi by inject() private val realm: Realm by inject() private val mainScope: CoroutineScope = MainScope() - private val _groupedNetworkList = MutableStateFlow>>(emptyMap()) - val groupedNetworkList: StateFlow>> = _groupedNetworkList +val groupedNetworkList: StateFlow>> + field = MutableStateFlow>>(emptyMap()) private val _networkList = MutableStateFlow>(emptyList()) @@ -46,7 +48,7 @@ class CityBikesRepository: KoinComponent { _networkList.value = it.toList().map { Network(it.id, it.name, it.city, it.country, it.latitude, it.longitude) } - _groupedNetworkList.value = + groupedNetworkList.value = _networkList.value.groupBy { it.country } } } diff --git a/compose-desktop/build.gradle.kts b/compose-desktop/build.gradle.kts index 737e01df..5cb50ee7 100644 --- a/compose-desktop/build.gradle.kts +++ b/compose-desktop/build.gradle.kts @@ -14,3 +14,8 @@ dependencies { application { mainClass.set("MainKt") } + +kotlin.sourceSets.all { + languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi") + languageSettings.enableLanguageFeature("ExplicitBackingFields") +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index b29fadd3..66c469c5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,6 +7,7 @@ kotlin.mpp.stability.nowarn=true xcodeproj=./ios/BikeShare +kotlin.jvm.target.validation.mode = IGNORE # https://twitter.com/Sellmair/status/1543938828062392322 import_orphan_source_sets=false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index afce401c..c3e27f47 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ coroutines = "1.8.1" kotlinxSerialization = "1.6.3" kotlinxDateTime = "0.6.0" -androidGradlePlugin = "8.4.1" +androidGradlePlugin = "8.5.0" koin = "3.6.0-Beta4" koin-android-compose = "3.6.0-Beta4" koin-compose-multiplatform = "1.2.0-Beta4"