Skip to content

Commit 951a0a2

Browse files
authored
Merge pull request #53 from icerockdev/develop
Release 0.8.0
2 parents af0c9f1 + 35260f0 commit 951a0a2

File tree

19 files changed

+75
-40
lines changed

19 files changed

+75
-40
lines changed

.github/workflows/compilation-check.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@ jobs:
1111
runs-on: macOS-latest
1212

1313
steps:
14-
- uses: actions/checkout@v1
15-
- name: Set up JDK 11
16-
uses: actions/setup-java@v1
14+
- uses: actions/checkout@v4
15+
- name: Set up JDK 17
16+
uses: actions/setup-java@v4
1717
with:
18-
java-version: 11
19-
- name: Build and publish local
20-
run: ./gradlew build publishToMavenLocal syncMultiPlatformLibraryDebugFrameworkIosX64
21-
- name: Install pods
22-
run: cd sample/ios-app && pod install
23-
- name: Check iOS
24-
run: cd sample/ios-app && set -o pipefail && xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug -sdk iphonesimulator -arch x86_64 build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty
18+
java-version: 17
19+
distribution: zulu
20+
- name: Check
21+
run: ./local-check.sh

.github/workflows/publish.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ jobs:
2020
SIGNING_KEY: ${{ secrets.GPG_KEY_CONTENTS }}
2121

2222
steps:
23-
- uses: actions/checkout@v1
24-
- name: Set up JDK 11
25-
uses: actions/setup-java@v1
23+
- uses: actions/checkout@v4
24+
- name: Set up JDK 17
25+
uses: actions/setup-java@v4
2626
with:
27-
java-version: 11
27+
java-version: 17
28+
distribution: zulu
2829
- name: Publish
2930
run: ./gradlew publish
3031

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ on the platforms. Converts the exception class to an error object to display. Th
2727
`SelectorErrorPresenter` - for selecting error presenter by some custom condition.
2828

