File tree Expand file tree Collapse file tree 12 files changed +72
-90
lines changed
modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform
kotlin-array-simple-string-multiplatform
src/commonMain/kotlin/org/openapitools/client/infrastructure
kotlin-bigdecimal-default-multiplatform
src/commonMain/kotlin/org/openapitools/client/infrastructure
kotlin-default-values-multiplatform
src/commonMain/kotlin/org/openapitools/client/infrastructure
kotlin-multiplatform-kotlinx-datetime
src/commonMain/kotlin/org/openapitools/client/infrastructure
src/commonMain/kotlin/org/openapitools/client/infrastructure Expand file tree Collapse file tree 12 files changed +72
-90
lines changed Original file line number Diff line number Diff line change 11import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
22
33plugins {
4- kotlin(" multiplatform" ){{^omitGradlePluginVersions} } version "2.0 .21" // kotlin_version{ {/omitGradlePluginVersions} }
5- kotlin("plugin.serialization"){ {^omitGradlePluginVersions} } version "2.0 .21" // kotlin_version{ {/omitGradlePluginVersions} }
4+ kotlin(" multiplatform" ){{^omitGradlePluginVersions} } version "2.1 .21" // kotlin_version{ {/omitGradlePluginVersions} }
5+ kotlin("plugin.serialization"){ {^omitGradlePluginVersions} } version "2.1 .21" // kotlin_version{ {/omitGradlePluginVersions} }
66}
77
88group = "{ {groupId} }"
99version = "{ {artifactVersion} }"
1010
11- val kotlin_version = "2.0 .21"
12- val coroutines_version = "1.9.0 "
13- val serialization_version = "1.7.3 "
14- val ktor_version = "3.0 .3"
11+ val kotlin_version = "2.1 .21"
12+ val coroutines_version = "1.10.2 "
13+ val serialization_version = "1.8.1 "
14+ val ktor_version = "3.1 .3"
1515
1616repositories {
1717 mavenCentral()
@@ -43,7 +43,7 @@ kotlin {
4343 api(" io.ktor:ktor-serialization-kotlinx-json:$ktor_version" )
4444
4545 {{#kotlinx-datetime} }
46- api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1 ")
46+ api("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2 ")
4747 { {/kotlinx-datetime} }
4848 }
4949 }
@@ -79,12 +79,6 @@ kotlin {
7979 api(" io.ktor:ktor-client-js:$ktor_version" )
8080 }
8181 }
82-
83- all {
84- languageSettings.apply {
85- optIn(" kotlin.Experimental" )
86- }
87- }
8882 }
8983}
9084
Original file line number Diff line number Diff line change 11package { {packageName} }.infrastructure
22
33import io.ktor.utils.io.core.*
4+ import kotlinx.io.Source
5+ import kotlinx.io.readByteArray
46import kotlin.experimental.and
57
68private val digits = "0123456789abcdef".toCharArray()
@@ -14,7 +16,8 @@ private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it
1416private fun Int.toBase64(): Char = BASE64_ALPHABET[this]
1517private fun Byte.fromBase64(): Byte = BASE64_INVERSE_ALPHABET[toInt() and 0xff].toByte() and BASE64_MASK
1618internal fun ByteArray.encodeBase64(): String = buildPacket { writeFully(this@encodeBase64) } .encodeBase64()
17- internal fun String.decodeBase64Bytes(): ByteArray = buildPacket { writeText(dropLastWhile { it == BASE64_PAD } ) }.decodeBase64Bytes().readBytes()
19+ internal fun String.decodeBase64Bytes(): ByteArray =
20+ buildPacket { writeText(dropLastWhile { it == BASE64_PAD } ) }.decodeBase64Bytes().readByteArray()
1821
1922/**
2023 * Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
@@ -57,7 +60,7 @@ internal fun hex(s: String): ByteArray {
5760 *
5861 * Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
5962 */
60- private fun ByteReadPacket .encodeBase64(): String = buildString {
63+ private fun Source .encodeBase64(): String = buildString {
6164 val data = ByteArray(3)
6265 while (remaining > 0) {
6366 val read = readAvailable(data)
Original file line number Diff line number Diff line change 11import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
22
33plugins {
4- kotlin(" multiplatform" ) version " 2.0 .21" // kotlin_version
5- kotlin(" plugin.serialization" ) version " 2.0 .21" // kotlin_version
4+ kotlin(" multiplatform" ) version " 2.1 .21" // kotlin_version
5+ kotlin(" plugin.serialization" ) version " 2.1 .21" // kotlin_version
66}
77
88group = " org.openapitools"
99version = " 1.0.0"
1010
11- val kotlin_version = " 2.0 .21"
12- val coroutines_version = " 1.9.0 "
13- val serialization_version = " 1.7.3 "
14- val ktor_version = " 3.0 .3"
11+ val kotlin_version = " 2.1 .21"
12+ val coroutines_version = " 1.10.2 "
13+ val serialization_version = " 1.8.1 "
14+ val ktor_version = " 3.1 .3"
1515
1616repositories {
1717 mavenCentral()
@@ -38,7 +38,7 @@ kotlin {
3838 api(" io.ktor:ktor-client-content-negotiation:$ktor_version " )
3939 api(" io.ktor:ktor-serialization-kotlinx-json:$ktor_version " )
4040
41- api(" org.jetbrains.kotlinx:kotlinx-datetime:0.4.1 " )
41+ api(" org.jetbrains.kotlinx:kotlinx-datetime:0.6.2 " )
4242 }
4343 }
4444
@@ -73,12 +73,6 @@ kotlin {
7373 api(" io.ktor:ktor-client-js:$ktor_version " )
7474 }
7575 }
76-
77- all {
78- languageSettings.apply {
79- optIn(" kotlin.Experimental" )
80- }
81- }
8276 }
8377}
8478
Original file line number Diff line number Diff line change 11package org.openapitools.client.infrastructure
22
33import io.ktor.utils.io.core.*
4+ import kotlinx.io.Source
5+ import kotlinx.io.readByteArray
46import kotlin.experimental.and
57
68private val digits = " 0123456789abcdef" .toCharArray()
@@ -14,7 +16,8 @@ private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it
1416private fun Int.toBase64 (): Char = BASE64_ALPHABET [this ]
1517private fun Byte.fromBase64 (): Byte = BASE64_INVERSE_ALPHABET [toInt() and 0xff ].toByte() and BASE64_MASK
1618internal fun ByteArray.encodeBase64 (): String = buildPacket { writeFully(this @encodeBase64) }.encodeBase64()
17- internal fun String.decodeBase64Bytes (): ByteArray = buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readBytes()
19+ internal fun String.decodeBase64Bytes (): ByteArray =
20+ buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readByteArray()
1821
1922/* *
2023 * Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
@@ -57,7 +60,7 @@ internal fun hex(s: String): ByteArray {
5760 *
5861 * Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
5962 */
60- private fun ByteReadPacket .encodeBase64 (): String = buildString {
63+ private fun Source .encodeBase64 (): String = buildString {
6164 val data = ByteArray (3 )
6265 while (remaining > 0 ) {
6366 val read = readAvailable(data)
Original file line number Diff line number Diff line change 11import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
22
33plugins {
4- kotlin(" multiplatform" ) version " 2.0 .21" // kotlin_version
5- kotlin(" plugin.serialization" ) version " 2.0 .21" // kotlin_version
4+ kotlin(" multiplatform" ) version " 2.1 .21" // kotlin_version
5+ kotlin(" plugin.serialization" ) version " 2.1 .21" // kotlin_version
66}
77
88group = " org.openapitools"
99version = " 1.0.0"
1010
11- val kotlin_version = " 2.0 .21"
12- val coroutines_version = " 1.9.0 "
13- val serialization_version = " 1.7.3 "
14- val ktor_version = " 3.0 .3"
11+ val kotlin_version = " 2.1 .21"
12+ val coroutines_version = " 1.10.2 "
13+ val serialization_version = " 1.8.1 "
14+ val ktor_version = " 3.1 .3"
1515
1616repositories {
1717 mavenCentral()
@@ -38,7 +38,7 @@ kotlin {
3838 api(" io.ktor:ktor-client-content-negotiation:$ktor_version " )
3939 api(" io.ktor:ktor-serialization-kotlinx-json:$ktor_version " )
4040
41- api(" org.jetbrains.kotlinx:kotlinx-datetime:0.4.1 " )
41+ api(" org.jetbrains.kotlinx:kotlinx-datetime:0.6.2 " )
4242 }
4343 }
4444
@@ -73,12 +73,6 @@ kotlin {
7373 api(" io.ktor:ktor-client-js:$ktor_version " )
7474 }
7575 }
76-
77- all {
78- languageSettings.apply {
79- optIn(" kotlin.Experimental" )
80- }
81- }
8276 }
8377}
8478
Original file line number Diff line number Diff line change 11package org.openapitools.client.infrastructure
22
33import io.ktor.utils.io.core.*
4+ import kotlinx.io.Source
5+ import kotlinx.io.readByteArray
46import kotlin.experimental.and
57
68private val digits = " 0123456789abcdef" .toCharArray()
@@ -14,7 +16,8 @@ private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it
1416private fun Int.toBase64 (): Char = BASE64_ALPHABET [this ]
1517private fun Byte.fromBase64 (): Byte = BASE64_INVERSE_ALPHABET [toInt() and 0xff ].toByte() and BASE64_MASK
1618internal fun ByteArray.encodeBase64 (): String = buildPacket { writeFully(this @encodeBase64) }.encodeBase64()
17- internal fun String.decodeBase64Bytes (): ByteArray = buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readBytes()
19+ internal fun String.decodeBase64Bytes (): ByteArray =
20+ buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readByteArray()
1821
1922/* *
2023 * Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
@@ -57,7 +60,7 @@ internal fun hex(s: String): ByteArray {
5760 *
5861 * Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
5962 */
60- private fun ByteReadPacket .encodeBase64 (): String = buildString {
63+ private fun Source .encodeBase64 (): String = buildString {
6164 val data = ByteArray (3 )
6265 while (remaining > 0 ) {
6366 val read = readAvailable(data)
Original file line number Diff line number Diff line change 11import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
22
33plugins {
4- kotlin(" multiplatform" ) version " 2.0 .21" // kotlin_version
5- kotlin(" plugin.serialization" ) version " 2.0 .21" // kotlin_version
4+ kotlin(" multiplatform" ) version " 2.1 .21" // kotlin_version
5+ kotlin(" plugin.serialization" ) version " 2.1 .21" // kotlin_version
66}
77
88group = " org.openapitools"
99version = " 1.0.0"
1010
11- val kotlin_version = " 2.0 .21"
12- val coroutines_version = " 1.9.0 "
13- val serialization_version = " 1.7.3 "
14- val ktor_version = " 3.0 .3"
11+ val kotlin_version = " 2.1 .21"
12+ val coroutines_version = " 1.10.2 "
13+ val serialization_version = " 1.8.1 "
14+ val ktor_version = " 3.1 .3"
1515
1616repositories {
1717 mavenCentral()
@@ -38,7 +38,7 @@ kotlin {
3838 api(" io.ktor:ktor-client-content-negotiation:$ktor_version " )
3939 api(" io.ktor:ktor-serialization-kotlinx-json:$ktor_version " )
4040
41- api(" org.jetbrains.kotlinx:kotlinx-datetime:0.4.1 " )
41+ api(" org.jetbrains.kotlinx:kotlinx-datetime:0.6.2 " )
4242 }
4343 }
4444
@@ -73,12 +73,6 @@ kotlin {
7373 api(" io.ktor:ktor-client-js:$ktor_version " )
7474 }
7575 }
76-
77- all {
78- languageSettings.apply {
79- optIn(" kotlin.Experimental" )
80- }
81- }
8276 }
8377}
8478
Original file line number Diff line number Diff line change 11package org.openapitools.client.infrastructure
22
33import io.ktor.utils.io.core.*
4+ import kotlinx.io.Source
5+ import kotlinx.io.readByteArray
46import kotlin.experimental.and
57
68private val digits = " 0123456789abcdef" .toCharArray()
@@ -14,7 +16,8 @@ private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it
1416private fun Int.toBase64 (): Char = BASE64_ALPHABET [this ]
1517private fun Byte.fromBase64 (): Byte = BASE64_INVERSE_ALPHABET [toInt() and 0xff ].toByte() and BASE64_MASK
1618internal fun ByteArray.encodeBase64 (): String = buildPacket { writeFully(this @encodeBase64) }.encodeBase64()
17- internal fun String.decodeBase64Bytes (): ByteArray = buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readBytes()
19+ internal fun String.decodeBase64Bytes (): ByteArray =
20+ buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readByteArray()
1821
1922/* *
2023 * Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
@@ -57,7 +60,7 @@ internal fun hex(s: String): ByteArray {
5760 *
5861 * Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
5962 */
60- private fun ByteReadPacket .encodeBase64 (): String = buildString {
63+ private fun Source .encodeBase64 (): String = buildString {
6164 val data = ByteArray (3 )
6265 while (remaining > 0 ) {
6366 val read = readAvailable(data)
Original file line number Diff line number Diff line change 11import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
22
33plugins {
4- kotlin(" multiplatform" ) version " 2.0 .21" // kotlin_version
5- kotlin(" plugin.serialization" ) version " 2.0 .21" // kotlin_version
4+ kotlin(" multiplatform" ) version " 2.1 .21" // kotlin_version
5+ kotlin(" plugin.serialization" ) version " 2.1 .21" // kotlin_version
66}
77
88group = " org.openapitools"
99version = " 1.0.0"
1010
11- val kotlin_version = " 2.0 .21"
12- val coroutines_version = " 1.9.0 "
13- val serialization_version = " 1.7.3 "
14- val ktor_version = " 3.0 .3"
11+ val kotlin_version = " 2.1 .21"
12+ val coroutines_version = " 1.10.2 "
13+ val serialization_version = " 1.8.1 "
14+ val ktor_version = " 3.1 .3"
1515
1616repositories {
1717 mavenCentral()
@@ -38,7 +38,7 @@ kotlin {
3838 api(" io.ktor:ktor-client-content-negotiation:$ktor_version " )
3939 api(" io.ktor:ktor-serialization-kotlinx-json:$ktor_version " )
4040
41- api(" org.jetbrains.kotlinx:kotlinx-datetime:0.4.1 " )
41+ api(" org.jetbrains.kotlinx:kotlinx-datetime:0.6.2 " )
4242 }
4343 }
4444
@@ -73,12 +73,6 @@ kotlin {
7373 api(" io.ktor:ktor-client-js:$ktor_version " )
7474 }
7575 }
76-
77- all {
78- languageSettings.apply {
79- optIn(" kotlin.Experimental" )
80- }
81- }
8276 }
8377}
8478
Original file line number Diff line number Diff line change 11package org.openapitools.client.infrastructure
22
33import io.ktor.utils.io.core.*
4+ import kotlinx.io.Source
5+ import kotlinx.io.readByteArray
46import kotlin.experimental.and
57
68private val digits = " 0123456789abcdef" .toCharArray()
@@ -14,7 +16,8 @@ private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it
1416private fun Int.toBase64 (): Char = BASE64_ALPHABET [this ]
1517private fun Byte.fromBase64 (): Byte = BASE64_INVERSE_ALPHABET [toInt() and 0xff ].toByte() and BASE64_MASK
1618internal fun ByteArray.encodeBase64 (): String = buildPacket { writeFully(this @encodeBase64) }.encodeBase64()
17- internal fun String.decodeBase64Bytes (): ByteArray = buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readBytes()
19+ internal fun String.decodeBase64Bytes (): ByteArray =
20+ buildPacket { writeText(dropLastWhile { it == BASE64_PAD }) }.decodeBase64Bytes().readByteArray()
1821
1922/* *
2023 * Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
@@ -57,7 +60,7 @@ internal fun hex(s: String): ByteArray {
5760 *
5861 * Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
5962 */
60- private fun ByteReadPacket .encodeBase64 (): String = buildString {
63+ private fun Source .encodeBase64 (): String = buildString {
6164 val data = ByteArray (3 )
6265 while (remaining > 0 ) {
6366 val read = readAvailable(data)
You can’t perform that action at this time.
0 commit comments