Skip to content

Commit

Permalink
Merge pull request #8 from icerockdev/develop
Browse files Browse the repository at this point in the history
Release 0.3.0
  • Loading branch information
Alex009 authored Sep 9, 2020
2 parents 1f4302b + 7188eea commit afa3ee5
Show file tree
Hide file tree
Showing 23 changed files with 208 additions and 257 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/compilation-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,5 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Check library build
run: ./gradlew -PlibraryPublish detekt :errors:publishToMavenLocal
- name: Check library sample
run: ./gradlew detekt :sample:mpp-library:build
- name: Check build
run: ./gradlew detekt build publishToMavenLocal
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
with:
java-version: 1.8
- name: Publish
run: ./gradlew -PlibraryPublish :errors:publishAllPublicationsToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }}
run: ./gradlew publishAllPublicationsToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }}
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![moko-errors](img/logo.png)

[![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)
[![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)

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

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

## Requirements
- Gradle version 5.6.4+
- Gradle version 6.0+
- Android API 16+
- iOS version 9.0+

Expand All @@ -38,6 +38,8 @@ on the platforms. Converts the exception class to an error object to display. Th
- 0.1.0
- 0.2.0
- 0.2.1
- kotlin 1.4.0
- 0.3.0

## Installation
root build.gradle
Expand All @@ -52,7 +54,7 @@ allprojects {
project build.gradle
```groovy
dependencies {
commonMainApi("dev.icerock.moko:errors:0.2.1")
commonMainApi("dev.icerock.moko:errors:0.3.0")
}
```

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

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

## Contributing
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`.
Expand Down
36 changes: 30 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,28 @@
* Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

buildscript {
repositories {
jcenter()
google()

maven { url = uri("https://dl.bintray.com/kotlin/kotlin") }
maven { url = uri("https://kotlin.bintray.com/kotlinx") }
maven { url = uri("https://plugins.gradle.org/m2/") }
maven { url = uri("https://dl.bintray.com/icerockdev/plugins") }
}

dependencies {
plugin(Deps.Plugins.mokoResources)
}
}

plugins {
id("io.gitlab.arturbosch.detekt") version Versions.detekt apply false
plugin(Deps.Plugins.detekt).apply(false)
}

allprojects {
repositories {
mavenLocal()

google()
jcenter()

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

apply(plugin = "io.gitlab.arturbosch.detekt")
plugins.withId(Deps.Plugins.androidLibrary.id) {
configure<com.android.build.gradle.LibraryExtension> {
compileSdkVersion(Deps.Android.compileSdk)

defaultConfig {
minSdkVersion(Deps.Android.minSdk)
targetSdkVersion(Deps.Android.targetSdk)
}
}
}

apply(plugin = Deps.Plugins.detekt.id)

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

dependencies {
"detektPlugins"("io.gitlab.arturbosch.detekt:detekt-formatting:${Versions.detekt}")
"detektPlugins"(Deps.Libs.Detekt.detektFormatting)
}
}

Expand Down
16 changes: 8 additions & 8 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/*
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
`kotlin-dsl`
id("org.jetbrains.kotlin.jvm") version("1.4.0")
}

repositories {
Expand All @@ -12,11 +16,7 @@ repositories {
}

dependencies {
implementation("dev.icerock:mobile-multiplatform:0.6.1")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72")
implementation("com.android.tools.build:gradle:3.6.3")
}

kotlinDslPluginOptions {
experimentalWarning.set(false)
implementation("dev.icerock:mobile-multiplatform:0.7.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0")
implementation("com.android.tools.build:gradle:4.0.1")
}
118 changes: 66 additions & 52 deletions buildSrc/src/main/kotlin/Deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,79 @@
*/

object Deps {
private const val kotlinVersion = "1.4.0"

private const val androidAppCompatVersion = "1.1.0"
private const val materialDesignVersion = "1.0.0"
private const val androidLifecycleVersion = "2.1.0"
private const val androidCoreTestingVersion = "2.1.0"

private const val detektVersion = "1.7.4"

private const val coroutinesVersion = "1.3.9"
private const val mokoMvvmVersion = "0.8.0"
private const val mokoResourcesVersion = "0.13.1"
const val mokoErrorsVersion = "0.3.0"

object Android {
const val compileSdk = 28
const val targetSdk = 28
const val minSdk = 16
}

object Plugins {
const val android =
"com.android.tools.build:gradle:${Versions.Plugins.android}"
const val kotlin =
"org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.Plugins.kotlin}"
const val mokoResources =
"dev.icerock.moko:resources-generator:${Versions.Plugins.mokoResources}"
val androidApplication = GradlePlugin(id = "com.android.application")
val androidLibrary = GradlePlugin(id = "com.android.library")
val kotlinJvm = GradlePlugin(id = "org.jetbrains.kotlin.jvm")
val kotlinMultiplatform = GradlePlugin(id = "org.jetbrains.kotlin.multiplatform")
val kotlinKapt = GradlePlugin(id = "kotlin-kapt")
val kotlinAndroid = GradlePlugin(id = "kotlin-android")
val kotlinAndroidExtensions = GradlePlugin(id = "kotlin-android-extensions")
val kotlinSerialization = GradlePlugin(id = "kotlin-serialization")
val mavenPublish = GradlePlugin(id = "org.gradle.maven-publish")

val mobileMultiplatform = GradlePlugin(id = "dev.icerock.mobile.multiplatform")
val iosFramework = GradlePlugin(id = "dev.icerock.mobile.multiplatform.ios-framework")

val mokoResources = GradlePlugin(
id = "dev.icerock.mobile.multiplatform-resources",
module = "dev.icerock.moko:resources-generator:$mokoResourcesVersion"
)

val detekt = GradlePlugin(
id = "io.gitlab.arturbosch.detekt",
version = detektVersion
)
}

object Libs {
object Android {
val kotlinStdLib = AndroidLibrary(
name = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}"
)
val appCompat = AndroidLibrary(
name = "androidx.appcompat:appcompat:${Versions.Libs.Android.appCompat}"
)
val lifecycle = AndroidLibrary(
name = "androidx.lifecycle:lifecycle-extensions:${Versions.Libs.Android.lifecycle}"
)
val material = AndroidLibrary(
name = "com.google.android.material:material:${Versions.Libs.Android.material}"
)
const val appCompat = "androidx.appcompat:appcompat:$androidAppCompatVersion"
const val material = "com.google.android.material:material:$materialDesignVersion"
const val lifecycle = "androidx.lifecycle:lifecycle-extensions:$androidLifecycleVersion"
const val coroutines =
"org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"
}

object MultiPlatform {
val kotlinStdLib = MultiPlatformLibrary(
android = Android.kotlinStdLib.name,
common = "org.jetbrains.kotlin:kotlin-stdlib-common:${Versions.kotlin}"
)
val coroutines = MultiPlatformLibrary(
android = "org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.Libs.MultiPlatform.coroutines}",
common = "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:${Versions.Libs.MultiPlatform.coroutines}",
ios = "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:${Versions.Libs.MultiPlatform.coroutines}"
)
val mokoErrors = MultiPlatformLibrary(
common = "dev.icerock.moko:errors:${Versions.Libs.MultiPlatform.mokoErrors}",
iosX64 = "dev.icerock.moko:errors-iosx64:${Versions.Libs.MultiPlatform.mokoErrors}",
iosArm64 = "dev.icerock.moko:errors-iosarm64:${Versions.Libs.MultiPlatform.mokoErrors}"
)
val mokoMvvm = MultiPlatformLibrary(
common = "dev.icerock.moko:mvvm:${Versions.Libs.MultiPlatform.mokoMvvm}",
iosX64 = "dev.icerock.moko:mvvm-iosx64:${Versions.Libs.MultiPlatform.mokoMvvm}",
iosArm64 = "dev.icerock.moko:mvvm-iosarm64:${Versions.Libs.MultiPlatform.mokoMvvm}"
)
val mokoResources = MultiPlatformLibrary(
common = "dev.icerock.moko:resources:${Versions.Libs.MultiPlatform.mokoResources}",
iosX64 = "dev.icerock.moko:resources-iosx64:${Versions.Libs.MultiPlatform.mokoResources}",
iosArm64 = "dev.icerock.moko:resources-iosarm64:${Versions.Libs.MultiPlatform.mokoResources}"
)
const val coroutines =
"org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
const val mokoResources =
"dev.icerock.moko:resources:$mokoResourcesVersion"
const val mokoMvvm = "dev.icerock.moko:mvvm:$mokoMvvmVersion"
const val mokoErrors = "dev.icerock.moko:errors:$mokoErrorsVersion"
}
}

val plugins: Map<String, String> = mapOf(
"com.android.application" to Plugins.android,
"com.android.library" to Plugins.android,
"org.jetbrains.kotlin.multiplatform" to Plugins.kotlin,
"dev.icerock.mobile.multiplatform-resources" to Plugins.mokoResources,
"kotlin-kapt" to Plugins.kotlin,
"kotlin-android" to Plugins.kotlin
)
}
object Tests {
const val kotlinTestJUnit =
"org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
const val androidCoreTesting =
"androidx.arch.core:core-testing:$androidCoreTestingVersion"
}

object Detekt {
const val detektFormatting =
"io.gitlab.arturbosch.detekt:detekt-formatting:$detektVersion"
}
}
}
44 changes: 0 additions & 44 deletions buildSrc/src/main/kotlin/Versions.kt

This file was deleted.

37 changes: 16 additions & 21 deletions errors/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,29 @@
*/

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.multiplatform")
id("kotlin-android-extensions")
id("dev.icerock.mobile.multiplatform")
id("dev.icerock.mobile.multiplatform-resources")
id("maven-publish")
plugin(Deps.Plugins.androidLibrary)
plugin(Deps.Plugins.kotlinMultiplatform)
plugin(Deps.Plugins.kotlinAndroidExtensions)
plugin(Deps.Plugins.mobileMultiplatform)
plugin(Deps.Plugins.mokoResources)
plugin(Deps.Plugins.mavenPublish)
}

group = "dev.icerock.moko"
version = Versions.Libs.MultiPlatform.mokoErrors

android {
compileSdkVersion(Versions.Android.compileSdk)

defaultConfig {
minSdkVersion(Versions.Android.minSdk)
targetSdkVersion(Versions.Android.targetSdk)
}
}
version = Deps.mokoErrorsVersion

dependencies {
mppLibrary(Deps.Libs.MultiPlatform.kotlinStdLib)
commonMainImplementation(Deps.Libs.MultiPlatform.coroutines)

androidMainImplementation(Deps.Libs.Android.appCompat)
androidMainImplementation(Deps.Libs.Android.material)

androidLibrary(Deps.Libs.Android.appCompat)
androidLibrary(Deps.Libs.Android.material)
commonMainImplementation(Deps.Libs.MultiPlatform.mokoMvvm)
commonMainApi(Deps.Libs.MultiPlatform.mokoResources)

mppLibrary(Deps.Libs.MultiPlatform.mokoMvvm)
mppLibrary(Deps.Libs.MultiPlatform.mokoResources)
// temporary fix of https://youtrack.jetbrains.com/issue/KT-41083
commonMainImplementation("dev.icerock.moko:parcelize:0.4.0")
commonMainImplementation("dev.icerock.moko:graphics:0.4.0")
}

multiplatformResources {
Expand Down
1 change: 0 additions & 1 deletion errors/src/iosArm64Main

This file was deleted.

Loading

0 comments on commit afa3ee5

Please sign in to comment.