Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
name: KMP library publish
name: Create release

on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version'
default: '0.1.0'
required: true

jobs:
build:
publish:
name: Publish library at mavenCentral
runs-on: macOS-latest
env:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_KEY: ${{ secrets.OSSRH_KEY }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEYID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.GPG_KEY_CONTENTS }}

steps:
- uses: actions/checkout@v1
Expand All @@ -15,4 +26,21 @@ jobs:
with:
java-version: 1.8
- name: Publish
run: ./gradlew publishAllPublicationsToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }}
run: ./gradlew publish

release:
name: Create release
needs: publish
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commitish: ${{ github.ref }}
tag_name: release/${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
body: "Will be filled later"
draft: true
10 changes: 7 additions & 3 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.4.0-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://img.shields.io/badge/kotlin-1.4.31-orange)

# Mobile Kotlin errors
This is a Kotlin MultiPlatform library that provides automatic exception handling and
Expand Down Expand Up @@ -34,6 +34,7 @@ on the platforms. Converts the exception class to an error object to display. Th
- iOS version 9.0+

## Versions
### Bintray
- kotlin 1.3.72
- 0.1.0
- 0.2.0
Expand All @@ -42,21 +43,24 @@ on the platforms. Converts the exception class to an error object to display. Th
- 0.3.0
- kotlin 1.4.21
- 0.3.1
### mavenCentral
- kotlin 1.4.31
- 0.3.2

## Installation
root build.gradle
```groovy
allprojects {
repositories {
maven { url = "https://dl.bintray.com/icerockdev/moko" }
mavenCentral()
}
}
```

project build.gradle
```groovy
dependencies {
commonMainApi("dev.icerock.moko:errors:0.3.1")
commonMainApi("dev.icerock.moko:errors:0.3.2")
}
```

Expand Down
18 changes: 9 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@

buildscript {
repositories {
jcenter()
mavenCentral()
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") }
gradlePluginPortal()
}

dependencies {
Expand All @@ -24,12 +21,15 @@ plugins {

allprojects {
repositories {
mavenCentral()
google()
jcenter()

maven { url = uri("https://kotlin.bintray.com/kotlin") }
maven { url = uri("https://kotlin.bintray.com/kotlinx") }
maven { url = uri("https://dl.bintray.com/icerockdev/moko") }
jcenter {
content {
includeGroup("org.jetbrains.trove4j")
includeGroup("org.jetbrains.kotlinx")
}
}
}

plugins.withId(Deps.Plugins.androidLibrary.id) {
Expand Down
18 changes: 10 additions & 8 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
*/

plugins {
id("org.jetbrains.kotlin.jvm") version("1.4.21")
id("org.jetbrains.kotlin.jvm") version("1.4.31")
}

repositories {
mavenLocal()

jcenter()
mavenCentral()
google()

maven { url = uri("https://dl.bintray.com/icerockdev/plugins") }
jcenter {
content {
includeGroup("org.jetbrains.trove4j")
}
}
}

dependencies {
implementation("dev.icerock:mobile-multiplatform:0.7.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21")
implementation("com.android.tools.build:gradle:4.0.1")
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")
}
9 changes: 5 additions & 4 deletions buildSrc/src/main/kotlin/Deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

object Deps {
private const val kotlinVersion = "1.4.21"
private const val kotlinVersion = "1.4.31"

private const val androidAppCompatVersion = "1.1.0"
private const val materialDesignVersion = "1.0.0"
Expand All @@ -13,9 +13,9 @@ object Deps {
private const val detektVersion = "1.7.4"

private const val coroutinesVersion = "1.4.2"
private const val mokoMvvmVersion = "0.9.0"
private const val mokoResourcesVersion = "0.14.0"
const val mokoErrorsVersion = "0.3.1"
private const val mokoMvvmVersion = "0.9.2"
private const val mokoResourcesVersion = "0.15.1"
const val mokoErrorsVersion = "0.3.2"

object Android {
const val compileSdk = 28
Expand All @@ -33,6 +33,7 @@ object Deps {
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")
Expand Down
65 changes: 61 additions & 4 deletions errors/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
* 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)
}

group = "dev.icerock.moko"
Expand All @@ -32,13 +36,66 @@ multiplatformResources {
multiplatformResourcesPackage = "dev.icerock.moko.errors"
}

val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}

publishing {
repositories.maven("https://api.bintray.com/maven/icerockdev/moko/moko-errors/;publish=1") {
name = "bintray"
repositories.maven("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
name = "OSSRH"

credentials {
username = System.getProperty("BINTRAY_USER")
password = System.getProperty("BINTRAY_KEY")
username = System.getenv("OSSRH_USER")
password = System.getenv("OSSRH_KEY")
}
}

publications.withType<MavenPublication> {
// 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)
}
}
}

4 changes: 0 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.mpp.enableCompatibilityMetadataVariant=true

android.useAndroidX=true

# Workaround for Bintray treating .sha512 files as artifacts
# https://github.com/gradle/gradle/issues/11412
systemProp.org.gradle.internal.publish.checksums.insecure=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion sample/mpp-library/MultiPlatformLibrary.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'MultiPlatformLibrary'
spec.version = '0.3.1'
spec.version = '0.3.2'
spec.homepage = 'Link to a Kotlin/Native module homepage'
spec.source = { :git => "Not Published", :tag => "Cocoapods/#{spec.name}/#{spec.version}" }
spec.authors = 'IceRock Development'
Expand Down