Skip to content

Commit 1aa6117

Browse files
authored
Merge pull request #48 from icerockdev/#47-update-moko-resources
#47 update moko-resources dependency
2 parents f1d29f9 + 3def8a4 commit 1aa6117

File tree

13 files changed

+37
-26
lines changed

13 files changed

+37
-26
lines changed

errors/build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5+
import dev.icerock.gradle.tasks.GenerateMultiplatformResourcesTask
6+
57
plugins {
68
id("dev.icerock.moko.gradle.multiplatform.mobile")
79
id("kotlin-parcelize")
@@ -14,6 +16,10 @@ plugins {
1416
group = "dev.icerock.moko"
1517
version = libs.versions.mokoErrorsVersion.get()
1618

19+
android {
20+
namespace = "dev.icerock.moko.errors"
21+
}
22+
1723
dependencies {
1824
commonMainImplementation(libs.coroutines)
1925

@@ -28,3 +34,6 @@ multiplatformResources {
2834
multiplatformResourcesPackage = "dev.icerock.moko.errors"
2935
}
3036

37+
tasks.withType<GenerateMultiplatformResourcesTask>().configureEach {
38+
tasks.getByName("sourcesJar").dependsOn(this)
39+
}

errors/src/androidMain/AndroidManifest.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

errors/src/androidMain/kotlin/dev/icerock/moko/errors/presenters/AlertDialogFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class AlertDialogFragment : DialogFragment() {
2828
.setMessage(settings.messageText)
2929
.setPositiveButton(settings.positiveButtonText) { _, _ -> }
3030
.create()
31-
} ?: throw IllegalStateException("Activity can't be null.")
31+
} ?: error("Activity can't be null.")
3232
}
3333

3434
@Parcelize

errors/src/commonMain/kotlin/dev/icerock/moko/errors/handler/ExceptionHandlerContextImpl.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,14 @@ internal class ExceptionHandlerContextImpl<T : Any, R>(
3939
override suspend fun execute(): HandlerResult<R, Throwable> {
4040
return try {
4141
HandlerResult.Success(block())
42-
} catch (e: Exception) {
42+
} catch (e: CancellationException) {
4343
// Don't handle coroutines CancellationException
44-
if (e is CancellationException) throw e
44+
throw e
45+
} catch (e: Exception) {
4546
onCatch?.invoke(e)
46-
val isHandled = isHandledByCustomCatcher(e)
47+
val isHandled: Boolean = isHandledByCustomCatcher(e)
4748
if (!isHandled) { // If not handled by a custom catcher
48-
val errorValue = exceptionMapper(e)
49+
val errorValue: T = exceptionMapper(e)
4950
eventsDispatcher.dispatchEvent {
5051
showError(e, errorValue)
5152
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

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

7+
import dev.icerock.moko.errors.MR
78
import dev.icerock.moko.resources.desc.StringDesc
89
import dev.icerock.moko.resources.desc.desc
9-
import dev.icerock.moko.errors.MR
1010

1111
/**
1212
* In iOS there is no such thing as snackbar, so it shows [AlertErrorPresenter].

gradle.properties

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ 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
6+
kotlin.mpp.androidSourceSetLayoutVersion=2
97

108
android.useAndroidX=true
119

12-
moko.android.targetSdk=30
13-
moko.android.compileSdk=30
10+
moko.android.targetSdk=33
11+
moko.android.compileSdk=33
1412
moko.android.minSdk=16
1513

1614
moko.publish.name=MOKO errors

gradle/libs.versions.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[versions]
2-
kotlinVersion = "1.6.10"
2+
kotlinVersion = "1.8.10"
33
androidAppCompatVersion = "1.2.0"
44
materialDesignVersion = "1.4.0"
55
androidLifecycleVersion = "2.1.0"
66
androidCoreTestingVersion = "2.1.0"
77
coroutinesVersion = "1.6.0-native-mt"
8-
mokoMvvmVersion = "0.12.0"
9-
mokoResourcesVersion = "0.18.0"
10-
mokoErrorsVersion = "0.6.0"
8+
mokoMvvmVersion = "0.16.0"
9+
mokoResourcesVersion = "0.21.2"
10+
mokoErrorsVersion = "0.7.0"
1111

1212
[libraries]
1313
# android
@@ -30,6 +30,6 @@ androidCoreTesting = { module = "androidx.arch.core:core-testing", version.ref =
3030

3131
# gradle plugins
3232
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinVersion" }
33-
androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "7.0.4" }
33+
androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "7.4.2" }
3434
mokoResourcesGradlePlugin = { module = "dev.icerock.moko:resources-generator", version.ref = "mokoResourcesVersion" }
35-
mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.1.0" }
35+
mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.3.0" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

sample/android-app/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ plugins {
1111
android {
1212
buildFeatures.dataBinding = true
1313

14+
namespace = "com.icerockdev"
15+
1416
defaultConfig {
1517
applicationId = "dev.icerock.moko.samples.errors"
1618

sample/android-app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="com.icerockdev">
3+
xmlns:tools="http://schemas.android.com/tools">
54

65
<uses-permission android:name="android.permission.INTERNET" />
76

@@ -10,7 +9,9 @@
109
android:theme="@style/Theme.AppCompat.DayNight"
1110
tools:ignore="GoogleAppIndexingWarning">
1211

13-
<activity android:name=".MainActivity">
12+
<activity
13+
android:name=".MainActivity"
14+
android:exported="true">
1415
<intent-filter>
1516
<action android:name="android.intent.action.MAIN" />
1617
<category android:name="android.intent.category.LAUNCHER" />

sample/ios-app/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ SPEC CHECKSUMS:
1313

1414
PODFILE CHECKSUM: e8746dc30e9d53a96c59e8f821148cde03ea8c5b
1515

16-
COCOAPODS: 1.11.2
16+
COCOAPODS: 1.11.3

sample/mpp-library/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ plugins {
1313
id("dev.icerock.moko.gradle.detekt")
1414
}
1515

16+
android {
17+
namespace = "com.icerockdev.library"
18+
}
19+
1620
dependencies {
1721
commonMainImplementation(libs.coroutines)
1822

sample/mpp-library/src/androidMain/AndroidManifest.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)