File tree Expand file tree Collapse file tree 8 files changed +31
-29
lines changed
src/commonMain/kotlin/dev/johnoreilly/common/viewmodel Expand file tree Collapse file tree 8 files changed +31
-29
lines changed Original file line number Diff line number Diff line change 11# BikeShare
22
3- ![ kotlin-version] ( https://img.shields.io/badge/kotlin-2.1.21 -blue?logo=kotlin )
3+ ![ kotlin-version] ( https://img.shields.io/badge/kotlin-2.2.0 -blue?logo=kotlin )
44
55Jetpack Compose and SwiftUI based Kotlin Multiplatform sample project (based on [ CityBikes API] ( http://api.citybik.es/v2/ ) ).
66
Original file line number Diff line number Diff line change 2020# hide the original source file name.
2121#-renamesourcefileattribute SourceFile
2222
23- -keep class dev.johnoreilly.** { *; }
23+ -keep class dev.johnoreilly.** { *; }
24+ -dontwarn okhttp3.internal.Util
Original file line number Diff line number Diff line change @@ -89,13 +89,13 @@ kotlin {
8989 implementation(libs.slf4j)
9090 }
9191 }
92- }
9392
94- kotlin {
95- targets.withType< org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget > {
96- compilations.get(" main" ).kotlinOptions.freeCompilerArgs + = " -Xexport-kdoc"
93+ compilerOptions {
94+ freeCompilerArgs.add(" -Xexport-kdoc" )
9795 }
96+ }
9897
98+ kotlin {
9999 targets.configureEach {
100100 val isAndroidTarget = platformType == KotlinPlatformType .androidJvm
101101 compilations.configureEach {
Original file line number Diff line number Diff line change @@ -4,9 +4,11 @@ import com.rickclephas.kmp.observableviewmodel.ViewModel
44import com.rickclephas.kmp.observableviewmodel.MutableStateFlow
55import com.rickclephas.kmp.observableviewmodel.stateIn
66import com.rickclephas.kmp.nativecoroutines.NativeCoroutinesState
7+ import dev.johnoreilly.common.remote.Station
78import dev.johnoreilly.common.repository.CityBikesRepository
89import kotlinx.coroutines.ExperimentalCoroutinesApi
910import kotlinx.coroutines.flow.SharingStarted
11+ import kotlinx.coroutines.flow.StateFlow
1012import kotlinx.coroutines.flow.filterNotNull
1113import kotlinx.coroutines.flow.flatMapLatest
1214import me.tatarka.inject.annotations.Inject
@@ -21,7 +23,7 @@ open class StationsViewModelShared(cityBikesRepository: CityBikesRepository) : V
2123 private val network = MutableStateFlow <String ?>(viewModelScope, null )
2224
2325 @NativeCoroutinesState
24- val stations = network.filterNotNull().flatMapLatest {
26+ val stations: StateFlow < List < Station >> = network.filterNotNull().flatMapLatest {
2527 cityBikesRepository.pollNetworkUpdates(it)
2628 }.stateIn(viewModelScope, SharingStarted .WhileSubscribed (), emptyList())
2729
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ version = "1.0-SNAPSHOT"
1111kotlin {
1212 @Suppress(" OPT_IN_USAGE" )
1313 wasmJs {
14- moduleName = " bikeshare"
1514 browser {
1615 commonWebpackConfig {
1716 outputFileName = " bikeshare.js"
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ default_platform :android
1717
1818platform :android do
1919
20- versionNum = 8
20+ versionNum = 10
2121
2222 before_all do
2323 end
Original file line number Diff line number Diff line change 11[versions ]
2- kotlin = " 2.1.21 "
3- ksp = " 2.1.21 -2.0.1 "
2+ kotlin = " 2.2.0 "
3+ ksp = " 2.2.0 -2.0.2 "
44
5- androidGradlePlugin = " 8.10.1 "
5+ androidGradlePlugin = " 8.11.0 "
66androidxActivity = " 1.10.1"
7- androidxComposeBom = " 2025.06.00 "
7+ androidxComposeBom = " 2025.06.01 "
88androidxLifecycle = " 2.9.1"
9- androidxNavigationCompose = " 2.9.0 "
10- androidxRoom = " 2.7.1 "
11- circuit = " 0.28.0 "
12- composeLifecyleRuntime =" 2.9.0 "
13- compose-multiplatform = " 1.8.1 "
14- composeAdaptiveLayout = " 1.1.1 "
9+ androidxNavigationCompose = " 2.9.1 "
10+ androidxRoom = " 2.7.2 "
11+ circuit = " 0.29.1 "
12+ composeLifecyleRuntime =" 2.9.1 "
13+ compose-multiplatform = " 1.8.2 "
14+ composeAdaptiveLayout = " 1.1.2 "
1515coroutines = " 1.10.2"
1616junit = " 4.13.2"
17- kmpNativeCoroutines = " 1.0.0-ALPHA-42 "
18- kmpObservableViewModel = " 1.0.0-BETA-7 "
17+ kmpNativeCoroutines = " 1.0.0-ALPHA-45 "
18+ kmpObservableViewModel = " 1.0.0-BETA-12 "
1919kotlin-inject-anvil = " 0.1.6"
2020kotlininject = " 0.8.0"
21- kotlinxSerialization = " 1.8.1 "
22- ktor = " 3.1.2 "
23- okhttp = " 5.0.0-alpha.14 "
21+ kotlinxSerialization = " 1.9.0 "
22+ ktor = " 3.2.1 "
23+ okhttp = " 5.0.0"
2424slf4j = " 2.0.17"
25- slf4jAndroid = " 2.0.7 -0"
26- sqlite = " 2.5.1 "
25+ slf4jAndroid = " 2.0.17 -0"
26+ sqlite = " 2.5.2 "
2727
2828minSdk = " 24"
29- targetSdk = " 35 "
30- compileSdk = " 35 "
29+ targetSdk = " 36 "
30+ compileSdk = " 36 "
3131
3232
3333[libraries ]
Original file line number Diff line number Diff line change 11distributionBase =GRADLE_USER_HOME
22distributionPath =wrapper/dists
3- distributionUrl =https\://services.gradle.org/distributions/gradle-8.11.1 -bin.zip
3+ distributionUrl =https\://services.gradle.org/distributions/gradle-8.13 -bin.zip
44networkTimeout =10000
55validateDistributionUrl =true
66zipStoreBase =GRADLE_USER_HOME
You can’t perform that action at this time.
0 commit comments