-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from skydoves/feature/sandwich-ktor
Implement sandwich-ktor module
- Loading branch information
Showing
13 changed files
with
691 additions
and
14 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
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 @@ | ||
/build |
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,18 @@ | ||
public final class com/skydoves/sandwich/ktor/ApiResponseExtensionKt { | ||
public static final fun bodyChannel (Lcom/skydoves/sandwich/ApiResponse$Failure$Error;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public static final fun bodyString (Lcom/skydoves/sandwich/ApiResponse$Failure$Error;Ljava/nio/charset/Charset;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; | ||
public static synthetic fun bodyString$default (Lcom/skydoves/sandwich/ApiResponse$Failure$Error;Ljava/nio/charset/Charset;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; | ||
public static final fun getHeaders (Lcom/skydoves/sandwich/ApiResponse$Failure$Error;)Lio/ktor/http/Headers; | ||
public static final fun getHeaders (Lcom/skydoves/sandwich/ApiResponse$Success;)Lio/ktor/http/Headers; | ||
public static final fun getHttpResponse (Lcom/skydoves/sandwich/ApiResponse$Success;)Lio/ktor/client/statement/HttpResponse; | ||
public static final fun getPayloadResponse (Lcom/skydoves/sandwich/ApiResponse$Failure$Error;)Lio/ktor/client/statement/HttpResponse; | ||
public static final fun getStatusCode (Lcom/skydoves/sandwich/ApiResponse$Failure$Error;)Lcom/skydoves/sandwich/StatusCode; | ||
public static final fun getStatusCode (Lcom/skydoves/sandwich/ApiResponse$Success;)Lcom/skydoves/sandwich/StatusCode; | ||
public static final fun getStatusCode (Lio/ktor/client/statement/HttpResponse;)Lcom/skydoves/sandwich/StatusCode; | ||
public static final fun getTagResponse (Lcom/skydoves/sandwich/ApiResponse$Success;)Lio/ktor/client/statement/HttpResponse; | ||
} | ||
|
||
public synthetic class com/skydoves/sandwich/ktor/ApiResponseExtensionKt$EntriesMappings { | ||
public static final synthetic field entries$0 Lkotlin/enums/EnumEntries; | ||
} | ||
|
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,126 @@ | ||
/* | ||
* Designed and developed by 2020 skydoves (Jaewoong Eum) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import com.github.skydoves.sandwich.Configuration | ||
|
||
plugins { | ||
id(libs.plugins.kotlin.multiplatform.get().pluginId) | ||
id(libs.plugins.kotlin.serialization.get().pluginId) | ||
id(libs.plugins.nexus.plugin.get().pluginId) | ||
java | ||
} | ||
|
||
apply(from = "${rootDir}/scripts/publish-module.gradle.kts") | ||
|
||
mavenPublishing { | ||
pom { | ||
version = rootProject.extra.get("libVersion").toString() | ||
group = Configuration.artifactGroup | ||
} | ||
} | ||
|
||
kotlin { | ||
jvmToolchain(11) | ||
jvm { | ||
compilations.all { | ||
kotlinOptions.jvmTarget = libs.versions.jvmTarget.get() | ||
} | ||
withJava() | ||
} | ||
ios() | ||
iosSimulatorArm64() | ||
macosArm64() | ||
macosX64() | ||
|
||
sourceSets { | ||
all { languageSettings.optIn("kotlin.contracts.ExperimentalContracts") } | ||
val commonMain by getting { | ||
dependencies { | ||
api(project(":sandwich")) | ||
api(libs.ktor.core) | ||
implementation(libs.coroutines) | ||
} | ||
} | ||
|
||
val commonTest by getting { | ||
dependencies { | ||
dependsOn(commonMain) | ||
} | ||
} | ||
|
||
val jvmMain by getting | ||
|
||
val jvmTest by getting | ||
|
||
val appleTest by creating { | ||
dependsOn(commonTest) | ||
} | ||
val appleMain by creating { | ||
dependsOn(commonMain) | ||
} | ||
val iosMain by getting { | ||
dependsOn(appleMain) | ||
} | ||
val macosArm64Main by getting { | ||
dependsOn(appleMain) | ||
} | ||
val macosX64Main by getting { | ||
dependsOn(appleMain) | ||
} | ||
val iosSimulatorArm64Main by getting { | ||
dependsOn(appleMain) | ||
} | ||
|
||
val iosArm64Main by getting { | ||
dependsOn(appleTest) | ||
} | ||
val iosArm64Test by getting { | ||
dependsOn(appleTest) | ||
} | ||
|
||
val iosX64Main by getting { | ||
dependsOn(appleTest) | ||
} | ||
val iosX64Test by getting { | ||
dependsOn(appleTest) | ||
} | ||
|
||
val iosTest by getting { | ||
dependsOn(appleTest) | ||
} | ||
val iosSimulatorArm64Test by getting { | ||
dependsOn(appleTest) | ||
} | ||
val macosX64Test by getting { | ||
dependsOn(appleTest) | ||
} | ||
val macosArm64Test by getting { | ||
dependsOn(appleTest) | ||
} | ||
} | ||
|
||
explicitApi() | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
} | ||
|
||
tasks.withType(JavaCompile::class.java).configureEach { | ||
this.targetCompatibility = JavaVersion.VERSION_11.toString() | ||
this.sourceCompatibility = JavaVersion.VERSION_11.toString() | ||
} |
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,3 @@ | ||
POM_ARTIFACT_ID=sandwich-ktor | ||
POM_NAME=sandwich-ktor | ||
POM_DESCRIPTION=A lightweight and pluggable sealed API library for modeling Retrofit responses and handling exceptions on Kotlin and Android. |
Oops, something went wrong.