mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-06 01:26:12 +00:00
[kotlin-client][multiplatform] update dependency versions (#17180)
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
||||
|
||||
plugins {
|
||||
kotlin("multiplatform") version "1.7.21" // kotlin_version
|
||||
kotlin("plugin.serialization") version "1.7.21" // kotlin_version
|
||||
kotlin("multiplatform") version "1.9.20" // kotlin_version
|
||||
kotlin("plugin.serialization") version "1.9.20" // kotlin_version
|
||||
}
|
||||
|
||||
group = "org.openapitools"
|
||||
version = "1.0.0"
|
||||
|
||||
val kotlin_version = "1.7.21"
|
||||
val coroutines_version = "1.6.4"
|
||||
val serialization_version = "1.3.3"
|
||||
val ktor_version = "2.2.3"
|
||||
val kotlin_version = "1.9.20"
|
||||
val coroutines_version = "1.7.3"
|
||||
val serialization_version = "1.6.1"
|
||||
val ktor_version = "2.3.6"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -19,15 +19,16 @@ repositories {
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
ios { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
||||
iosSimulatorArm64 { binaries { framework { freeCompilerArgs += "-Xobjc-generics" } } }
|
||||
iosX64()
|
||||
iosArm64()
|
||||
iosSimulatorArm64()
|
||||
js {
|
||||
browser()
|
||||
nodejs()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
commonMain {
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_version")
|
||||
@@ -37,53 +38,42 @@ kotlin {
|
||||
api("io.ktor:ktor-client-content-negotiation:$ktor_version")
|
||||
api("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")
|
||||
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.0")
|
||||
api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1")
|
||||
}
|
||||
}
|
||||
|
||||
val commonTest by getting {
|
||||
commonTest {
|
||||
dependencies {
|
||||
implementation(kotlin("test"))
|
||||
implementation("io.ktor:ktor-client-mock:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jvmMain by getting {
|
||||
jvmMain {
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib-jdk7"))
|
||||
implementation("io.ktor:ktor-client-cio-jvm:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jvmTest by getting {
|
||||
jvmTest {
|
||||
dependencies {
|
||||
implementation(kotlin("test-junit"))
|
||||
}
|
||||
}
|
||||
|
||||
val iosMain by getting {
|
||||
iosMain {
|
||||
dependencies {
|
||||
api("io.ktor:ktor-client-ios:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val iosTest by getting
|
||||
|
||||
val iosSimulatorArm64Main by getting
|
||||
|
||||
val iosSimulatorArm64Test by getting
|
||||
|
||||
iosSimulatorArm64Main.dependsOn(iosMain)
|
||||
iosSimulatorArm64Test.dependsOn(iosTest)
|
||||
|
||||
val jsMain by getting {
|
||||
dependencies {
|
||||
api("io.ktor:ktor-client-js:$ktor_version")
|
||||
}
|
||||
}
|
||||
|
||||
val jsTest by getting
|
||||
|
||||
all {
|
||||
languageSettings.apply {
|
||||
optIn("kotlin.Experimental")
|
||||
|
||||
@@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.*
|
||||
import kotlinx.serialization.encoding.*
|
||||
|
||||
@Serializable
|
||||
@Serializable(Base64ByteArray.Companion::class)
|
||||
class Base64ByteArray(val value: ByteArray) {
|
||||
@Serializer(Base64ByteArray::class)
|
||||
companion object : KSerializer<Base64ByteArray> {
|
||||
override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING)
|
||||
override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64())
|
||||
|
||||
@@ -82,6 +82,7 @@ private fun ByteReadPacket.encodeBase64(): String = buildString {
|
||||
*
|
||||
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket {
|
||||
val data = ByteArray(4)
|
||||
|
||||
|
||||
@@ -4,9 +4,8 @@ import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.*
|
||||
import kotlinx.serialization.encoding.*
|
||||
|
||||
@Serializable
|
||||
@Serializable(OctetByteArray.Companion::class)
|
||||
class OctetByteArray(val value: ByteArray) {
|
||||
@Serializer(OctetByteArray::class)
|
||||
companion object : KSerializer<OctetByteArray> {
|
||||
override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING)
|
||||
override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value))
|
||||
|
||||
Reference in New Issue
Block a user