Skip to content

Commit dbcf05d

Browse files
committed
[kotlin-client] update Kotlin and libraries versions
1 parent 20d5126 commit dbcf05d

File tree

381 files changed

+2359
-2834
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

381 files changed

+2359
-2834
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ modules/openapi-generator-gradle-plugin/bin/
1616
.classpath
1717
lib/*
1818
build/*
19+
.kotlin
1920
generated-files/*
2021
generated-sources/*
2122
generated-code/*

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ private void processKotlinxDate() {
642642
typeMapping.put("Date", "LocalDate");
643643
typeMapping.put("Time", "LocalTime");
644644

645-
importMapping.put("Instant", "kotlinx.datetime.Instant");
645+
importMapping.put("Instant", "kotlin.time.Instant");
646646
importMapping.put("LocalDate", "kotlinx.datetime.LocalDate");
647647
importMapping.put("LocalTime", "kotlinx.datetime.LocalTime");
648648
}
@@ -887,7 +887,6 @@ private void processMultiplatformLibrary(final String infrastructureFolder) {
887887

888888
// multiplatform specific supporting files
889889
supportingFiles.add(new SupportingFile("infrastructure/Base64ByteArray.kt.mustache", infrastructureFolder, "Base64ByteArray.kt"));
890-
supportingFiles.add(new SupportingFile("infrastructure/Bytes.kt.mustache", infrastructureFolder, "Bytes.kt"));
891890
supportingFiles.add(new SupportingFile("infrastructure/HttpResponse.kt.mustache", infrastructureFolder, "HttpResponse.kt"));
892891
supportingFiles.add(new SupportingFile("infrastructure/OctetByteArray.kt.mustache", infrastructureFolder, "OctetByteArray.kt"));
893892

modules/openapi-generator/src/main/resources/kotlin-client/README.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
2121
## Requires
2222

2323
{{#jvm}}
24-
* Kotlin 1.7.21
25-
* Gradle 7.5
24+
* Kotlin 2.2.20
25+
* Gradle 8.14
2626
{{/jvm}}
2727
{{#multiplatform}}
28-
* Kotlin 1.5.10
28+
* Kotlin 2.2.20
2929
{{/multiplatform}}
3030

3131
## Build

modules/openapi-generator/src/main/resources/kotlin-client/build.gradle.mustache

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,34 @@ version '{{artifactVersion}}'
33
{{^omitGradleWrapper}}
44

55
wrapper {
6-
gradleVersion = '8.7'
6+
gradleVersion = '8.14.3'
77
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
88
}
99
{{/omitGradleWrapper}}
1010

1111
buildscript {
12-
ext.kotlin_version = '1.9.23'
12+
ext.kotlin_version = '2.2.20'
1313
{{#jvm-ktor}}
14-
ext.ktor_version = '2.3.9'
14+
ext.ktor_version = '3.2.3'
1515
{{/jvm-ktor}}
1616
{{#jvm-retrofit2}}
17-
ext.retrofitVersion = '2.10.0'
17+
ext.retrofitVersion = '3.0.0'
1818
{{/jvm-retrofit2}}
1919
{{#useRxJava3}}
20-
ext.rxJava3Version = '3.1.8'
20+
ext.rxJava3Version = '3.1.11'
2121
{{/useRxJava3}}
2222
{{#jvm-vertx}}
23-
ext.vertx_version = "4.5.6"
23+
ext.vertx_version = "5.0.4"
2424
{{/jvm-vertx}}
2525
{{#jvm-spring}}
2626
{{#useSpringBoot3}}
27-
ext.spring_boot_version = "3.2.5"
27+
ext.spring_boot_version = "3.5.5"
2828
{{/useSpringBoot3}}
2929
{{^useSpringBoot3}}
3030
ext.spring_boot_version = "2.7.18"
3131
{{/useSpringBoot3}}
3232
{{/jvm-spring}}
33-
ext.spotless_version = "6.25.0"
33+
ext.spotless_version = "7.2.1"
3434

3535
repositories {
3636
maven { url "https://repo1.maven.org/maven2" }
@@ -41,12 +41,15 @@ buildscript {
4141
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
4242
{{/kotlinx_serialization}}
4343
classpath "com.diffplug.spotless:spotless-plugin-gradle:$spotless_version"
44+
{{#moshiCodeGen}}
45+
classpath "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:2.2.20-2.0.3"
46+
{{/moshiCodeGen}}
4447
}
4548
}
4649

4750
apply plugin: 'kotlin'
4851
{{#moshiCodeGen}}
49-
apply plugin: 'kotlin-kapt'
52+
apply plugin: 'com.google.devtools.ksp'
5053
{{/moshiCodeGen}}
5154
{{#parcelizeModels}}
5255
apply plugin: 'kotlin-parcelize'
@@ -118,35 +121,46 @@ kotlin {
118121
}
119122
}
120123
{{/jvm-spring-restclient}}
124+
{{#kotlinx-datetime}}
125+
kotlin {
126+
sourceSets {
127+
all {
128+
languageSettings {
129+
optIn("kotlin.time.ExperimentalTime")
130+
}
131+
}
132+
}
133+
}
134+
{{/kotlinx-datetime}}
121135
dependencies {
122136
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
123137
{{^doNotUseRxAndCoroutines}}
124138
{{#useCoroutines}}
125-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0"
139+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2"
126140
{{/useCoroutines}}
127141
{{/doNotUseRxAndCoroutines}}
128142
{{#moshi}}
129143
{{^moshiCodeGen}}
130144
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
131-
implementation "com.squareup.moshi:moshi-kotlin:1.15.1"
132-
implementation "com.squareup.moshi:moshi-adapters:1.15.1"
145+
implementation "com.squareup.moshi:moshi-kotlin:1.15.2"
146+
implementation "com.squareup.moshi:moshi-adapters:1.15.2"
133147
{{/moshiCodeGen}}
134148
{{#moshiCodeGen}}
135-
implementation "com.squareup.moshi:moshi:1.15.1"
136-
implementation "com.squareup.moshi:moshi-adapters:1.15.1"
137-
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.15.1"
149+
implementation "com.squareup.moshi:moshi:1.15.2"
150+
implementation "com.squareup.moshi:moshi-adapters:1.15.2"
151+
ksp "com.squareup.moshi:moshi-kotlin-codegen:1.15.2"
138152
{{/moshiCodeGen}}
139153
{{/moshi}}
140154
{{#gson}}
141-
implementation "com.google.code.gson:gson:2.10.1"
155+
implementation "com.google.code.gson:gson:2.13.2"
142156
{{/gson}}
143157
{{#jackson}}
144158
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
145-
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1"
146-
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1"
159+
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.20.0"
160+
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.20.0"
147161
{{/jackson}}
148162
{{#kotlinx_serialization}}
149-
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3"
163+
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0"
150164
{{/kotlinx_serialization}}
151165
{{#jvm-ktor}}
152166
implementation "io.ktor:ktor-client-core:$ktor_version"
@@ -161,29 +175,29 @@ dependencies {
161175
{{/jackson}}
162176
{{/jvm-ktor}}
163177
{{#jvm-okhttp4}}
164-
implementation "com.squareup.okhttp3:okhttp:4.12.0"
178+
implementation "com.squareup.okhttp3:okhttp:5.1.0"
165179
{{/jvm-okhttp4}}
166180
{{#jvm-spring-webclient}}
167181
implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version"
168-
implementation "io.projectreactor:reactor-core:3.6.5"
182+
implementation "io.projectreactor:reactor-core:3.7.11"
169183
{{/jvm-spring-webclient}}
170184
{{#jvm-spring-restclient}}
171185
implementation "org.springframework.boot:spring-boot-starter-web:$spring_boot_version"
172186
{{/jvm-spring-restclient}}
173187
{{#threetenbp}}
174-
implementation "org.threeten:threetenbp:1.6.8"
188+
implementation "org.threeten:threetenbp:1.7.2"
175189
{{/threetenbp}}
176190
{{#kotlinx-datetime}}
177-
implementation "org.jetbrains.kotlinx:kotlinx-datetime:0.5.0"
191+
implementation "org.jetbrains.kotlinx:kotlinx-datetime:0.7.1"
178192
{{/kotlinx-datetime}}
179193
{{#jvm-retrofit2}}
180194
{{#hasOAuthMethods}}
181195
implementation "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.2"
182196
{{/hasOAuthMethods}}
183-
implementation "com.squareup.okhttp3:logging-interceptor:4.12.0"
197+
implementation "com.squareup.okhttp3:logging-interceptor:5.1.0"
184198
{{#useRxJava3}}
185199
implementation "io.reactivex.rxjava3:rxjava:$rxJava3Version"
186-
implementation "com.squareup.retrofit2:adapter-rxjava3:2.10.0"
200+
implementation "com.squareup.retrofit2:adapter-rxjava3:$retrofitVersion"
187201
{{/useRxJava3}}
188202
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
189203
{{#gson}}
42 Bytes
Binary file not shown.

modules/openapi-generator/src/main/resources/kotlin-client/gradle-wrapper.properties.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ distributionPath=wrapper/dists
44
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
55
{{/jvm-volley}}
66
{{^jvm-volley}}
7-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
7+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
88
{{/jvm-volley}}
99
networkTimeout=10000
1010
validateDistributionUrl=true

modules/openapi-generator/src/main/resources/kotlin-client/gradlew.bat.mustache

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

17-
@if "%DEBUG%" == "" @echo off
19+
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################
1921
@rem
2022
@rem Gradle startup script for Windows
@@ -25,7 +27,8 @@
2527
if "%OS%"=="Windows_NT" setlocal
2628

2729
set DIRNAME=%~dp0
28-
if "%DIRNAME%" == "" set DIRNAME=.
30+
if "%DIRNAME%"=="" set DIRNAME=.
31+
@rem This is normally unused
2932
set APP_BASE_NAME=%~n0
3033
set APP_HOME=%DIRNAME%
3134

@@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4043

4144
set JAVA_EXE=java.exe
4245
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto execute
46+
if %ERRORLEVEL% equ 0 goto execute
4447

45-
echo.
46-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47-
echo.
48-
echo Please set the JAVA_HOME variable in your environment to match the
49-
echo location of your Java installation.
48+
echo. 1>&2
49+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50+
echo. 1>&2
51+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52+
echo location of your Java installation. 1>&2
5053

5154
goto fail
5255

@@ -56,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5659

5760
if exist "%JAVA_EXE%" goto execute
5861

59-
echo.
60-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61-
echo.
62-
echo Please set the JAVA_HOME variable in your environment to match the
63-
echo location of your Java installation.
62+
echo. 1>&2
63+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64+
echo. 1>&2
65+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66+
echo location of your Java installation. 1>&2
6467

6568
goto fail
6669

@@ -75,13 +78,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
7578

7679
:end
7780
@rem End local scope for the variables with windows NT shell
78-
if "%ERRORLEVEL%"=="0" goto mainEnd
81+
if %ERRORLEVEL% equ 0 goto mainEnd
7982

8083
:fail
8184
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
8285
rem the _cmd.exe /c_ return code!
83-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84-
exit /b 1
86+
set EXIT_CODE=%ERRORLEVEL%
87+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
88+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
89+
exit /b %EXIT_CODE%
8590

8691
:mainEnd
8792
if "%OS%"=="Windows_NT" endlocal

modules/openapi-generator/src/main/resources/kotlin-client/gradlew.mustache

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/InstantAdapter.kt.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import com.google.gson.stream.JsonWriter
1111
import com.google.gson.stream.JsonToken.NULL
1212
import java.io.IOException
1313
{{/gson}}
14-
import kotlinx.datetime.Instant
14+
import kotlin.time.Instant
1515

1616
{{#moshi}}
1717
{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class InstantAdapter {

modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ import org.threeten.bp.LocalDateTime
2323
import org.threeten.bp.OffsetDateTime
2424
{{/threetenbp}}
2525
{{#kotlinx-datetime}}
26-
import kotlinx.datetime.Instant
26+
import kotlin.time.Instant
27+
import kotlinx.datetime.LocalDate
2728
import kotlinx.datetime.LocalTime
2829
{{/kotlinx-datetime}}
2930
import java.util.UUID
@@ -67,6 +68,7 @@ import java.util.concurrent.atomic.AtomicLong
6768
.add(OffsetDateTimeAdapter())
6869
{{#kotlinx-datetime}}
6970
.add(InstantAdapter())
71+
.add(LocalDateAdapter())
7072
.add(LocalTimeAdapter())
7173
{{/kotlinx-datetime}}
7274
.add(LocalDateTimeAdapter())
@@ -94,6 +96,7 @@ import java.util.concurrent.atomic.AtomicLong
9496
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
9597
{{#kotlinx-datetime}}
9698
.registerTypeAdapter(Instant::class.java, InstantAdapter())
99+
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())
97100
.registerTypeAdapter(LocalTime::class.java, LocalTimeAdapter())
98101
{{/kotlinx-datetime}}
99102
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())

0 commit comments

Comments
 (0)