Skip to content

Commit

Permalink
Merge pull request #143 from icerockdev/develop
Browse files Browse the repository at this point in the history
Release 0.16.0
  • Loading branch information
anton6tak authored Jun 29, 2021
2 parents 14efef9 + cbd66b0 commit 0833335
Show file tree
Hide file tree
Showing 35 changed files with 437 additions and 536 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/compilation-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +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: Build K/N cache
run: ./gradlew :network:runCommonizer
java-version: 11
- name: Check plugin
run: ./gradlew -p network-generator detekt build publishToMavenLocal
- name: Check runtime
run: ./gradlew detekt build publishToMavenLocal
run: ./gradlew detekt build publishToMavenLocal syncMultiPlatformLibraryDebugFrameworkIosX64
- 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
8 changes: 3 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +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
- name: Build K/N cache
run: ./gradlew :network:runCommonizer
java-version: 11
- name: Publish plugin
run: ./gradlew -p network-generator publishMavenJavaPublicationToOSSRHRepository
- name: Publish library
Expand All @@ -44,6 +42,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
45 changes: 5 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
![moko-network](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/network) ](https://repo1.maven.org/maven2/dev/icerock/moko/network) ![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/network) ](https://repo1.maven.org/maven2/dev/icerock/moko/network) ![kotlin-version](https://kotlin-version.aws.icerock.dev/kotlin-version?group=dev.icerock.moko&name=network)
# Mobile Kotlin network components
This is a Kotlin MultiPlatform library that provide network components for iOS & Android. Library is
addition to [ktor-client](https://github.com/ktorio/ktor) with gradle plugin to generate entities
Expand All @@ -24,43 +23,9 @@ This is a Kotlin MultiPlatform library that provide network components for iOS &
- **RefreshTokenFeature** feature to ktor-client that handle Unauthorized response from server, try to update token and repeat failed request in case, when token update was successful;

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

## Versions
### Bintray
- kotlin 1.3.50
- 0.1.0
- 0.1.1
- kotlin 1.3.61
- 0.2.0
- 0.3.0
- 0.4.0
- 0.5.0
- 0.5.1
- kotlin 1.3.70
- 0.6.0
- 0.7.0
- kotlin 1.4.10
- 0.8.0
- kotlin 1.4.21
- 0.9.0
- 0.9.1
- 0.9.2
- 0.9.3
- 0.10.0
- kotlin 1.4.31
- 0.11.0
- 0.12.0
- 0.13.0
### mavenCentral
- 0.14.0
- 0.14.1
- 0.14.2
- 0.15.0
- 0.15.1
- 0.15.2
- iOS version 11.0+

## Installation
root build.gradle
Expand All @@ -71,7 +36,7 @@ buildscript {
}
dependencies {
classpath "dev.icerock.moko:network-generator:0.15.2"
classpath "dev.icerock.moko:network-generator:0.16.0"
}
}
Expand All @@ -88,7 +53,7 @@ project build.gradle
apply plugin: "dev.icerock.mobile.multiplatform-network-generator"
dependencies {
commonMainApi("dev.icerock.moko:network:0.15.2")
commonMainApi("dev.icerock.moko:network:0.16.0")
}
```

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

import java.util.Base64

plugins {
id("io.gitlab.arturbosch.detekt") version("1.15.0") apply(false)
}
import org.gradle.api.internal.artifacts.DefaultModuleVersionSelector

buildscript {
repositories {
Expand All @@ -15,107 +10,27 @@ buildscript {
gradlePluginPortal()
}
dependencies {
classpath("dev.icerock.moko:resources-generator:0.15.1")
classpath("dev.icerock.moko:resources-generator:0.16.0")
classpath("dev.icerock.moko:network-generator") // substituted
classpath("org.jetbrains.kotlin:kotlin-serialization:1.4.31")
classpath("gradle:network-deps:1")
classpath("org.jetbrains.kotlin:kotlin-serialization:1.5.20")

classpath(":network-build-logic")
}
}

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

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

dependencies {
"detektPlugins"(Deps.Libs.Detekt.detektFormatting)
}

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)
}
}
}

plugins.withId(Deps.Plugins.mavenPublish.id) {
plugins.withId("org.gradle.maven-publish") {
group = "dev.icerock.moko"
version = Deps.mokoNetworkVersion

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

configure<PublishingExtension> {
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<MavenPublication> {
// Stub javadoc.jar artifact
artifact(javadocJar.get())

// Provide artifacts information requited by Maven Central
pom {
name.set("MOKO network")
description.set("Network components with codegeneration of rest api for mobile (android & ios) Kotlin Multiplatform development")
url.set("https://github.com/icerockdev/moko-network")
licenses {
license {
url.set("https://github.com/icerockdev/moko-network/blob/master/LICENSE.md")
}
}

developers {
developer {
id.set("Alex009")
name.set("Aleksey Mikhailov")
email.set("aleksey.mikhailov@icerockdev.com")
}
developer {
id.set("Tetraquark")
name.set("Vladislav Areshkin")
email.set("vareshkin@icerockdev.com")
}
developer {
id.set("Dorofeev")
name.set("Andrey Dorofeev")
email.set("adorofeev@icerockdev.com")
}
}

scm {
connection.set("scm:git:ssh://github.com/icerockdev/moko-network.git")
developerConnection.set("scm:git:ssh://github.com/icerockdev/moko-network.git")
url.set("https://github.com/icerockdev/moko-network")
}
}
}

apply(plugin = "signing")

configure<SigningExtension> {
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(publications)
}
}
version = libs.versions.mokoNetworkVersion.get()
}
configurations.configureEach {
resolutionStrategy {
val coroutines: MinimalExternalModuleDependency = rootProject.libs.coroutines.get()
val forcedCoroutines: ModuleVersionSelector = DefaultModuleVersionSelector.newSelector(
coroutines.module,
coroutines.versionConstraint.requiredVersion
)
force(forcedCoroutines)
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ org.gradle.configureondemand=false
org.gradle.parallel=true

kotlin.code.style=official

kotlin.mpp.stability.nowarn=true
kotlin.native.enableDependencyPropagation=false
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.mpp.enableCompatibilityMetadataVariant=true
Expand Down
56 changes: 56 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[versions]
kotlinVersion = "1.5.20"

lifecycleVersion = "2.2.0"
glideVersion = "4.9.0"
androidAppCompatVersion = "1.2.0"
espressoCoreVersion = "3.2.0"
testRunnerVersion = "1.2.0"
testExtJunitVersion = "1.1.1"
androidxTestVersion = "1.3.0"
robolectricVersion = "4.3"
openApiGeneratorVersion = "5.1.0"
guavaVersion = "30.1-jre"
kotlinxSerializationVersion = "1.1.0"
coroutinesVersion = "1.5.0-native-mt"
ktorClientVersion = "1.6.0"
mokoResourcesVersion = "0.16.0"
mokoMvvmVersion = "0.11.0"
mokoErrorsVersion = "0.4.0"
mokoTestVersion = "0.4.0"
mokoNetworkVersion = "0.16.0"
kbignumVersion = "2.0.6"

[libraries]
appCompat = { module = "androidx.appcompat:appcompat", version.ref = "androidAppCompatVersion" }
glide = { module = "com.github.bumptech.glide:glide", version.ref = "glideVersion" }
lifecycle = { module = "androidx.lifecycle:lifecycle-extensions", version.ref = "lifecycleVersion" }
ktorClientOkHttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktorClientVersion" }
mokoMvvmDataBinding = { module = "dev.icerock.moko:mvvm-databinding", version.ref = "mokoMvvmVersion" }
espressoCore = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCoreVersion" }
kotlinTestJUnit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlinVersion" }
testCore = { module = "androidx.test:core", version.ref = "androidxTestVersion" }
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectricVersion" }
testRunner = { module = "androidx.test:runner", version.ref = "testRunnerVersion" }
testRules = { module = "androidx.test:rules", version.ref = "testRunnerVersion" }
testExtJunit = { module = "androidx.test.ext:junit", version.ref = "testExtJunitVersion" }
kotlinSerialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationVersion" }
coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutinesVersion" }
ktorClient = { module = "io.ktor:ktor-client-core", version.ref = "ktorClientVersion" }
ktorClientLogging = { module = "io.ktor:ktor-client-logging", version.ref = "ktorClientVersion" }
ktorClientMock = { module = "io.ktor:ktor-client-mock", version.ref = "ktorClientVersion" }
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" }
mokoErrors = { module = "dev.icerock.moko:errors", version.ref = "mokoErrorsVersion" }
mokoNetwork = { module = "dev.icerock.moko:network", version.ref = "mokoNetworkVersion" }
mokoNetworkErrors = { module = "dev.icerock.moko:network-errors", version.ref = "mokoNetworkVersion" }
mokoNetworkBignum = { module = "dev.icerock.moko:network-bignum", version.ref = "mokoNetworkVersion" }
kbignum = { module = "com.soywiz.korlibs.kbignum:kbignum", version.ref = "kbignumVersion" }
kotlinTest = { module = "org.jetbrains.kotlin:kotlin-test-common", version.ref = "kotlinVersion" }
kotlinTestAnnotations = { module = "org.jetbrains.kotlin:kotlin-test-annotations-common", version.ref = "kotlinVersion" }
mokoTest = { module = "dev.icerock.moko:test-core", version.ref = "mokoTestVersion" }
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinVersion" }
ktorClientIos = { module = "io.ktor:ktor-client-ios", version.ref = "ktorClientVersion" }
openApiGenerator = { module = "org.openapitools:openapi-generator-gradle-plugin", version.ref = "openApiGeneratorVersion" }
guava = { module = "com.google.guava:guava", version.ref = "guavaVersion" }
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.8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
14 changes: 7 additions & 7 deletions network-bignum/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
*/

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.multiplatform")
id("dev.icerock.mobile.multiplatform")
id("org.gradle.maven-publish")
id("multiplatform-library-convention")
id("dev.icerock.mobile.multiplatform.android-manifest")
id("publication-convention")
id("javadoc-stub-convention")
}

dependencies {
commonMainImplementation(Deps.Libs.MultiPlatform.kotlinSerialization)
commonMainApi(Deps.Libs.MultiPlatform.kbignum)
commonMainImplementation(libs.kotlinSerialization)
commonMainApi(libs.kbignum)

commonMainImplementation(project(":network"))
commonMainImplementation(projects.network)
}
17 changes: 17 additions & 0 deletions network-build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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")
}
Original file line number Diff line number Diff line change
@@ -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")
}
}
Loading

0 comments on commit 0833335

Please sign in to comment.