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 1
1
# BikeShare
2
2
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 )
4
4
5
5
Jetpack Compose and SwiftUI based Kotlin Multiplatform sample project (based on [ CityBikes API] ( http://api.citybik.es/v2/ ) ).
6
6
Original file line number Diff line number Diff line change 20
20
# hide the original source file name.
21
21
#-renamesourcefileattribute SourceFile
22
22
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 {
89
89
implementation(libs.slf4j)
90
90
}
91
91
}
92
- }
93
92
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" )
97
95
}
96
+ }
98
97
98
+ kotlin {
99
99
targets.configureEach {
100
100
val isAndroidTarget = platformType == KotlinPlatformType .androidJvm
101
101
compilations.configureEach {
Original file line number Diff line number Diff line change @@ -4,9 +4,11 @@ import com.rickclephas.kmp.observableviewmodel.ViewModel
4
4
import com.rickclephas.kmp.observableviewmodel.MutableStateFlow
5
5
import com.rickclephas.kmp.observableviewmodel.stateIn
6
6
import com.rickclephas.kmp.nativecoroutines.NativeCoroutinesState
7
+ import dev.johnoreilly.common.remote.Station
7
8
import dev.johnoreilly.common.repository.CityBikesRepository
8
9
import kotlinx.coroutines.ExperimentalCoroutinesApi
9
10
import kotlinx.coroutines.flow.SharingStarted
11
+ import kotlinx.coroutines.flow.StateFlow
10
12
import kotlinx.coroutines.flow.filterNotNull
11
13
import kotlinx.coroutines.flow.flatMapLatest
12
14
import me.tatarka.inject.annotations.Inject
@@ -21,7 +23,7 @@ open class StationsViewModelShared(cityBikesRepository: CityBikesRepository) : V
21
23
private val network = MutableStateFlow <String ?>(viewModelScope, null )
22
24
23
25
@NativeCoroutinesState
24
- val stations = network.filterNotNull().flatMapLatest {
26
+ val stations: StateFlow < List < Station >> = network.filterNotNull().flatMapLatest {
25
27
cityBikesRepository.pollNetworkUpdates(it)
26
28
}.stateIn(viewModelScope, SharingStarted .WhileSubscribed (), emptyList())
27
29
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ version = "1.0-SNAPSHOT"
11
11
kotlin {
12
12
@Suppress(" OPT_IN_USAGE" )
13
13
wasmJs {
14
- moduleName = " bikeshare"
15
14
browser {
16
15
commonWebpackConfig {
17
16
outputFileName = " bikeshare.js"
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ default_platform :android
17
17
18
18
platform :android do
19
19
20
- versionNum = 8
20
+ versionNum = 10
21
21
22
22
before_all do
23
23
end
Original file line number Diff line number Diff line change 1
1
[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 "
4
4
5
- androidGradlePlugin = " 8.10.1 "
5
+ androidGradlePlugin = " 8.11.0 "
6
6
androidxActivity = " 1.10.1"
7
- androidxComposeBom = " 2025.06.00 "
7
+ androidxComposeBom = " 2025.06.01 "
8
8
androidxLifecycle = " 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 "
15
15
coroutines = " 1.10.2"
16
16
junit = " 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 "
19
19
kotlin-inject-anvil = " 0.1.6"
20
20
kotlininject = " 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"
24
24
slf4j = " 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 "
27
27
28
28
minSdk = " 24"
29
- targetSdk = " 35 "
30
- compileSdk = " 35 "
29
+ targetSdk = " 36 "
30
+ compileSdk = " 36 "
31
31
32
32
33
33
[libraries ]
Original file line number Diff line number Diff line change 1
1
distributionBase =GRADLE_USER_HOME
2
2
distributionPath =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
4
4
networkTimeout =10000
5
5
validateDistributionUrl =true
6
6
zipStoreBase =GRADLE_USER_HOME
You can’t perform that action at this time.
0 commit comments