diff --git a/.github/workflows/compilation-check.yml b/.github/workflows/compilation-check.yml index f236606..b92c307 100644 --- a/.github/workflows/compilation-check.yml +++ b/.github/workflows/compilation-check.yml @@ -12,9 +12,13 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up JDK 1.8 + - name: Set up JDK 11 uses: actions/setup-java@v1 with: - java-version: 1.8 - - name: Check build - run: ./gradlew detekt build publishToMavenLocal + java-version: 11 + - name: Build and publish local + run: ./gradlew build publishToMavenLocal syncMultiPlatformLibraryDebugFrameworkIosX64 + - name: Install pods + run: cd sample/ios-app && pod install + - name: Check iOS + run: cd sample/ios-app && xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug -sdk iphonesimulator -arch x86_64 build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9395a86..4949eb8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,10 +21,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up JDK 1.8 + - name: Set up JDK 11 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 11 - name: Publish run: ./gradlew publish @@ -41,6 +41,6 @@ jobs: with: commitish: ${{ github.ref }} tag_name: release/${{ github.event.inputs.version }} - release_name: Release ${{ github.event.inputs.version }} + release_name: ${{ github.event.inputs.version }} body: "Will be filled later" draft: true diff --git a/README.md b/README.md index 4fddd51..e45ff5f 100755 --- a/README.md +++ b/README.md @@ -1,7 +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://img.shields.io/maven-central/v/dev.icerock.moko/errors) ](https://repo1.maven.org/maven2/dev/icerock/moko/errors) ![kotlin-version](https://img.shields.io/badge/kotlin-1.4.31-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://img.shields.io/maven-central/v/dev.icerock.moko/errors) ](https://repo1.maven.org/maven2/dev/icerock/moko/errors) ![kotlin-version](https://kotlin-version.aws.icerock.dev/kotlin-version?group=dev.icerock.moko&name=errors) # Mobile Kotlin errors This is a Kotlin MultiPlatform library that provides automatic exception handling and automatic error displaying to a screen. @@ -9,7 +8,6 @@ automatic error displaying to a screen. ## Table of Contents - [Features](#features) - [Requirements](#requirements) -- [Versions](#versions) - [Installation](#installation) - [Usage](#usage) - [Samples](#samples) @@ -29,23 +27,9 @@ 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 6.0+ +- Gradle version 6.8+ - Android API 16+ -- iOS version 9.0+ - -## Versions -### Bintray -- kotlin 1.3.72 - - 0.1.0 - - 0.2.0 - - 0.2.1 -- kotlin 1.4.0 - - 0.3.0 -- kotlin 1.4.21 - - 0.3.1 -### mavenCentral - - kotlin 1.4.31 - - 0.3.2 +- iOS version 11.0+ ## Installation root build.gradle @@ -60,7 +44,7 @@ allprojects { project build.gradle ```groovy dependencies { - commonMainApi("dev.icerock.moko:errors:0.3.2") + commonMainApi("dev.icerock.moko:errors:0.4.0") } ``` diff --git a/build.gradle.kts b/build.gradle.kts index 9b3540b..dde05d6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,47 +11,20 @@ buildscript { } dependencies { - plugin(Deps.Plugins.mokoResources) - } -} + classpath("dev.icerock.moko:resources-generator:0.16.0") -plugins { - plugin(Deps.Plugins.detekt).apply(false) + classpath(":errors-build-logic") + } } allprojects { - repositories { - mavenCentral() - google() - - jcenter { - content { - includeGroup("org.jetbrains.trove4j") - includeGroup("org.jetbrains.kotlinx") - } - } - } - - plugins.withId(Deps.Plugins.androidLibrary.id) { - configure { - compileSdkVersion(Deps.Android.compileSdk) - defaultConfig { - minSdkVersion(Deps.Android.minSdk) - targetSdkVersion(Deps.Android.targetSdk) - } + allprojects { + plugins.withId("org.gradle.maven-publish") { + group = "dev.icerock.moko" + version = libs.versions.mokoErrorsVersion.get() } } - - apply(plugin = Deps.Plugins.detekt.id) - - configure { - input.setFrom("src/commonMain/kotlin", "src/androidMain/kotlin", "src/iosMain/kotlin") - } - - dependencies { - "detektPlugins"(Deps.Libs.Detekt.detektFormatting) - } } tasks.register("clean", Delete::class).configure { diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts deleted file mode 100644 index 24825a7..0000000 --- a/buildSrc/build.gradle.kts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. - */ - -plugins { - id("org.jetbrains.kotlin.jvm") version("1.4.31") -} - -repositories { - mavenCentral() - google() - - jcenter { - content { - includeGroup("org.jetbrains.trove4j") - } - } -} - -dependencies { - implementation("dev.icerock:mobile-multiplatform:0.9.1") - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31") - implementation("com.android.tools.build:gradle:4.1.2") -} diff --git a/buildSrc/src/main/kotlin/Deps.kt b/buildSrc/src/main/kotlin/Deps.kt deleted file mode 100755 index e4d3026..0000000 --- a/buildSrc/src/main/kotlin/Deps.kt +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. - */ - -object Deps { - private const val kotlinVersion = "1.4.31" - - 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.15.0" - - private const val coroutinesVersion = "1.4.2" - private const val mokoMvvmVersion = "0.9.2" - private const val mokoResourcesVersion = "0.15.1" - const val mokoErrorsVersion = "0.3.3" - - object Android { - const val compileSdk = 28 - const val targetSdk = 28 - const val minSdk = 16 - } - - object Plugins { - 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 signing = GradlePlugin(id = "signing") - - 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 { - 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" - - const val mokoMvvmDataBinding = "dev.icerock.moko:mvvm-databinding:$mokoMvvmVersion" - } - - object MultiPlatform { - const val coroutines = - "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion" - const val mokoResources = - "dev.icerock.moko:resources:$mokoResourcesVersion" - const val mokoMvvmCore = "dev.icerock.moko:mvvm-core:$mokoMvvmVersion" - const val mokoMvvmLiveData = "dev.icerock.moko:mvvm-livedata:$mokoMvvmVersion" - const val mokoErrors = "dev.icerock.moko:errors:$mokoErrorsVersion" - } - - 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" - } - } -} diff --git a/errors-build-logic/build.gradle.kts b/errors-build-logic/build.gradle.kts new file mode 100644 index 0000000..84cbae3 --- /dev/null +++ b/errors-build-logic/build.gradle.kts @@ -0,0 +1,17 @@ +plugins { + `kotlin-dsl` +} + +repositories { + mavenCentral() + google() + + gradlePluginPortal() +} + +dependencies { + api("dev.icerock:mobile-multiplatform:0.12.0") + api("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20") + api("com.android.tools.build:gradle:4.2.1") + api("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.15.0") +} diff --git a/errors-build-logic/src/main/kotlin/android-app-convention.gradle.kts b/errors-build-logic/src/main/kotlin/android-app-convention.gradle.kts new file mode 100644 index 0000000..2859874 --- /dev/null +++ b/errors-build-logic/src/main/kotlin/android-app-convention.gradle.kts @@ -0,0 +1,32 @@ +/* + * Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. + */ + +plugins { + id("com.android.application") + id("android-base-convention") + id("kotlin-android") +} + +android { + dexOptions { + javaMaxHeapSize = "2g" + } + + buildTypes { + getByName("release") { + isMinifyEnabled = true + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + getByName("debug") { + isDebuggable = true + applicationIdSuffix = ".debug" + } + } + + packagingOptions { + exclude("META-INF/*.kotlin_module") + exclude("META-INF/AL2.0") + exclude("META-INF/LGPL2.1") + } +} diff --git a/errors-build-logic/src/main/kotlin/android-base-convention.gradle.kts b/errors-build-logic/src/main/kotlin/android-base-convention.gradle.kts new file mode 100644 index 0000000..7f67285 --- /dev/null +++ b/errors-build-logic/src/main/kotlin/android-base-convention.gradle.kts @@ -0,0 +1,14 @@ +/* + * Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. + */ + +import com.android.build.gradle.BaseExtension + +configure { + compileSdkVersion(30) + + defaultConfig { + minSdkVersion(16) + targetSdkVersion(30) + } +} diff --git a/errors-build-logic/src/main/kotlin/android-library-convention.gradle.kts b/errors-build-logic/src/main/kotlin/android-library-convention.gradle.kts new file mode 100644 index 0000000..c435401 --- /dev/null +++ b/errors-build-logic/src/main/kotlin/android-library-convention.gradle.kts @@ -0,0 +1,13 @@ +/* + * Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. + */ + +plugins { + id("com.android.library") + id("kotlin-android") + id("android-base-convention") +} + +android { + sourceSets.all { java.srcDir("src/$name/kotlin") } +} diff --git a/errors-build-logic/src/main/kotlin/android-publication-convention.gradle.kts b/errors-build-logic/src/main/kotlin/android-publication-convention.gradle.kts new file mode 100644 index 0000000..b4dae9e --- /dev/null +++ b/errors-build-logic/src/main/kotlin/android-publication-convention.gradle.kts @@ -0,0 +1,15 @@ +/* + * Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. + */ + +plugins { + id("publication-convention") +} + +afterEvaluate { + publishing.publications { + create("release", MavenPublication::class.java) { + from(components.getByName("release")) + } + } +} diff --git a/errors-build-logic/src/main/kotlin/detekt-convention.gradle.kts b/errors-build-logic/src/main/kotlin/detekt-convention.gradle.kts new file mode 100644 index 0000000..68343a8 --- /dev/null +++ b/errors-build-logic/src/main/kotlin/detekt-convention.gradle.kts @@ -0,0 +1,15 @@ +/* + * Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. + */ + +plugins { + id("io.gitlab.arturbosch.detekt") +} + +detekt { + input.setFrom("src/commonMain/kotlin", "src/androidMain/kotlin", "src/iosMain/kotlin", "src/main/kotlin") +} + +dependencies { + "detektPlugins"("io.gitlab.arturbosch.detekt:detekt-formatting:1.15.0") +} diff --git a/errors-build-logic/src/main/kotlin/javadoc-stub-convention.gradle.kts b/errors-build-logic/src/main/kotlin/javadoc-stub-convention.gradle.kts new file mode 100644 index 0000000..a1a2691 --- /dev/null +++ b/errors-build-logic/src/main/kotlin/javadoc-stub-convention.gradle.kts @@ -0,0 +1,16 @@ +/* + * Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. + */ + +plugins { + id("org.gradle.maven-publish") +} + +val javadocJar by tasks.registering(Jar::class) { + archiveClassifier.set("javadoc") +} + +publishing.publications.withType { + // Stub javadoc.jar artifact + artifact(javadocJar.get()) +} diff --git a/errors-build-logic/src/main/kotlin/multiplatform-library-convention.gradle.kts b/errors-build-logic/src/main/kotlin/multiplatform-library-convention.gradle.kts new file mode 100644 index 0000000..f203934 --- /dev/null +++ b/errors-build-logic/src/main/kotlin/multiplatform-library-convention.gradle.kts @@ -0,0 +1,17 @@ +/* + * Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. + */ + +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.multiplatform") + id("android-base-convention") + id("dev.icerock.mobile.multiplatform.android-manifest") +} + +kotlin { + android { + publishLibraryVariants("release", "debug") + } + ios() +} diff --git a/errors-build-logic/src/main/kotlin/publication-convention.gradle.kts b/errors-build-logic/src/main/kotlin/publication-convention.gradle.kts new file mode 100644 index 0000000..1597ccd --- /dev/null +++ b/errors-build-logic/src/main/kotlin/publication-convention.gradle.kts @@ -0,0 +1,65 @@ +/* + * Copyright 2021 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. + */ + +import java.util.Base64 + +plugins { + id("javadoc-stub-convention") + id("org.gradle.maven-publish") + id("signing") +} + +publishing { + repositories.maven("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") { + name = "OSSRH" + + credentials { + username = System.getenv("OSSRH_USER") + password = System.getenv("OSSRH_KEY") + } + } + + publications.withType { + // Provide artifacts information requited by Maven Central + pom { + name.set("MOKO errors") + description.set("Automated exceptions handler for mobile (android & ios) Kotlin Multiplatform development.") + url.set("https://github.com/icerockdev/moko-errors") + licenses { + license { + name.set("Apache-2.0") + distribution.set("repo") + url.set("https://github.com/icerockdev/moko-errors/blob/master/LICENSE.md") + } + } + + developers { + developer { + id.set("Alex009") + name.set("Aleksey Mikhailov") + email.set("aleksey.mikhailov@icerockdev.com") + } + } + + scm { + connection.set("scm:git:ssh://github.com/icerockdev/moko-errors.git") + developerConnection.set("scm:git:ssh://github.com/icerockdev/moko-errors.git") + url.set("https://github.com/icerockdev/moko-errors") + } + } + } +} + + +signing { + val signingKeyId: String? = System.getenv("SIGNING_KEY_ID") + val signingPassword: String? = System.getenv("SIGNING_PASSWORD") + val signingKey: String? = System.getenv("SIGNING_KEY")?.let { base64Key -> + String(Base64.getDecoder().decode(base64Key)) + } + if (signingKeyId != null) { + useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) + sign(publishing.publications) + } +} diff --git a/errors/build.gradle.kts b/errors/build.gradle.kts index 0560403..59eab3b 100644 --- a/errors/build.gradle.kts +++ b/errors/build.gradle.kts @@ -2,100 +2,28 @@ * Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. */ -import java.util.Base64 -import kotlin.text.String - plugins { - plugin(Deps.Plugins.androidLibrary) - plugin(Deps.Plugins.kotlinMultiplatform) - plugin(Deps.Plugins.kotlinAndroidExtensions) - plugin(Deps.Plugins.mobileMultiplatform) - plugin(Deps.Plugins.mokoResources) - plugin(Deps.Plugins.mavenPublish) - plugin(Deps.Plugins.signing) + id("multiplatform-library-convention") + id("kotlin-parcelize") + id("dev.icerock.mobile.multiplatform-resources") + id("detekt-convention") + id("publication-convention") } group = "dev.icerock.moko" -version = Deps.mokoErrorsVersion +version = libs.versions.mokoErrorsVersion.get() dependencies { - commonMainImplementation(Deps.Libs.MultiPlatform.coroutines) - - androidMainImplementation(Deps.Libs.Android.appCompat) - androidMainImplementation(Deps.Libs.Android.material) + commonMainImplementation(libs.coroutines) - commonMainImplementation(Deps.Libs.MultiPlatform.mokoMvvmCore) - commonMainApi(Deps.Libs.MultiPlatform.mokoResources) + "androidMainImplementation"(libs.appCompat) + "androidMainImplementation"(libs.material) - // 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") + commonMainImplementation(libs.mokoMvvmCore) + commonMainApi(libs.mokoResources) } multiplatformResources { multiplatformResourcesPackage = "dev.icerock.moko.errors" } -val javadocJar by tasks.registering(Jar::class) { - archiveClassifier.set("javadoc") -} - -publishing { - repositories.maven("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") { - name = "OSSRH" - - credentials { - username = System.getenv("OSSRH_USER") - password = System.getenv("OSSRH_KEY") - } - } - - publications.withType { - // Stub javadoc.jar artifact - artifact(javadocJar.get()) - - // Provide artifacts information requited by Maven Central - pom { - name.set("MOKO errors") - description.set("Automated exceptions handler for mobile (android & ios) Kotlin Multiplatform development.") - url.set("https://github.com/icerockdev/moko-errors") - licenses { - license { - url.set("https://github.com/icerockdev/moko-errors/blob/master/LICENSE.md") - } - } - - developers { - developer { - id.set("Tetraquark") - name.set("Vladislav Areshkin") - email.set("vareshkin@icerockdev.com") - } - developer { - id.set("Alex009") - name.set("Aleksey Mikhailov") - email.set("aleksey.mikhailov@icerockdev.com") - } - } - - scm { - connection.set("scm:git:ssh://github.com/icerockdev/moko-errors.git") - developerConnection.set("scm:git:ssh://github.com/icerockdev/moko-errors.git") - url.set("https://github.com/icerockdev/moko-errors") - } - } - } - - signing { - val signingKeyId: String? = System.getenv("SIGNING_KEY_ID") - val signingPassword: String? = System.getenv("SIGNING_PASSWORD") - val signingKey: String? = System.getenv("SIGNING_KEY")?.let { base64Key -> - String(Base64.getDecoder().decode(base64Key)) - } - if (signingKeyId != null) { - useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) - sign(publishing.publications) - } - } -} - diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..7a19ea0 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,22 @@ +[versions] +kotlinVersion = "1.5.20" +androidAppCompatVersion = "1.2.0" +materialDesignVersion = "1.0.0" +androidLifecycleVersion = "2.1.0" +androidCoreTestingVersion = "2.1.0" +coroutinesVersion = "1.5.0-native-mt" +mokoMvvmVersion = "0.11.0" +mokoResourcesVersion = "0.16.0" +mokoErrorsVersion = "0.4.0" + +[libraries] +appCompat = { module = "androidx.appcompat:appcompat", version.ref = "androidAppCompatVersion" } +material = { module = "com.google.android.material:material", version.ref = "materialDesignVersion" } +lifecycle = { module = "androidx.lifecycle:lifecycle-extensions", version.ref = "androidLifecycleVersion" } +coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutinesVersion" } +mokoMvvmDataBinding = { module = "dev.icerock.moko:mvvm-databinding", version.ref = "mokoMvvmVersion" } +mokoResources = { module = "dev.icerock.moko:resources", version.ref = "mokoResourcesVersion" } +mokoMvvmCore = { module = "dev.icerock.moko:mvvm-core", version.ref = "mokoMvvmVersion" } +mokoMvvmLiveData = { module = "dev.icerock.moko:mvvm-livedata", version.ref = "mokoMvvmVersion" } +kotlinTestJUnit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlinVersion" } +androidCoreTesting = { module = "androidx.arch.core:core-testing", version.ref = "androidCoreTestingVersion" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 442d913..0f80bbf 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/sample/android-app/build.gradle.kts b/sample/android-app/build.gradle.kts index fa6f520..312d433 100644 --- a/sample/android-app/build.gradle.kts +++ b/sample/android-app/build.gradle.kts @@ -3,52 +3,27 @@ */ plugins { - plugin(Deps.Plugins.androidApplication) - plugin(Deps.Plugins.kotlinAndroid) - plugin(Deps.Plugins.kotlinKapt) + id("android-app-convention") + id("detekt-convention") + id("kotlin-kapt") } android { - compileSdkVersion(Deps.Android.compileSdk) - buildFeatures.dataBinding = true - dexOptions { - javaMaxHeapSize = "2g" - } - defaultConfig { - minSdkVersion(Deps.Android.minSdk) - targetSdkVersion(Deps.Android.targetSdk) - applicationId = "dev.icerock.moko.samples.errors" versionCode = 1 versionName = "0.1.0" - vectorDrawables.useSupportLibrary = true testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } - - buildTypes { - getByName("release") { - isMinifyEnabled = false - proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") - } - getByName("debug") { - isDebuggable = true - applicationIdSuffix = ".debug" - } - } - - packagingOptions { - exclude("META-INF/*.kotlin_module") - } } dependencies { - implementation(Deps.Libs.Android.appCompat) - implementation(Deps.Libs.Android.mokoMvvmDataBinding) + implementation(libs.appCompat) + implementation(libs.mokoMvvmDataBinding) - implementation(project(":sample:mpp-library")) + implementation(projects.sample.mppLibrary) } diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts deleted file mode 100644 index 5e6ece0..0000000 --- a/sample/build.gradle.kts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. - */ - -subprojects { - configurations.all { - resolutionStrategy.dependencySubstitution { - substitute(module(Deps.Libs.MultiPlatform.mokoErrors)) - .with(project(":errors")) - } - } -} diff --git a/sample/ios-app/Podfile.lock b/sample/ios-app/Podfile.lock index 957ec9c..04fd3f3 100644 --- a/sample/ios-app/Podfile.lock +++ b/sample/ios-app/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - MultiPlatformLibrary (0.3.1) + - MultiPlatformLibrary (0.3.2) DEPENDENCIES: - MultiPlatformLibrary (from `../mpp-library`) @@ -9,8 +9,8 @@ EXTERNAL SOURCES: :path: "../mpp-library" SPEC CHECKSUMS: - MultiPlatformLibrary: 5f0f4dfd4a95a1b6e698631cc4425e922ab03125 + MultiPlatformLibrary: 977eec0a79d59711bba1652e58f27ba94abb371d PODFILE CHECKSUM: e8746dc30e9d53a96c59e8f821148cde03ea8c5b -COCOAPODS: 1.9.3 +COCOAPODS: 1.10.1 diff --git a/sample/ios-app/TestProj.xcodeproj/project.pbxproj b/sample/ios-app/TestProj.xcodeproj/project.pbxproj index a4687d1..9e541b1 100644 --- a/sample/ios-app/TestProj.xcodeproj/project.pbxproj +++ b/sample/ios-app/TestProj.xcodeproj/project.pbxproj @@ -112,7 +112,7 @@ 287627FB1F319065007FA12B /* Sources */, 287627FC1F319065007FA12B /* Frameworks */, 287627FD1F319065007FA12B /* Resources */, - FADF86CC777E571DCF62AACC /* [CP] Embed Pods Frameworks */, + 587327CC3950A42DF058CD2B /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -173,41 +173,41 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - DDE4C06D580BF457BEDF8D0A /* [CP] Check Pods Manifest.lock */ = { + 587327CC3950A42DF058CD2B /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-TestProj-checkManifestLockResult.txt", - ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TestProj/Pods-TestProj-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - FADF86CC777E571DCF62AACC /* [CP] Embed Pods Frameworks */ = { + DDE4C06D580BF457BEDF8D0A /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( ); - name = "[CP] Embed Pods Frameworks"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-TestProj-checkManifestLockResult.txt", + ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TestProj/Pods-TestProj-frameworks.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -273,6 +273,7 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 4VU932NX78; INFOPLIST_FILE = src/Info.plist; + ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = dev.icerock.moko.sample.errors; PRODUCT_NAME = "moko-errors"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -291,6 +292,7 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 4VU932NX78; INFOPLIST_FILE = src/Info.plist; + ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = dev.icerock.moko.sample.errors; PRODUCT_NAME = "moko-errors"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/sample/mpp-library/build.gradle.kts b/sample/mpp-library/build.gradle.kts index 369dd03..84dc52c 100644 --- a/sample/mpp-library/build.gradle.kts +++ b/sample/mpp-library/build.gradle.kts @@ -3,22 +3,29 @@ */ plugins { - plugin(Deps.Plugins.androidLibrary) - plugin(Deps.Plugins.kotlinMultiplatform) - plugin(Deps.Plugins.mobileMultiplatform) - plugin(Deps.Plugins.mokoResources) - plugin(Deps.Plugins.iosFramework) + id("com.android.library") + id("android-base-convention") + id("detekt-convention") + id("org.jetbrains.kotlin.multiplatform") + id("dev.icerock.mobile.multiplatform.android-manifest") + id("dev.icerock.mobile.multiplatform-resources") + id("dev.icerock.mobile.multiplatform.ios-framework") +} + +kotlin { + android() + ios() } dependencies { - commonMainImplementation(Deps.Libs.MultiPlatform.coroutines) + commonMainImplementation(libs.coroutines) - commonMainImplementation(Deps.Libs.MultiPlatform.mokoResources) - commonMainApi(Deps.Libs.MultiPlatform.mokoErrors) - commonMainApi(Deps.Libs.MultiPlatform.mokoMvvmCore) - commonMainApi(Deps.Libs.MultiPlatform.mokoMvvmLiveData) + commonMainImplementation(libs.mokoResources) + commonMainApi(projects.errors) + commonMainApi(libs.mokoMvvmCore) + commonMainApi(libs.mokoMvvmLiveData) - androidMainImplementation(Deps.Libs.Android.lifecycle) + "androidMainImplementation"(libs.lifecycle) } multiplatformResources { diff --git a/settings.gradle.kts b/settings.gradle.kts index 3696811..ee8f680 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,6 +1,26 @@ /* * Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. */ +/* + * Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. + */ +enableFeaturePreview("VERSION_CATALOGS") +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + +dependencyResolutionManagement { + repositories { + mavenCentral() + google() + + jcenter { + content { + includeGroup("org.jetbrains.kotlinx") + } + } + } +} + +includeBuild("errors-build-logic") include(":errors") include(":sample:android-app")