Skip to content

Commit

Permalink
Merge pull request #201 from icerockdev/develop
Browse files Browse the repository at this point in the history
Release 0.21.0
  • Loading branch information
Alex009 authored Apr 16, 2023
2 parents cb36f3a + b980c73 commit 5fc13ff
Show file tree
Hide file tree
Showing 51 changed files with 453 additions and 104 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ buildscript {
}
dependencies {
classpath "dev.icerock.moko:network-generator:0.20.1"
classpath "dev.icerock.moko:network-generator:0.21.0"
}
}
Expand All @@ -53,10 +53,10 @@ project build.gradle
apply plugin: "dev.icerock.mobile.multiplatform-network-generator"
dependencies {
commonMainApi("dev.icerock.moko:network:0.20.1")
commonMainApi("dev.icerock.moko:network-engine:0.20.1") // configured HttpClientEngine
commonMainApi("dev.icerock.moko:network-bignum:0.20.1") // kbignum serializer
commonMainApi("dev.icerock.moko:network-errors:0.20.1") // moko-errors integration
commonMainApi("dev.icerock.moko:network:0.21.0")
commonMainApi("dev.icerock.moko:network-engine:0.21.0") // configured HttpClientEngine
commonMainApi("dev.icerock.moko:network-bignum:0.21.0") // kbignum serializer
commonMainApi("dev.icerock.moko:network-errors:0.21.0") // moko-errors integration
}
```

Expand Down
10 changes: 3 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,16 @@ 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

kotlin.native.binary.memoryModel=experimental
kotlin.mpp.androidSourceSetLayoutVersion=2

android.useAndroidX=true

mobile.multiplatform.iosTargetWarning=false

xcodeproj=./sample/ios-app

moko.android.targetSdk=30
moko.android.compileSdk=30
moko.android.targetSdk=33
moko.android.compileSdk=33
moko.android.minSdk=16

moko.publish.name=MOKO network
Expand Down
40 changes: 21 additions & 19 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
[versions]
kotlinVersion = "1.6.20"
kotlinVersion = "1.8.10"

# android
lifecycleViewModelVersion = "2.3.1"
glideVersion = "4.12.0"
androidAppCompatVersion = "1.3.0"
lifecycleViewModelVersion = "2.6.1"
glideVersion = "4.14.2"
androidAppCompatVersion = "1.6.1"
coreKtxVersion = "1.10.0"

# jvm
openApiGeneratorVersion = "5.2.0"
guavaVersion = "30.1-jre"

# kotlinx
kotlinxSerializationVersion = "1.3.2"
coroutinesVersion = "1.6.0-native-mt"
kotlinxSerializationVersion = "1.5.0"
coroutinesVersion = "1.6.4"

# moko
mokoResourcesVersion = "0.20.1"
mokoMvvmVersion = "0.12.0"
mokoErrorsVersion = "0.6.0"
mokoResourcesVersion = "0.21.2"
mokoMvvmVersion = "0.16.0"
mokoErrorsVersion = "0.7.0"
mokoTestVersion = "0.6.1"
mokoNetworkVersion = "0.20.1"
mokoNetworkVersion = "0.21.0"

# tests
espressoCoreVersion = "3.2.0"
testRunnerVersion = "1.2.0"
testExtJunitVersion = "1.1.1"
androidxTestVersion = "1.3.0"
robolectricVersion = "4.6.1"
espressoCoreVersion = "3.5.1"
testRunnerVersion = "1.5.0"
testExtJunitVersion = "1.1.5"
androidxTestVersion = "1.5.0"
robolectricVersion = "4.9"

# other
ktorClientVersion = "2.0.1"
ktorClientVersion = "2.2.2"
kbignumVersion = "2.4.12"
multidexVersion = "2.0.1"

Expand All @@ -39,6 +40,7 @@ appCompat = { module = "androidx.appcompat:appcompat", version.ref = "androidApp
glide = { module = "com.github.bumptech.glide:glide", version.ref = "glideVersion" }
lifecycleViewModel = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycleViewModelVersion" }
multidex = { module = "androidx.multidex:multidex", version.ref = "multidexVersion" }
coreKtx = { module = "androidx.core:core-ktx", version.ref = "coreKtxVersion" }

# kotlinx
kotlinSerialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationVersion" }
Expand Down Expand Up @@ -70,7 +72,7 @@ robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectr
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" }
kotlinTest = { module = "org.jetbrains.kotlin:kotlin-test-common", version.ref = "kotlinVersion" }
kotlinTest = { module = "org.jetbrains.kotlin:kotlin-test-junit", 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" }

Expand All @@ -81,6 +83,6 @@ guava = { module = "com.google.guava:guava", version.ref = "guavaVersion" }
# gradle plugins
kotlinGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinVersion" }
kotlinSerializationGradlePlugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlinVersion" }
androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "7.0.4" }
androidGradlePlugin = { module = "com.android.tools.build:gradle", version = "7.4.2" }
mokoResourcesGradlePlugin = { module = "dev.icerock.moko:resources-generator", version.ref = "mokoResourcesVersion" }
mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.1.0" }
mokoGradlePlugin = { module = "dev.icerock.moko:moko-gradle-plugin", version = "0.3.0" }
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-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 4 additions & 0 deletions network-bignum/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ plugins {
id("dev.icerock.moko.gradle.stub.javadoc")
}

android {
namespace = "dev.icerock.moko.network.bignum"
}

kotlin {
jvm()
}
Expand Down
2 changes: 0 additions & 2 deletions network-bignum/src/androidMain/AndroidManifest.xml

This file was deleted.

4 changes: 4 additions & 0 deletions network-engine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ plugins {
id("dev.icerock.moko.gradle.tests")
}

android {
namespace = "dev.icerock.moko.network.engine"
}

kotlin {
jvm()

Expand Down
2 changes: 0 additions & 2 deletions network-engine/src/androidMain/AndroidManifest.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

@file:Suppress("Filename")

package dev.icerock.moko.network

import io.ktor.client.engine.HttpClientEngine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
* Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

@file:Suppress("Filename")

package dev.icerock.moko.network

import io.ktor.client.engine.HttpClientEngine
Expand Down
4 changes: 4 additions & 0 deletions network-errors/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ plugins {
id("dev.icerock.moko.gradle.stub.javadoc")
}

android {
namespace = "dev.icerock.moko.network.errors"
}

dependencies {
commonMainImplementation(libs.kotlinSerialization)

Expand Down
2 changes: 0 additions & 2 deletions network-errors/src/androidMain/AndroidManifest.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package dev.icerock.moko.network.errors

import dev.icerock.moko.errors.MR
import dev.icerock.moko.errors.mappers.ExceptionMappersStorage
import dev.icerock.moko.network.SSLExceptionType
import dev.icerock.moko.network.exceptions.ErrorException
Expand All @@ -30,7 +31,7 @@ fun ExceptionMappersStorage.registerAllNetworkMappers(
return condition<StringDesc>(
condition = { it.isNetworkConnectionError() },
mapper = { errorsTexts.networkConnectionErrorText.desc() }
).condition<StringDesc>(
).condition(
condition = { it.isSSLException() },
mapper = {
getSSLExceptionStringDescMapper(
Expand All @@ -46,7 +47,7 @@ fun ExceptionMappersStorage.registerAllNetworkMappers(
errorException = it,
httpNetworkErrorsTexts = errorsTexts.httpNetworkErrorsTexts
)
}.register<ValidationException, StringDesc>(::validationExceptionStringDescMapper)
}.register(::validationExceptionStringDescMapper)
}

/**
Expand All @@ -67,7 +68,8 @@ private fun getNetworkErrorExceptionStringDescMapper(
httpStatusCode
)
}
else -> errorException.description?.desc() ?: ExceptionMappersStorage.getFallbackValue()

else -> MR.strings.moko_errors_unknownError.desc()
}
}

Expand All @@ -88,7 +90,7 @@ private fun getSSLExceptionStringDescMapper(
SSLExceptionType.ClientCertificateRejected -> sslNetworkErrorsTexts.clientCertificateRejected.desc()
SSLExceptionType.ClientCertificateRequired -> sslNetworkErrorsTexts.clientCertificateRequired.desc()
SSLExceptionType.CannotLoadFromNetwork -> sslNetworkErrorsTexts.cannotLoadFromNetwork.desc()
else -> ExceptionMappersStorage.getFallbackValue()
else -> MR.strings.moko_errors_unknownError.desc()
}
}

Expand Down
2 changes: 0 additions & 2 deletions network-errors/src/iosMain/kotlin/Dummy.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
* Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

package dev.icerock.moko.network.errors

// required for produce `metadata/iosMain`
internal val sDummyVar: Int? = null
2 changes: 2 additions & 0 deletions network-generator/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ dependencyResolutionManagement {
}
}
}

rootProject.name = "network-generator"
Loading

0 comments on commit 5fc13ff

Please sign in to comment.