Skip to content

Commit 7188eea

Browse files
authored
Merge pull request #7 from icerockdev/kotlin-1.4.0
Kotlin 1.4.0
2 parents ed433e3 + 70c628c commit 7188eea

23 files changed

Lines changed: 208 additions & 257 deletions

.github/workflows/compilation-check.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@ jobs:
1616
uses: actions/setup-java@v1
1717
with:
1818
java-version: 1.8
19-
- name: Check library build
20-
run: ./gradlew -PlibraryPublish detekt :errors:publishToMavenLocal
21-
- name: Check library sample
22-
run: ./gradlew detekt :sample:mpp-library:build
19+
- name: Check build
20+
run: ./gradlew detekt build publishToMavenLocal

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
with:
1616
java-version: 1.8
1717
- name: Publish
18-
run: ./gradlew -PlibraryPublish :errors:publishAllPublicationsToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }}
18+
run: ./gradlew publishAllPublicationsToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }}

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![moko-errors](img/logo.png)
22

3-
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://api.bintray.com/packages/icerockdev/moko/moko-errors/images/download.svg) ](https://bintray.com/icerockdev/moko/moko-errors/_latestVersion) ![kotlin-version](https://img.shields.io/badge/kotlin-1.3.72-orange)
3+
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://api.bintray.com/packages/icerockdev/moko/moko-errors/images/download.svg) ](https://bintray.com/icerockdev/moko/moko-errors/_latestVersion) ![kotlin-version](https://img.shields.io/badge/kotlin-1.4.0-orange)
44

