From 9fa9470af05833bc8f32a2b6e659aeedb06f5484 Mon Sep 17 00:00:00 2001 From: takahirom Date: Wed, 14 Jun 2023 22:12:00 +0900 Subject: [PATCH 1/4] Add contributor ViewModel and adapt iOS --- app-android/build.gradle.kts | 1 + .../droidkaigi/confsched2023/MainActivity.kt | 4 +++- core/designsystem/build.gradle.kts | 1 + core/ui/build.gradle.kts | 2 ++ .../confsched2023/ui/Annotations.kt | 7 ++++++ .../confsched2023/ui/ErrorHandler.kt | 0 .../confsched2023/ui/KmpViewModel.kt | 10 +++++++++ .../confsched2023/ui/UserMessage.kt | 0 .../confsched2023/ui/Annotations.kt | 4 ++++ .../confsched2023/ui/KmpViewModel.kt | 7 ++++++ .../confsched2023/ui/Annotations.kt | 5 +++++ .../confsched2023/ui/KmpViewModel.kt | 9 ++++++++ feature/contributors/build.gradle.kts | 1 + .../contributors/ContributorsScreen.kt | 14 ++++++++++-- .../contributors/ContributorsViewModel.kt | 22 +++++++++++++++++++ .../contributors/DarwinContributors.kt | 21 ++++++++++-------- 16 files changed, 96 insertions(+), 12 deletions(-) create mode 100644 core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt rename core/ui/src/{commonMain => androidMain}/kotlin/io/github/droidkaigi/confsched2023/ui/ErrorHandler.kt (100%) create mode 100644 core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt rename core/ui/src/{commonMain => androidMain}/kotlin/io/github/droidkaigi/confsched2023/ui/UserMessage.kt (100%) create mode 100644 core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt create mode 100644 core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt create mode 100644 core/ui/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt create mode 100644 core/ui/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt create mode 100644 feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/contributors/ContributorsViewModel.kt diff --git a/app-android/build.gradle.kts b/app-android/build.gradle.kts index d848e5815..1b9d6e41b 100644 --- a/app-android/build.gradle.kts +++ b/app-android/build.gradle.kts @@ -15,5 +15,6 @@ dependencies { implementation(projects.core.data) implementation(projects.core.designsystem) implementation(libs.composeNavigation) + implementation(libs.composeHiltNavigtation) testImplementation(projects.core.testing) } \ No newline at end of file diff --git a/app-android/src/main/java/io/github/droidkaigi/confsched2023/MainActivity.kt b/app-android/src/main/java/io/github/droidkaigi/confsched2023/MainActivity.kt index 9bab118c1..73f52c78d 100644 --- a/app-android/src/main/java/io/github/droidkaigi/confsched2023/MainActivity.kt +++ b/app-android/src/main/java/io/github/droidkaigi/confsched2023/MainActivity.kt @@ -7,11 +7,13 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.ui.Modifier +import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable import androidx.navigation.compose.rememberNavController import dagger.hilt.android.AndroidEntryPoint import io.github.droidkaigi.confsched2023.contributors.ContributorsScreen +import io.github.droidkaigi.confsched2023.contributors.ContributorsViewModel import io.github.droidkaigi.confsched2023.designsystem.theme.KaigiTheme import io.github.droidkaigi.confsched2023.sessions.TimetableScreen @@ -36,7 +38,7 @@ class MainActivity : ComponentActivity() { ) } composable("contributors") { - ContributorsScreen() + ContributorsScreen(hiltViewModel()) } } } diff --git a/core/designsystem/build.gradle.kts b/core/designsystem/build.gradle.kts index baccf5837..bea2a7d7e 100644 --- a/core/designsystem/build.gradle.kts +++ b/core/designsystem/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("droidkaigi.primitive.kmp") id("droidkaigi.primitive.kmp.android") + id("droidkaigi.primitive.kmp.ios") id("droidkaigi.primitive.kmp.compose") id("droidkaigi.primitive.kmp.android.hilt") id("droidkaigi.primitive.spotless") diff --git a/core/ui/build.gradle.kts b/core/ui/build.gradle.kts index 2f8ef9656..51fa1a166 100644 --- a/core/ui/build.gradle.kts +++ b/core/ui/build.gradle.kts @@ -1,6 +1,7 @@ plugins { id("droidkaigi.primitive.kmp") id("droidkaigi.primitive.kmp.android") + id("droidkaigi.primitive.kmp.ios") id("droidkaigi.primitive.kmp.compose") id("droidkaigi.primitive.kmp.android.hilt") id("droidkaigi.primitive.spotless") @@ -13,6 +14,7 @@ kotlin{ commonMain { dependencies { implementation(project(":core:designsystem")) + implementation(project(":core:data")) } } } diff --git a/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt new file mode 100644 index 000000000..dad0c3a56 --- /dev/null +++ b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt @@ -0,0 +1,7 @@ +package io.github.droidkaigi.confsched2023.ui + +import dagger.hilt.android.lifecycle.HiltViewModel +import javax.inject.Inject + +actual typealias KmpHiltViewModel = HiltViewModel +actual typealias KmpInject = Inject diff --git a/core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/ui/ErrorHandler.kt b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/ErrorHandler.kt similarity index 100% rename from core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/ui/ErrorHandler.kt rename to core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/ErrorHandler.kt diff --git a/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt new file mode 100644 index 000000000..135ad6d9c --- /dev/null +++ b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt @@ -0,0 +1,10 @@ +package io.github.droidkaigi.confsched2023.ui + +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import kotlinx.coroutines.CoroutineScope + +actual typealias KmpViewModel = ViewModel + +actual val KmpViewModel.viewModelScope: CoroutineScope + get() = this.viewModelScope \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/ui/UserMessage.kt b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/UserMessage.kt similarity index 100% rename from core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/ui/UserMessage.kt rename to core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/UserMessage.kt diff --git a/core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt b/core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt new file mode 100644 index 000000000..ee2d93433 --- /dev/null +++ b/core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt @@ -0,0 +1,4 @@ +package io.github.droidkaigi.confsched2023.ui + +expect annotation class KmpHiltViewModel() +expect annotation class KmpInject() diff --git a/core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt b/core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt new file mode 100644 index 000000000..691d633e7 --- /dev/null +++ b/core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt @@ -0,0 +1,7 @@ +package io.github.droidkaigi.confsched2023.ui + +import kotlinx.coroutines.CoroutineScope + +expect abstract class KmpViewModel() + +expect val KmpViewModel.viewModelScope: CoroutineScope diff --git a/core/ui/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt b/core/ui/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt new file mode 100644 index 000000000..364389091 --- /dev/null +++ b/core/ui/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt @@ -0,0 +1,5 @@ +package io.github.droidkaigi.confsched2023.ui + + +actual annotation class KmpHiltViewModel() +actual annotation class KmpInject() diff --git a/core/ui/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt b/core/ui/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt new file mode 100644 index 000000000..8a7270c97 --- /dev/null +++ b/core/ui/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt @@ -0,0 +1,9 @@ +package io.github.droidkaigi.confsched2023.ui + +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.MainScope + +actual abstract class KmpViewModel +actual val KmpViewModel.viewModelScope: CoroutineScope + // TODO: Cancel scope + get() = MainScope() diff --git a/feature/contributors/build.gradle.kts b/feature/contributors/build.gradle.kts index bef33f2ee..507fda518 100644 --- a/feature/contributors/build.gradle.kts +++ b/feature/contributors/build.gradle.kts @@ -12,6 +12,7 @@ kotlin { commonMain { dependencies { implementation(projects.core.model) + implementation(projects.core.ui) implementation(libs.kotlinxCoroutinesCore) } } diff --git a/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/contributors/ContributorsScreen.kt b/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/contributors/ContributorsScreen.kt index 7091f235a..0d8b8de92 100644 --- a/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/contributors/ContributorsScreen.kt +++ b/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/contributors/ContributorsScreen.kt @@ -1,11 +1,21 @@ package io.github.droidkaigi.confsched2023.contributors +import androidx.compose.foundation.layout.Column import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import io.github.droidkaigi.confsched2023.contributors.Contributors +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue @Composable -fun ContributorsScreen() { +fun ContributorsScreen(viewModel: ContributorsViewModel) { val contributors = Contributors() Text(text = contributors.greet()) + val sessions by viewModel.sessions.collectAsState() + Column { + sessions.timetableItems.forEach { + Text( + text = it.title.currentLangTitle, + ) + } + } } diff --git a/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/contributors/ContributorsViewModel.kt b/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/contributors/ContributorsViewModel.kt new file mode 100644 index 000000000..efdce5ed6 --- /dev/null +++ b/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/contributors/ContributorsViewModel.kt @@ -0,0 +1,22 @@ +package io.github.droidkaigi.confsched2023.contributors + +import io.github.droidkaigi.confsched2023.model.SessionsRepository +import io.github.droidkaigi.confsched2023.model.Timetable +import io.github.droidkaigi.confsched2023.ui.KmpHiltViewModel +import io.github.droidkaigi.confsched2023.ui.KmpInject +import io.github.droidkaigi.confsched2023.ui.KmpViewModel +import io.github.droidkaigi.confsched2023.ui.viewModelScope +import kotlinx.coroutines.flow.SharingStarted +import kotlinx.coroutines.flow.stateIn + +@KmpHiltViewModel +class ContributorsViewModel @KmpInject constructor(val sessionRepository: SessionsRepository) : + KmpViewModel() { + // FIXME + val sessions = sessionRepository.getSessionsStream() + .stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), Timetable()) + + fun greet(): String { + return "Hello, ${Contributors().greet()}" + } +} \ No newline at end of file diff --git a/feature/contributors/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/contributors/DarwinContributors.kt b/feature/contributors/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/contributors/DarwinContributors.kt index 3d3bb96df..7975e07ae 100644 --- a/feature/contributors/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/contributors/DarwinContributors.kt +++ b/feature/contributors/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/contributors/DarwinContributors.kt @@ -1,18 +1,21 @@ package io.github.droidkaigi.confsched2023.contributors -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.material3.Text -import androidx.compose.ui.Modifier +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.ui.interop.LocalUIViewController import androidx.compose.ui.window.ComposeUIViewController +import io.github.droidkaigi.confsched2023.data.DefaultSessionsRepository +import io.github.droidkaigi.confsched2023.data.FakeSessionsApi import platform.UIKit.UIViewController @Suppress("UNUSED") fun viewController(): UIViewController = ComposeUIViewController { - Column( - modifier = Modifier - .fillMaxSize() - ) { - Text("Hello") + val viewModel = ContributorsViewModel(DefaultSessionsRepository(FakeSessionsApi())) + val uiViewController = LocalUIViewController.current + LaunchedEffect(uiViewController) { +// uiViewController + // TODO: How to know the destroy event of the ViewController? +// viewModel.viewModelScope.cancel() } + + ContributorsScreen(viewModel) } From 9a692dabc7f1eb714190b0be8b85e324e19818b9 Mon Sep 17 00:00:00 2001 From: takahirom Date: Wed, 14 Jun 2023 22:12:27 +0900 Subject: [PATCH 2/4] Format --- .../io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt | 2 +- .../kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt index 135ad6d9c..47ca3e69a 100644 --- a/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt +++ b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/KmpViewModel.kt @@ -7,4 +7,4 @@ import kotlinx.coroutines.CoroutineScope actual typealias KmpViewModel = ViewModel actual val KmpViewModel.viewModelScope: CoroutineScope - get() = this.viewModelScope \ No newline at end of file + get() = this.viewModelScope diff --git a/core/ui/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt b/core/ui/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt index 364389091..e675b5a92 100644 --- a/core/ui/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt +++ b/core/ui/src/iosMain/kotlin/io/github/droidkaigi/confsched2023/ui/Annotations.kt @@ -1,5 +1,4 @@ package io.github.droidkaigi.confsched2023.ui - actual annotation class KmpHiltViewModel() actual annotation class KmpInject() From 4cc24ce22f7c1d772501d694b41381517a9557cc Mon Sep 17 00:00:00 2001 From: takahirom Date: Wed, 14 Jun 2023 22:56:19 +0900 Subject: [PATCH 3/4] Fix unresolved symbol error --- .../ui/ErrorAndRetryActionHandler.kt | 19 +++++++++++++++++++ ...rrorHandler.kt => ErrorAndRetryHandler.kt} | 15 --------------- .../ui/MessageStateHolderModule.kt | 15 +++++++++++++++ .../confsched2023/ui/UserMessage.kt | 14 -------------- 4 files changed, 34 insertions(+), 29 deletions(-) create mode 100644 core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/ErrorAndRetryActionHandler.kt rename core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/{ErrorHandler.kt => ErrorAndRetryHandler.kt} (57%) create mode 100644 core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/MessageStateHolderModule.kt diff --git a/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/ErrorAndRetryActionHandler.kt b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/ErrorAndRetryActionHandler.kt new file mode 100644 index 000000000..10ac7019e --- /dev/null +++ b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/ErrorAndRetryActionHandler.kt @@ -0,0 +1,19 @@ +package io.github.droidkaigi.confsched2023.ui + +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.catch + +fun Flow.handleErrorAndRetryAction( + actionLabel: String, + userMessageStateHolder: UserMessageStateHolder, + retryAction: suspend ((Throwable) -> Unit), +) = catch { throwable -> + val messageResult = userMessageStateHolder.showMessage( + message = throwable.toApplicationErrorMessage(), + actionLabel = actionLabel, + ) + + if (messageResult == UserMessageResult.ActionPerformed) { + retryAction(throwable) + } +}.catch { /* Do nothing if the user dose not retry. */ } diff --git a/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/ErrorHandler.kt b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/ErrorAndRetryHandler.kt similarity index 57% rename from core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/ErrorHandler.kt rename to core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/ErrorAndRetryHandler.kt index 5a2792f04..56c990b6e 100644 --- a/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/ErrorHandler.kt +++ b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/ErrorAndRetryHandler.kt @@ -18,18 +18,3 @@ fun Flow.handleErrorAndRetry( retryPerformed }.catch { /* Do nothing if the user dose not retry. */ } - -fun Flow.handleErrorAndRetryAction( - actionLabel: String, - userMessageStateHolder: UserMessageStateHolder, - retryAction: suspend ((Throwable) -> Unit), -) = catch { throwable -> - val messageResult = userMessageStateHolder.showMessage( - message = throwable.toApplicationErrorMessage(), - actionLabel = actionLabel, - ) - - if (messageResult == UserMessageResult.ActionPerformed) { - retryAction(throwable) - } -}.catch { /* Do nothing if the user dose not retry. */ } diff --git a/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/MessageStateHolderModule.kt b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/MessageStateHolderModule.kt new file mode 100644 index 000000000..a961c08c0 --- /dev/null +++ b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/MessageStateHolderModule.kt @@ -0,0 +1,15 @@ +package io.github.droidkaigi.confsched2023.ui + +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent + +@Module +@InstallIn(SingletonComponent::class) +class MessageStateHolderModule { + @Provides + fun provideMessageStateHolder(): UserMessageStateHolder { + return UserMessageStateHolderImpl() + } +} diff --git a/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/UserMessage.kt b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/UserMessage.kt index 5756d5102..1ac589f90 100644 --- a/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/UserMessage.kt +++ b/core/ui/src/androidMain/kotlin/io/github/droidkaigi/confsched2023/ui/UserMessage.kt @@ -10,10 +10,6 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue import androidx.compose.runtime.snapshotFlow -import dagger.Module -import dagger.Provides -import dagger.hilt.InstallIn -import dagger.hilt.components.SingletonComponent import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.map @@ -54,16 +50,6 @@ data class UserMessage( data class MessageUiState( val userMessages: List = emptyList(), ) - -@Module -@InstallIn(SingletonComponent::class) -class MessageStateHolderModule { - @Provides - fun provideMessageStateHolder(): UserMessageStateHolder { - return UserMessageStateHolderImpl() - } -} - class UserMessageStateHolderImpl : UserMessageStateHolder { private var _messageUiState by mutableStateOf(MessageUiState()) override val messageUiState get() = _messageUiState From 14b0710ca0adc4343e394ce65c9238f8735d8b07 Mon Sep 17 00:00:00 2001 From: takahirom Date: Thu, 15 Jun 2023 08:31:17 +0900 Subject: [PATCH 4/4] Fix atomicfu error using workaround --- .../confsched2023/primitive/AndroidKotlinPlugin.kt | 1 + core/designsystem/build.gradle.kts | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/build-logic/src/main/kotlin/io/github/droidkaigi/confsched2023/primitive/AndroidKotlinPlugin.kt b/build-logic/src/main/kotlin/io/github/droidkaigi/confsched2023/primitive/AndroidKotlinPlugin.kt index 3560d5766..988dcceff 100644 --- a/build-logic/src/main/kotlin/io/github/droidkaigi/confsched2023/primitive/AndroidKotlinPlugin.kt +++ b/build-logic/src/main/kotlin/io/github/droidkaigi/confsched2023/primitive/AndroidKotlinPlugin.kt @@ -33,6 +33,7 @@ class AndroidKotlinPlugin : Plugin { } dependencies { implementation(libs.findLibrary("kotlinxCoroutinesCore")) + // Fix https://youtrack.jetbrains.com/issue/KT-41821 implementation(libs.findLibrary("kotlinxAtomicfu")) } } diff --git a/core/designsystem/build.gradle.kts b/core/designsystem/build.gradle.kts index bea2a7d7e..f78711f6b 100644 --- a/core/designsystem/build.gradle.kts +++ b/core/designsystem/build.gradle.kts @@ -1,3 +1,6 @@ +import io.github.droidkaigi.confsched2023.primitive.implementation +import io.github.droidkaigi.confsched2023.primitive.libs + plugins { id("droidkaigi.primitive.kmp") id("droidkaigi.primitive.kmp.android") @@ -9,5 +12,16 @@ plugins { android.namespace = "io.github.droidkaigi.confsched2023.core.designsystem" +kotlin { + sourceSets { + commonMain { + dependencies { + // Fix https://youtrack.jetbrains.com/issue/KT-41821 + implementation(libs.findLibrary("kotlinxAtomicfu").get()) + } + } + } +} + dependencies { } \ No newline at end of file