-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
#192 move http client engine dependencies to separated module
- Loading branch information
Showing
15 changed files
with
102 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ on: | |
|
||
jobs: | ||
build: | ||
runs-on: macOS-latest | ||
runs-on: macOS-11 | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
plugins { | ||
id("dev.icerock.moko.gradle.multiplatform.mobile") | ||
id("dev.icerock.moko.gradle.detekt") | ||
id("dev.icerock.moko.gradle.publication") | ||
id("dev.icerock.moko.gradle.stub.javadoc") | ||
id("dev.icerock.moko.gradle.tests") | ||
} | ||
|
||
kotlin { | ||
jvm() | ||
|
||
sourceSets { | ||
val commonMain by getting | ||
|
||
val commonJvmAndroid = create("commonJvmAndroid") { | ||
dependsOn(commonMain) | ||
dependencies { | ||
api(libs.ktorClientOkHttp) | ||
} | ||
} | ||
|
||
val androidMain by getting { | ||
dependsOn(commonJvmAndroid) | ||
} | ||
|
||
val jvmMain by getting { | ||
dependsOn(commonJvmAndroid) | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
commonMainImplementation(libs.coroutines) | ||
commonMainApi(projects.network) | ||
iosMainApi(libs.ktorClientIos) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest package="dev.icerock.moko.network.engine" /> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
network/src/iosMain/kotlin/dev/icerock/moko/network/ThrowableToNSErrorMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright 2023 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package dev.icerock.moko.network | ||
|
||
import platform.Foundation.NSError | ||
import kotlin.native.concurrent.AtomicReference | ||
|
||
object ThrowableToNSErrorMapper : (Throwable) -> NSError? { | ||
private val mapperRef: AtomicReference<((Throwable) -> NSError?)?> = AtomicReference(null) | ||
|
||
override fun invoke(throwable: Throwable): NSError? { | ||
return requireNotNull(mapperRef.value) { "please setup ThrowableToNSErrorMapper by call ThrowableToNSErrorMapper.setup() in iosMain or use dev.icerock.moko.network.createHttpClientEngine" } | ||
.invoke(throwable) | ||
} | ||
|
||
fun setup(block: (Throwable) -> NSError?) { | ||
mapperRef.value = block | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters