Skip to content

Commit 2b04459

Browse files
committed
enable granular source sets
1 parent 034045a commit 2b04459

4 files changed

Lines changed: 23 additions & 4 deletions

File tree

errors/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ group = "dev.icerock.moko"
1515
version = Deps.mokoErrorsVersion
1616

1717
dependencies {
18+
commonMainImplementation(Deps.Libs.MultiPlatform.coroutines)
19+
1820
androidMainImplementation(Deps.Libs.Android.appCompat)
1921
androidMainImplementation(Deps.Libs.Android.material)
2022

2123
commonMainImplementation(Deps.Libs.MultiPlatform.mokoMvvm)
2224
commonMainImplementation(Deps.Libs.MultiPlatform.mokoResources)
25+
26+
// temporary fix of https://youtrack.jetbrains.com/issue/KT-41083
27+
commonMainImplementation("dev.icerock.moko:parcelize:0.4.0")
28+
commonMainImplementation("dev.icerock.moko:graphics:0.4.0")
2329
}
2430

2531
multiplatformResources {

errors/src/iosMain/kotlin/dev/icerock/moko/errors/presenters/SnackBarErrorPresenter.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@
55
package dev.icerock.moko.errors.presenters
66

77
import dev.icerock.moko.resources.desc.StringDesc
8+
import dev.icerock.moko.resources.desc.desc
9+
import dev.icerock.moko.errors.MR
810

911
/**
1012
* In iOS there is no such thing as snackbar, so it shows [AlertErrorPresenter].
1113
*/
1214
actual class SnackBarErrorPresenter actual constructor(
13-
private val duration: SnackBarDuration
14-
) : ErrorPresenter<StringDesc> by AlertErrorPresenter()
15+
duration: SnackBarDuration
16+
) : ErrorPresenter<StringDesc> by AlertErrorPresenter(
17+
alertTitle = MR.strings.moko_errors_presenters_alertDialogTitle.desc(),
18+
positiveButtonText = MR.strings.moko_errors_presenters_alertPositiveButton.desc()
19+
)

errors/src/iosMain/kotlin/dev/icerock/moko/errors/presenters/ToastErrorPresenter.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44

55
package dev.icerock.moko.errors.presenters
66

7+
import dev.icerock.moko.errors.MR
78
import dev.icerock.moko.resources.desc.StringDesc
9+
import dev.icerock.moko.resources.desc.desc
810

911
/**
1012
* In iOS there is no such thing as toast, so it shows [AlertErrorPresenter].
1113
*/
1214
actual class ToastErrorPresenter actual constructor(
13-
private val duration: ToastDuration
14-
) : ErrorPresenter<StringDesc> by AlertErrorPresenter()
15+
duration: ToastDuration
16+
) : ErrorPresenter<StringDesc> by AlertErrorPresenter(
17+
alertTitle = MR.strings.moko_errors_presenters_alertDialogTitle.desc(),
18+
positiveButtonText = MR.strings.moko_errors_presenters_alertPositiveButton.desc()
19+
)

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ org.gradle.configureondemand=false
33
org.gradle.parallel=true
44

55
kotlin.code.style=official
6+
kotlin.native.enableDependencyPropagation=false
7+
kotlin.mpp.enableGranularSourceSetsMetadata=true
8+
kotlin.mpp.enableCompatibilityMetadataVariant=true
69

710
android.useAndroidX=true
811

0 commit comments

Comments
 (0)