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
src/commonMain/kotlin/org/openapitools/client/infrastructure
kotlin-multiplatform-kotlinx-datetime
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 1
1
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
2
2
3
3
plugins {
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} }
6
6
}
7
7
8
8
group = "{ {groupId} }"
9
9
version = "{ {artifactVersion} }"
10
10
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"
15
15
16
16
repositories {
17
17
mavenCentral()
@@ -43,7 +43,7 @@ kotlin {
43
43
api(" io.ktor:ktor-serialization-kotlinx-json:$ktor_version" )
44
44
45
45
{{#kotlinx-datetime} }
46
- api("org.jetbrains.kotlinx:kotlinx-datetime:0.4.1 ")
46
+ api("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2 ")
47
47
{ {/kotlinx-datetime} }
48
48
}
49
49
}
@@ -79,12 +79,6 @@ kotlin {
79
79
api(" io.ktor:ktor-client-js:$ktor_version" )
80
80
}
81
81
}
82
-
83
- all {
84
- languageSettings.apply {
85
- optIn(" kotlin.Experimental" )
86
- }
87
- }
88
82
}
89
83
}
90
84
Original file line number Diff line number Diff line change 1
1
package { {packageName} }.infrastructure
2
2
3
3
import io.ktor.utils.io.core.*
4
+ import kotlinx.io.Source
5
+ import kotlinx.io.readByteArray
4
6
import kotlin.experimental.and
5
7
6
8
private val digits = "0123456789abcdef".toCharArray()
@@ -14,7 +16,8 @@ private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it
14
16
private fun Int.toBase64(): Char = BASE64_ALPHABET[this]
15
17
private fun Byte.fromBase64(): Byte = BASE64_INVERSE_ALPHABET[toInt() and 0xff].toByte() and BASE64_MASK
16
18
internal 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()
18
21
19
22
/**
20
23
* Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
@@ -57,7 +60,7 @@ internal fun hex(s: String): ByteArray {
57
60
*
58
61
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
59
62
*/
60
- private fun ByteReadPacket .encodeBase64(): String = buildString {
63
+ private fun Source .encodeBase64(): String = buildString {
61
64
val data = ByteArray(3)
62
65
while (remaining > 0) {
63
66
val read = readAvailable(data)
Original file line number Diff line number Diff line change 1
1
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
2
2
3
3
plugins {
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
6
6
}
7
7
8
8
group = " org.openapitools"
9
9
version = " 1.0.0"
10
10
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"
15
15
16
16
repositories {
17
17
mavenCentral()
@@ -38,7 +38,7 @@ kotlin {
38
38
api(" io.ktor:ktor-client-content-negotiation:$ktor_version " )
39
39
api(" io.ktor:ktor-serialization-kotlinx-json:$ktor_version " )
40
40
41
- api(" org.jetbrains.kotlinx:kotlinx-datetime:0.4.1 " )
41
+ api(" org.jetbrains.kotlinx:kotlinx-datetime:0.6.2 " )
42
42
}
43
43
}
44
44
@@ -73,12 +73,6 @@ kotlin {
73
73
api(" io.ktor:ktor-client-js:$ktor_version " )
74
74
}
75
75
}
76
-
77
- all {
78
- languageSettings.apply {
79
- optIn(" kotlin.Experimental" )
80
- }
81
- }
82
76
}
83
77
}
84
78
Original file line number Diff line number Diff line change 1
1
package org.openapitools.client.infrastructure
2
2
3
3
import io.ktor.utils.io.core.*
4
+ import kotlinx.io.Source
5
+ import kotlinx.io.readByteArray
4
6
import kotlin.experimental.and
5
7
6
8
private val digits = " 0123456789abcdef" .toCharArray()
@@ -14,7 +16,8 @@ private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it
14
16
private fun Int.toBase64 (): Char = BASE64_ALPHABET [this ]
15
17
private fun Byte.fromBase64 (): Byte = BASE64_INVERSE_ALPHABET [toInt() and 0xff ].toByte() and BASE64_MASK
16
18
internal 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()
18
21
19
22
/* *
20
23
* Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
@@ -57,7 +60,7 @@ internal fun hex(s: String): ByteArray {
57
60
*
58
61
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
59
62
*/
60
- private fun ByteReadPacket .encodeBase64 (): String = buildString {
63
+ private fun Source .encodeBase64 (): String = buildString {
61
64
val data = ByteArray (3 )
62
65
while (remaining > 0 ) {
63
66
val read = readAvailable(data)
Original file line number Diff line number Diff line change 1
1
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
2
2
3
3
plugins {
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
6
6
}
7
7
8
8
group = " org.openapitools"
9
9
version = " 1.0.0"
10
10
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"
15
15
16
16
repositories {
17
17
mavenCentral()
@@ -38,7 +38,7 @@ kotlin {
38
38
api(" io.ktor:ktor-client-content-negotiation:$ktor_version " )
39
39
api(" io.ktor:ktor-serialization-kotlinx-json:$ktor_version " )
40
40
41
- api(" org.jetbrains.kotlinx:kotlinx-datetime:0.4.1 " )
41
+ api(" org.jetbrains.kotlinx:kotlinx-datetime:0.6.2 " )
42
42
}
43
43
}
44
44
@@ -73,12 +73,6 @@ kotlin {
73
73
api(" io.ktor:ktor-client-js:$ktor_version " )
74
74
}
75
75
}
76
-
77
- all {
78
- languageSettings.apply {
79
- optIn(" kotlin.Experimental" )
80
- }
81
- }
82
76
}
83
77
}
84
78
Original file line number Diff line number Diff line change 1
1
package org.openapitools.client.infrastructure
2
2
3
3
import io.ktor.utils.io.core.*
4
+ import kotlinx.io.Source
5
+ import kotlinx.io.readByteArray
4
6
import kotlin.experimental.and
5
7
6
8
private val digits = " 0123456789abcdef" .toCharArray()
@@ -14,7 +16,8 @@ private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it
14
16
private fun Int.toBase64 (): Char = BASE64_ALPHABET [this ]
15
17
private fun Byte.fromBase64 (): Byte = BASE64_INVERSE_ALPHABET [toInt() and 0xff ].toByte() and BASE64_MASK
16
18
internal 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()
18
21
19
22
/* *
20
23
* Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
@@ -57,7 +60,7 @@ internal fun hex(s: String): ByteArray {
57
60
*
58
61
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
59
62
*/
60
- private fun ByteReadPacket .encodeBase64 (): String = buildString {
63
+ private fun Source .encodeBase64 (): String = buildString {
61
64
val data = ByteArray (3 )
62
65
while (remaining > 0 ) {
63
66
val read = readAvailable(data)
Original file line number Diff line number Diff line change 1
1
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
2
2
3
3
plugins {
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
6
6
}
7
7
8
8
group = " org.openapitools"
9
9
version = " 1.0.0"
10
10
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"
15
15
16
16
repositories {
17
17
mavenCentral()
@@ -38,7 +38,7 @@ kotlin {
38
38
api(" io.ktor:ktor-client-content-negotiation:$ktor_version " )
39
39
api(" io.ktor:ktor-serialization-kotlinx-json:$ktor_version " )
40
40
41
- api(" org.jetbrains.kotlinx:kotlinx-datetime:0.4.1 " )
41
+ api(" org.jetbrains.kotlinx:kotlinx-datetime:0.6.2 " )
42
42
}
43
43
}
44
44
@@ -73,12 +73,6 @@ kotlin {
73
73
api(" io.ktor:ktor-client-js:$ktor_version " )
74
74
}
75
75
}
76
-
77
- all {
78
- languageSettings.apply {
79
- optIn(" kotlin.Experimental" )
80
- }
81
- }
82
76
}
83
77
}
84
78
Original file line number Diff line number Diff line change 1
1
package org.openapitools.client.infrastructure
2
2
3
3
import io.ktor.utils.io.core.*
4
+ import kotlinx.io.Source
5
+ import kotlinx.io.readByteArray
4
6
import kotlin.experimental.and
5
7
6
8
private val digits = " 0123456789abcdef" .toCharArray()
@@ -14,7 +16,8 @@ private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it
14
16
private fun Int.toBase64 (): Char = BASE64_ALPHABET [this ]
15
17
private fun Byte.fromBase64 (): Byte = BASE64_INVERSE_ALPHABET [toInt() and 0xff ].toByte() and BASE64_MASK
16
18
internal 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()
18
21
19
22
/* *
20
23
* Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
@@ -57,7 +60,7 @@ internal fun hex(s: String): ByteArray {
57
60
*
58
61
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
59
62
*/
60
- private fun ByteReadPacket .encodeBase64 (): String = buildString {
63
+ private fun Source .encodeBase64 (): String = buildString {
61
64
val data = ByteArray (3 )
62
65
while (remaining > 0 ) {
63
66
val read = readAvailable(data)
Original file line number Diff line number Diff line change 1
1
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
2
2
3
3
plugins {
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
6
6
}
7
7
8
8
group = " org.openapitools"
9
9
version = " 1.0.0"
10
10
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"
15
15
16
16
repositories {
17
17
mavenCentral()
@@ -38,7 +38,7 @@ kotlin {
38
38
api(" io.ktor:ktor-client-content-negotiation:$ktor_version " )
39
39
api(" io.ktor:ktor-serialization-kotlinx-json:$ktor_version " )
40
40
41
- api(" org.jetbrains.kotlinx:kotlinx-datetime:0.4.1 " )
41
+ api(" org.jetbrains.kotlinx:kotlinx-datetime:0.6.2 " )
42
42
}
43
43
}
44
44
@@ -73,12 +73,6 @@ kotlin {
73
73
api(" io.ktor:ktor-client-js:$ktor_version " )
74
74
}
75
75
}
76
-
77
- all {
78
- languageSettings.apply {
79
- optIn(" kotlin.Experimental" )
80
- }
81
- }
82
76
}
83
77
}
84
78
Original file line number Diff line number Diff line change 1
1
package org.openapitools.client.infrastructure
2
2
3
3
import io.ktor.utils.io.core.*
4
+ import kotlinx.io.Source
5
+ import kotlinx.io.readByteArray
4
6
import kotlin.experimental.and
5
7
6
8
private val digits = " 0123456789abcdef" .toCharArray()
@@ -14,7 +16,8 @@ private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it
14
16
private fun Int.toBase64 (): Char = BASE64_ALPHABET [this ]
15
17
private fun Byte.fromBase64 (): Byte = BASE64_INVERSE_ALPHABET [toInt() and 0xff ].toByte() and BASE64_MASK
16
18
internal 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()
18
21
19
22
/* *
20
23
* Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.
@@ -57,7 +60,7 @@ internal fun hex(s: String): ByteArray {
57
60
*
58
61
* Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt
59
62
*/
60
- private fun ByteReadPacket .encodeBase64 (): String = buildString {
63
+ private fun Source .encodeBase64 (): String = buildString {
61
64
val data = ByteArray (3 )
62
65
while (remaining > 0 ) {
63
66
val read = readAvailable(data)
You can’t perform that action at this time.
0 commit comments