Skip to content

Commit 3511a75

Browse files
authored
add Compose Multiplatform sample, using io.github.hoc081098:solivagant-navigation:0.3.0 (#52)
* gradle wrapper 8.7 * standalone-androidApp * include(":sample:standalone-composeMultiplatform:composeApp") * include(":sample:standalone-composeMultiplatform:composeApp") * include(":sample:standalone-composeMultiplatform:composeApp") * include(":sample:standalone-composeMultiplatform:composeApp") * include(":sample:standalone-composeMultiplatform:composeApp") * format * detekt * add desktop * navigation * navigation * done compose multiplatform sample, and fix issue where bus was null before marking `collecting` state * detekt * Update sample.yml * Update build.gradle.kts * Update libs.versions.toml JetBrains/compose-multiplatform#4326
1 parent 69e7570 commit 3511a75

File tree

73 files changed

+2276
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2276
-17
lines changed

.github/workflows/sample.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ jobs:
5959
run: chmod +x ./gradlew
6060

6161
- name: Build
62-
run: ./gradlew :sample:app:assembleDebug --stacktrace
62+
run: ./gradlew :sample:standalone-androidApp:assembleDebug :sample:standalone-composeMultiplatform:desktopApp:packageDistributionForCurrentOS --stacktrace

.idea/deploymentTargetDropDown.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

channel-event-bus/src/commonMain/kotlin/com/hoc081098/channeleventbus/ChannelEventBus.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ private class ChannelEventBusImpl(
201201
*/
202202
private fun markAsNotCollecting(key: ChannelEventKey<*>): Unit =
203203
_busMap.synchronized {
204-
_busMap[key] = _busMap[key]!!
204+
// _busMap[key] can be null if it is removed and closed before calling this method.
205+
// Just ignore in that case.
206+
_busMap[key] = (_busMap[key] ?: return)
205207
.copy(isCollecting = false)
206208
.also { logger?.onStopCollection(key, this) }
207209
}

detekt.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,9 @@ style:
674674
UnusedPrivateMember:
675675
active: true
676676
allowedNames: '(_|ignored|expected|serialVersionUID)'
677+
ignoreAnnotated:
678+
- Preview
679+
- androidx.compose.desktop.ui.tooling.preview.Preview
677680
UseAnyOrNoneInsteadOfFind:
678681
active: true
679682
UseArrayLiteralsInAnnotations:

gradle/libs.versions.toml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
2-
kotlin = "1.9.22"
3-
coroutines = "1.8.0"
2+
kotlin = "1.9.23"
3+
coroutines = "1.8.1-Beta"
44
kotlinx-serialization-json = "1.6.3"
55
kotlinx-collections-immutable = "0.3.7"
66

@@ -12,9 +12,9 @@ java-toolchain = "17"
1212
# the Android minSdkVersion to use
1313
android-min = "21"
1414
# the Android target to use
15-
android-target = "33"
15+
android-target = "34"
1616
# the Android compileSdkVersion to use
17-
android-compile = "33"
17+
android-compile = "34"
1818

1919
android-gradle = "8.3.1"
2020

@@ -23,22 +23,23 @@ sample-android-target = "34"
2323
# the Android compileSdkVersion to use in sample
2424
sample-android-compile = "34"
2525

26-
jetbrains-compose = "1.6.1"
26+
jetbrains-compose = "1.6.2"
2727

2828
touchlab-stately = "2.0.6"
2929
napier = "2.7.1"
30-
flowExt = "0.8.0"
31-
koin = "3.5.3"
32-
koin-androidx-compose = "3.5.3"
30+
flowExt = "0.8.1-Beta"
31+
koin-core = "3.5.3"
32+
koin-compose = "1.1.2"
3333
coil = "2.6.0"
3434
compose-rules-detekt = "0.3.12"
3535

3636
androidx-lifecycle = "2.7.0"
3737
androidx-annotation = "1.7.1"
3838
androidx-activity = "1.8.2"
39-
androidx-compose-compiler = "1.5.9"
39+
androidx-compose-compiler = "1.5.11"
4040
androidx-navigation = "2.7.7"
4141
kmp-viewmodel = "0.7.1"
42+
solivagant = "0.3.0"
4243
timber = "5.0.1"
4344

4445
spotless = "6.25.0"
@@ -54,6 +55,7 @@ ktlint = "0.50.0"
5455
[libraries]
5556
coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
5657
coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" }
58+
coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "coroutines" }
5759
coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
5860
coroutines-jdk8 = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8", version.ref = "coroutines" }
5961
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization-json" }
@@ -64,9 +66,10 @@ jetbrains-compose-runtime = { module = "org.jetbrains.compose.runtime:runtime",
6466
touchlab-stately-concurrency = { module = "co.touchlab:stately-concurrency", version.ref = "touchlab-stately" }
6567
napier = { module = "io.github.aakira:napier", version.ref = "napier" }
6668
flowExt = { module = "io.github.hoc081098:FlowExt", version.ref = "flowExt" }
67-
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
68-
koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin" }
69-
koin-androidx-compose = { module = "io.insert-koin:koin-androidx-compose", version.ref = "koin-androidx-compose" }
69+
koin-android = { module = "io.insert-koin:koin-android", version.ref = "koin-core" }
70+
koin-androidx-compose = { module = "io.insert-koin:koin-androidx-compose", version.ref = "koin-core" }
71+
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin-core" }
72+
koin-compose = { module = "io.insert-koin:koin-compose", version.ref = "koin-compose" }
7073
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" }
7174
compose-rules-detekt = { module = "io.nlopez.compose.rules:detekt", version.ref = "compose-rules-detekt" }
7275

@@ -86,7 +89,11 @@ androidx-compose-material3 = { module = "androidx.compose.material3:material3" }
8689
androidx-compose-runtime = { module = "androidx.compose.runtime:runtime" }
8790
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidx-navigation" }
8891

92+
kmp-viewmodel = { module = "io.github.hoc081098:kmp-viewmodel", version.ref = "kmp-viewmodel" }
8993
kmp-viewmodel-savedstate = { module = "io.github.hoc081098:kmp-viewmodel-savedstate", version.ref = "kmp-viewmodel" }
94+
kmp-viewmodel-compose = { module = "io.github.hoc081098:kmp-viewmodel-compose", version.ref = "kmp-viewmodel" }
95+
kmp-viewmodel-koin-compose = { module = "io.github.hoc081098:kmp-viewmodel-koin-compose", version.ref = "kmp-viewmodel" }
96+
solivagant-navigation = { module = "io.github.hoc081098:solivagant-navigation", version.ref = "solivagant" }
9097
timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" }
9198

9299
[plugins]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)