55
# Mobile Kotlin errors
66
This is a Kotlin MultiPlatform library that provides automatic exception handling and
@@ -13,7 +13,7 @@ automatic error displaying to a screen.
1313
- [Installation](#installation)
1414
- [Usage](#usage)
1515
- [Samples](#samples)
16-
- [Set Up Locally](#setup-locally)
16+
- [Set Up Locally](#set-up-locally)
1717
- [Contributing](#contributing)
1818
- [License](#license)
1919

@@ -29,7 +29,7 @@ on the platforms. Converts the exception class to an error object to display. Th
2929
`SelectorErrorPresenter` - for selecting error presenter by some custom condition.
3030

3131
## Requirements
32-
- Gradle version 5.6.4+
32+
- Gradle version 6.0+
3333
- Android API 16+
3434
- iOS version 9.0+
3535

@@ -38,6 +38,8 @@ on the platforms. Converts the exception class to an error object to display. Th
3838
- 0.1.0
3939
- 0.2.0
4040
- 0.2.1
41+
- kotlin 1.4.0
42+
- 0.3.0
4143

4244
## Installation
4345
root build.gradle
@@ -52,7 +54,7 @@ allprojects {
5254
project build.gradle
5355
```groovy
5456
dependencies {
55-
commonMainApi("dev.icerock.moko:errors:0.2.1")
57+
commonMainApi("dev.icerock.moko:errors:0.3.0")
5658
}
5759
```
5860

@@ -235,8 +237,7 @@ Please see more examples in the [sample directory](sample).
235237

236238
## Set Up Locally
237239
- The [errors directory](errors) contains the `errors` library;
238-
- The [sample directory](sample) contains sample apps for Android and iOS; plus the mpp-library connected to the apps;
239-
- For local testing a library use the `./publishToMavenLocal.sh` script - so that sample apps use the locally published version.
240+
- The [sample directory](sample) contains sample apps for Android and iOS; plus the mpp-library connected to the apps.
240241

241242
## Contributing
242243
All development (both new features and bug fixes) is performed in the `develop` branch. This way `master` always contains the sources of the most recently released version. Please send PRs with bug fixes to the `develop` branch. Documentation fixes in the markdown files are an exception to this rule. They are updated directly in `master`.

build.gradle.kts

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

5+
buildscript {
6+
repositories {
7+
jcenter()
8+
google()
9+
10+
maven { url = uri("https://dl.bintray.com/kotlin/kotlin") }
11+
maven { url = uri("https://kotlin.bintray.com/kotlinx") }
12+
maven { url = uri("https://plugins.gradle.org/m2/") }
13+
maven { url = uri("https://dl.bintray.com/icerockdev/plugins") }
14+
}
15+
16+
dependencies {
17+
plugin(Deps.Plugins.mokoResources)
18+
}
19+
}
20+
521
plugins {
6-
id("io.gitlab.arturbosch.detekt") version Versions.detekt apply false
22+
plugin(Deps.Plugins.detekt).apply(false)
723
}
824

925
allprojects {
1026
repositories {
11-
mavenLocal()
12-
1327
google()
1428
jcenter()
1529

@@ -18,15 +32,25 @@ allprojects {
1832
maven { url = uri("https://dl.bintray.com/icerockdev/moko") }
1933
}
2034

21-
apply(plugin = "io.gitlab.arturbosch.detekt")
35+
plugins.withId(Deps.Plugins.androidLibrary.id) {
36+
configure<com.android.build.gradle.LibraryExtension> {
37+
compileSdkVersion(Deps.Android.compileSdk)
38+
39+
defaultConfig {
40+
minSdkVersion(Deps.Android.minSdk)
41+
targetSdkVersion(Deps.Android.targetSdk)
42+
}
43+
}
44+
}
45+
46+
apply(plugin = Deps.Plugins.detekt.id)
2247

2348
configure<io.gitlab.arturbosch.detekt.extensions.DetektExtension> {
24-
toolVersion = Versions.detekt
2549
input.setFrom("src/commonMain/kotlin", "src/androidMain/kotlin", "src/iosMain/kotlin")
2650
}
2751

2852
dependencies {
29-
"detektPlugins"("io.gitlab.arturbosch.detekt:detekt-formatting:${Versions.detekt}")
53+
"detektPlugins"(Deps.Libs.Detekt.detektFormatting)
3054
}
3155
}
3256

buildSrc/build.gradle.kts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
/*
2+
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
15
plugins {
2-
`kotlin-dsl`
6+
id("org.jetbrains.kotlin.jvm") version("1.4.0")
37
}
48

59
repositories {
@@ -12,11 +16,7 @@ repositories {
1216
}
1317

1418
dependencies {
15-
implementation("dev.icerock:mobile-multiplatform:0.6.1")
16-
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72")
17-
implementation("com.android.tools.build:gradle:3.6.3")
18-
}
19-
20-
kotlinDslPluginOptions {
21-
experimentalWarning.set(false)
19+
implementation("dev.icerock:mobile-multiplatform:0.7.0")
20+
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0")
21+
implementation("com.android.tools.build:gradle:4.0.1")
2222
}

buildSrc/src/main/kotlin/Deps.kt

Lines changed: 66 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,65 +3,79 @@
33
*/
44

55
object Deps {
6+
private const val kotlinVersion = "1.4.0"
7+
8+
private const val androidAppCompatVersion = "1.1.0"
9+
private const val materialDesignVersion = "1.0.0"
10+
private const val androidLifecycleVersion = "2.1.0"
11+
private const val androidCoreTestingVersion = "2.1.0"
12+
13+
private const val detektVersion = "1.7.4"
14+
15+
private const val coroutinesVersion = "1.3.9"
16+
private const val mokoMvvmVersion = "0.8.0"
17+
private const val mokoResourcesVersion = "0.13.1"
18+
const val mokoErrorsVersion = "0.3.0"
19+
20+
object Android {
21+
const val compileSdk = 28
22+
const val targetSdk = 28
23+
const val minSdk = 16
24+
}
25+
626
object Plugins {
7-
const val android =
8-
"com.android.tools.build:gradle:${Versions.Plugins.android}"
9-
const val kotlin =
10-
"org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.Plugins.kotlin}"
11-
const val mokoResources =
12-
"dev.icerock.moko:resources-generator:${Versions.Plugins.mokoResources}"
27+
val androidApplication = GradlePlugin(id = "com.android.application")
28+
val androidLibrary = GradlePlugin(id = "com.android.library")
29+
val kotlinJvm = GradlePlugin(id = "org.jetbrains.kotlin.jvm")
30+
val kotlinMultiplatform = GradlePlugin(id = "org.jetbrains.kotlin.multiplatform")
31+
val kotlinKapt = GradlePlugin(id = "kotlin-kapt")
32+
val kotlinAndroid = GradlePlugin(id = "kotlin-android")
33+
val kotlinAndroidExtensions = GradlePlugin(id = "kotlin-android-extensions")
34+
val kotlinSerialization = GradlePlugin(id = "kotlin-serialization")
35+
val mavenPublish = GradlePlugin(id = "org.gradle.maven-publish")
36+
37+
val mobileMultiplatform = GradlePlugin(id = "dev.icerock.mobile.multiplatform")
38+
val iosFramework = GradlePlugin(id = "dev.icerock.mobile.multiplatform.ios-framework")
39+
40+
val mokoResources = GradlePlugin(
41+
id = "dev.icerock.mobile.multiplatform-resources",
42+
module = "dev.icerock.moko:resources-generator:$mokoResourcesVersion"
43+
)
44+
45+
val detekt = GradlePlugin(
46+
id = "io.gitlab.arturbosch.detekt",
47+
version = detektVersion
48+
)
1349
}
1450

1551
object Libs {
1652
object Android {
17-
val kotlinStdLib = AndroidLibrary(
18-
name = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}"
19-
)
20-
val appCompat = AndroidLibrary(
21-
name = "androidx.appcompat:appcompat:${Versions.Libs.Android.appCompat}"
22-
)
23-
val lifecycle = AndroidLibrary(
24-
name = "androidx.lifecycle:lifecycle-extensions:${Versions.Libs.Android.lifecycle}"
25-
)
26-
val material = AndroidLibrary(
27-
name = "com.google.android.material:material:${Versions.Libs.Android.material}"
28-
)
53+
const val appCompat = "androidx.appcompat:appcompat:$androidAppCompatVersion"
54+
const val material = "com.google.android.material:material:$materialDesignVersion"
55+
const val lifecycle = "androidx.lifecycle:lifecycle-extensions:$androidLifecycleVersion"
56+
const val coroutines =
57+
"org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"
2958
}
3059

3160
object MultiPlatform {
32-
val kotlinStdLib = MultiPlatformLibrary(
33-
android = Android.kotlinStdLib.name,
34-
common = "org.jetbrains.kotlin:kotlin-stdlib-common:${Versions.kotlin}"
35-
)
36-
val coroutines = MultiPlatformLibrary(
37-
android = "org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.Libs.MultiPlatform.coroutines}",
38-
common = "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:${Versions.Libs.MultiPlatform.coroutines}",
39-
ios = "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:${Versions.Libs.MultiPlatform.coroutines}"
40-
)
41-
val mokoErrors = MultiPlatformLibrary(
42-
common = "dev.icerock.moko:errors:${Versions.Libs.MultiPlatform.mokoErrors}",
43-
iosX64 = "dev.icerock.moko:errors-iosx64:${Versions.Libs.MultiPlatform.mokoErrors}",
44-
iosArm64 = "dev.icerock.moko:errors-iosarm64:${Versions.Libs.MultiPlatform.mokoErrors}"
45-
)
46-
val mokoMvvm = MultiPlatformLibrary(
47-
common = "dev.icerock.moko:mvvm:${Versions.Libs.MultiPlatform.mokoMvvm}",
48-
iosX64 = "dev.icerock.moko:mvvm-iosx64:${Versions.Libs.MultiPlatform.mokoMvvm}",
49-
iosArm64 = "dev.icerock.moko:mvvm-iosarm64:${Versions.Libs.MultiPlatform.mokoMvvm}"
50-
)
51-
val mokoResources = MultiPlatformLibrary(
52-
common = "dev.icerock.moko:resources:${Versions.Libs.MultiPlatform.mokoResources}",
53-
iosX64 = "dev.icerock.moko:resources-iosx64:${Versions.Libs.MultiPlatform.mokoResources}",
54-
iosArm64 = "dev.icerock.moko:resources-iosarm64:${Versions.Libs.MultiPlatform.mokoResources}"
55-
)
61+
const val coroutines =
62+
"org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
63+
const val mokoResources =
64+
"dev.icerock.moko:resources:$mokoResourcesVersion"
65+
const val mokoMvvm = "dev.icerock.moko:mvvm:$mokoMvvmVersion"
66+
const val mokoErrors = "dev.icerock.moko:errors:$mokoErrorsVersion"
5667
}
57-
}
5868

59-
val plugins: Map<String, String> = mapOf(
60-
"com.android.application" to Plugins.android,
61-
"com.android.library" to Plugins.android,
62-
"org.jetbrains.kotlin.multiplatform" to Plugins.kotlin,
63-
"dev.icerock.mobile.multiplatform-resources" to Plugins.mokoResources,
64-
"kotlin-kapt" to Plugins.kotlin,
65-
"kotlin-android" to Plugins.kotlin
66-
)
67-
}
69+
object Tests {
70+
const val kotlinTestJUnit =
71+
"org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
72+
const val androidCoreTesting =
73+
"androidx.arch.core:core-testing:$androidCoreTestingVersion"
74+
}
75+
76+
object Detekt {
77+
const val detektFormatting =
78+
"io.gitlab.arturbosch.detekt:detekt-formatting:$detektVersion"
79+
}
80+
}
81+
}

buildSrc/src/main/kotlin/Versions.kt

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

errors/build.gradle.kts

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,29 @@
33
*/
44

55
plugins {
6-
id("com.android.library")
7-
id("org.jetbrains.kotlin.multiplatform")
8-
id("kotlin-android-extensions")
9-
id("dev.icerock.mobile.multiplatform")
10-
id("dev.icerock.mobile.multiplatform-resources")
11-
id("maven-publish")
6+
plugin(Deps.Plugins.androidLibrary)
7+
plugin(Deps.Plugins.kotlinMultiplatform)
8+
plugin(Deps.Plugins.kotlinAndroidExtensions)
9+
plugin(Deps.Plugins.mobileMultiplatform)
10+
plugin(Deps.Plugins.mokoResources)
11+
plugin(Deps.Plugins.mavenPublish)
1212
}
1313

1414
group = "dev.icerock.moko"
15-
version = Versions.Libs.MultiPlatform.mokoErrors
16-
17-
android {
18-
compileSdkVersion(Versions.Android.compileSdk)
19-
20-
defaultConfig {
21-
minSdkVersion(Versions.Android.minSdk)
22-
targetSdkVersion(Versions.Android.targetSdk)
23-
}
24-
}
15+
version = Deps.mokoErrorsVersion
2516

2617
dependencies {
27-
mppLibrary(Deps.Libs.MultiPlatform.kotlinStdLib)
18+
commonMainImplementation(Deps.Libs.MultiPlatform.coroutines)
19+
20+
androidMainImplementation(Deps.Libs.Android.appCompat)
21+
androidMainImplementation(Deps.Libs.Android.material)
2822

29-
androidLibrary(Deps.Libs.Android.appCompat)
30-
androidLibrary(Deps.Libs.Android.material)
23+
commonMainImplementation(Deps.Libs.MultiPlatform.mokoMvvm)
24+
commonMainApi(Deps.Libs.MultiPlatform.mokoResources)
3125

32-
mppLibrary(Deps.Libs.MultiPlatform.mokoMvvm)
33-
mppLibrary(Deps.Libs.MultiPlatform.mokoResources)
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")
3429
}
3530

3631
multiplatformResources {

errors/src/iosArm64Main

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)