2929
## Requirements
30+
- Kotlin 1.9.0
3031
- Gradle version 6.8+
3132
- Android API 16+
3233
- iOS version 11.0+
@@ -44,7 +45,7 @@ allprojects {
4445
project build.gradle
4546
```groovy
4647
dependencies {
47-
commonMainApi("dev.icerock.moko:errors:0.6.0")
48+
commonMainApi("dev.icerock.moko:errors:0.8.0")
4849
}
4950
```
5051

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ allprojects {
2626
}
2727

2828
tasks.register("clean", Delete::class).configure {
29-
delete(rootProject.buildDir)
29+
delete(rootProject.layout.buildDirectory)
3030
}

errors/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dependencies {
3131
}
3232

3333
multiplatformResources {
34-
multiplatformResourcesPackage = "dev.icerock.moko.errors"
34+
resourcesPackage.set("dev.icerock.moko.errors")
3535
}
3636

3737
tasks.withType<GenerateMultiplatformResourcesTask>().configureEach {

errors/src/iosMain/kotlin/dev/icerock/moko/errors/handler/ExceptionHandlerBinder.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import dev.icerock.moko.errors.ErrorEventListener
88
import dev.icerock.moko.errors.presenters.ErrorPresenter
99
import dev.icerock.moko.mvvm.dispatcher.EventsDispatcher
1010
import platform.UIKit.UIViewController
11+
import kotlin.experimental.ExperimentalNativeApi
1112
import kotlin.native.ref.WeakReference
1213

1314
actual interface ExceptionHandlerBinder {
@@ -33,8 +34,10 @@ actual class ExceptionHandlerBinderImpl<T : Any> actual constructor(
3334
viewController: UIViewController,
3435
private val errorPresenter: ErrorPresenter<T>
3536
) : ErrorEventListener<T> {
37+
@OptIn(ExperimentalNativeApi::class)
3638
private val viewControllerRef = WeakReference(viewController)
3739

40+
@OptIn(ExperimentalNativeApi::class)
3841
override fun showError(throwable: Throwable, data: T) {
3942
val viewController = viewControllerRef.get() ?: return
4043

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
org.gradle.jvmargs=-Xmx4096m
22
org.gradle.configureondemand=false
33
org.gradle.parallel=true
4+
org.gradle.configuration-cache=true
45

56
kotlin.code.style=official
67
kotlin.mpp.androidSourceSetLayoutVersion=2

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.8.10"
2+
kotlinVersion = "1.9.25"
33
androidAppCompatVersion = "1.6.1"
44
materialDesignVersion = "1.8.0"
55
androidLifecycleVersion = "2.2.0"
66
androidCoreTestingVersion = "2.2.0"
77
coroutinesVersion = "1.6.4"
8-
mokoMvvmVersion = "0.16.0"
9-
mokoResourcesVersion = "0.21.2"
10-
mokoErrorsVersion = "0.7.0"
8+
mokoMvvmVersion = "0.16.1"
9+
mokoResourcesVersion = "0.24.1"
10+
mokoErrorsVersion = "0.8.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.4.2" }
33+
androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "8.3.2" }
3434
mokoResourcesGradlePlugin = { module = "dev.icerock.moko:resources-generator", version.ref = "mokoResourcesVersion" }
35-
mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.3.0" }
35+
mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.4.1" }
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Tue Apr 16 13:01:03 NOVT 2024
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

local-check.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#
2+
# Copyright 2024 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
3+
#
4+
5+
set -e
6+
7+
log() {
8+
echo "\033[0;32m> $1\033[0m"
9+
}
10+
11+
./gradlew detekt
12+
log "detekt success"
13+
14+
./gradlew assembleDebug
15+
log "android success"
16+
17+
./gradlew compileKotlinIosX64
18+
log "ios success"
19+
20+
./gradlew build publishToMavenLocal
21+
log "full build success"
22+
23+
if ! command -v xcodebuild &> /dev/null
24+
then
25+
log "xcodebuild could not be found, skip ios checks"
26+
else
27+
./gradlew syncMultiPlatformLibraryDebugFrameworkIosX64
28+
log "sync success"
29+
30+
(
31+
cd sample/ios-app &&
32+
pod install &&
33+
set -o pipefail &&
34+
xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug -sdk iphonesimulator -arch x86_64 build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty
35+
)
36+
log "ios xcode success"
37+
fi

sample/ios-app/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
99
:path: "../mpp-library"
1010

1111
SPEC CHECKSUMS:
12-
MultiPlatformLibrary: 2a9f43df7bd018c32611a2087c1e2ef74847394c
12+
MultiPlatformLibrary: 050151f1b2e9b2dcfff0763bb625fb3a0a063076
1313

1414
PODFILE CHECKSUM: e8746dc30e9d53a96c59e8f821148cde03ea8c5b
1515

16-
COCOAPODS: 1.11.3
16+
COCOAPODS: 1.15.2

sample/ios-app/TestProj.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
287627FB1F319065007FA12B /* Sources */,
113113
287627FC1F319065007FA12B /* Frameworks */,
114114
287627FD1F319065007FA12B /* Resources */,
115-
587327CC3950A42DF058CD2B /* [CP] Embed Pods Frameworks */,
115+
C2E24025FF3D3E83F431EA5B /* [CP] Embed Pods Frameworks */,
116116
);
117117
buildRules = (
118118
);
@@ -173,7 +173,7 @@
173173
/* End PBXResourcesBuildPhase section */
174174

175175
/* Begin PBXShellScriptBuildPhase section */
176-
587327CC3950A42DF058CD2B /* [CP] Embed Pods Frameworks */ = {
176+
C2E24025FF3D3E83F431EA5B /* [CP] Embed Pods Frameworks */ = {
177177
isa = PBXShellScriptBuildPhase;
178178
buildActionMask = 2147483647;
179179
files = (

sample/mpp-library/MultiPlatformLibrary.podspec

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Pod::Spec.new do |spec|
1919
'KOTLIN_FRAMEWORK_BUILD_TYPE[config=*elease]' => 'release',
2020
'CURENT_SDK[sdk=iphoneos*]' => 'iphoneos',
2121
'CURENT_SDK[sdk=iphonesimulator*]' => 'iphonesimulator',
22-
'CURENT_SDK[sdk=macosx*]' => 'macos'
2322
}
2423

2524
spec.script_phases = [
@@ -37,21 +36,17 @@ fi
3736
if [ "$CURENT_SDK" == "iphoneos" ]; then
3837
TARGET="Ios"
3938
ARCH="Arm64"
40-
elif [ "$CURENT_SDK" == "macos" ]; then
41-
TARGET="Macos"
42-
if [ "$NATIVE_ARCH" == "arm64" ]; then
43-
ARCH="Arm64"
44-
else
45-
ARCH="X64"
46-
fi
47-
else
48-
if [ "$NATIVE_ARCH" == "arm64" ]; then
39+
elif [ "$CURENT_SDK" == "iphonesimulator" ]; then
40+
if [ "$ARCHS" == "arm64" ]; then
4941
TARGET="IosSimulator"
5042
ARCH="Arm64"
5143
else
5244
TARGET="Ios"
5345
ARCH="X64"
5446
fi
47+
else
48+
echo "unsupported $CURENT_SDK"
49+
exit 1
5550
fi
5651
5752
MPP_PROJECT_ROOT="$SRCROOT/../../mpp-library"

sample/mpp-library/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ dependencies {
2929
}
3030

3131
multiplatformResources {
32-
multiplatformResourcesPackage = "com.icerockdev.library"
32+
resourcesPackage.set("com.icerockdev.library")
3333
}

settings.gradle.kts

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

5-
enableFeaturePreview("VERSION_CATALOGS")
65
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
76

87
dependencyResolutionManagement {

0 commit comments

Comments
 (0)