Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ modules/openapi-generator-gradle-plugin/bin/
.classpath
lib/*
build/*
.kotlin
generated-files/*
generated-sources/*
generated-code/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ private void processKotlinxDate() {
typeMapping.put("Date", "LocalDate");
typeMapping.put("Time", "LocalTime");

importMapping.put("Instant", "kotlinx.datetime.Instant");
importMapping.put("Instant", "kotlin.time.Instant");
importMapping.put("LocalDate", "kotlinx.datetime.LocalDate");
importMapping.put("LocalTime", "kotlinx.datetime.LocalTime");
}
Expand Down Expand Up @@ -887,7 +887,6 @@ private void processMultiplatformLibrary(final String infrastructureFolder) {

// multiplatform specific supporting files
supportingFiles.add(new SupportingFile("infrastructure/Base64ByteArray.kt.mustache", infrastructureFolder, "Base64ByteArray.kt"));
supportingFiles.add(new SupportingFile("infrastructure/Bytes.kt.mustache", infrastructureFolder, "Bytes.kt"));
supportingFiles.add(new SupportingFile("infrastructure/HttpResponse.kt.mustache", infrastructureFolder, "HttpResponse.kt"));
supportingFiles.add(new SupportingFile("infrastructure/OctetByteArray.kt.mustache", infrastructureFolder, "OctetByteArray.kt"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
## Requires

{{#jvm}}
* Kotlin 1.7.21
* Gradle 7.5
* Kotlin 2.2.20
* Gradle 8.14
{{/jvm}}
{{#multiplatform}}
* Kotlin 1.5.10
* Kotlin 2.2.20
{{/multiplatform}}

## Build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@ version '{{artifactVersion}}'
{{^omitGradleWrapper}}

wrapper {
gradleVersion = '8.7'
gradleVersion = '8.14.3'
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}
{{/omitGradleWrapper}}

buildscript {
ext.kotlin_version = '1.9.23'
ext.kotlin_version = '2.2.20'
{{#jvm-ktor}}
ext.ktor_version = '2.3.9'
ext.ktor_version = '3.2.3'
{{/jvm-ktor}}
{{#jvm-retrofit2}}
ext.retrofitVersion = '2.10.0'
ext.retrofitVersion = '3.0.0'
{{/jvm-retrofit2}}
{{#useRxJava3}}
ext.rxJava3Version = '3.1.8'
ext.rxJava3Version = '3.1.11'
{{/useRxJava3}}
{{#jvm-vertx}}
ext.vertx_version = "4.5.6"
ext.vertx_version = "5.0.4"
{{/jvm-vertx}}
{{#jvm-spring}}
{{#useSpringBoot3}}
ext.spring_boot_version = "3.2.5"
ext.spring_boot_version = "3.5.5"
{{/useSpringBoot3}}
{{^useSpringBoot3}}
ext.spring_boot_version = "2.7.18"
{{/useSpringBoot3}}
{{/jvm-spring}}
ext.spotless_version = "6.25.0"
ext.spotless_version = "7.2.1"

repositories {
maven { url "https://repo1.maven.org/maven2" }
Expand All @@ -41,12 +41,15 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
{{/kotlinx_serialization}}
classpath "com.diffplug.spotless:spotless-plugin-gradle:$spotless_version"
{{#moshiCodeGen}}
classpath "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:2.2.20-2.0.3"
{{/moshiCodeGen}}
}
}

apply plugin: 'kotlin'
{{#moshiCodeGen}}
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.devtools.ksp'
{{/moshiCodeGen}}
{{#parcelizeModels}}
apply plugin: 'kotlin-parcelize'
Expand Down Expand Up @@ -118,35 +121,46 @@ kotlin {
}
}
{{/jvm-spring-restclient}}
{{#kotlinx-datetime}}
kotlin {
sourceSets {
all {
languageSettings {
optIn("kotlin.time.ExperimentalTime")
}
}
}
}
{{/kotlinx-datetime}}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
{{^doNotUseRxAndCoroutines}}
{{#useCoroutines}}
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2"
{{/useCoroutines}}
{{/doNotUseRxAndCoroutines}}
{{#moshi}}
{{^moshiCodeGen}}
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "com.squareup.moshi:moshi-kotlin:1.15.1"
implementation "com.squareup.moshi:moshi-adapters:1.15.1"
implementation "com.squareup.moshi:moshi-kotlin:1.15.2"
implementation "com.squareup.moshi:moshi-adapters:1.15.2"
{{/moshiCodeGen}}
{{#moshiCodeGen}}
implementation "com.squareup.moshi:moshi:1.15.1"
implementation "com.squareup.moshi:moshi-adapters:1.15.1"
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.15.1"
implementation "com.squareup.moshi:moshi:1.15.2"
implementation "com.squareup.moshi:moshi-adapters:1.15.2"
ksp "com.squareup.moshi:moshi-kotlin-codegen:1.15.2"
{{/moshiCodeGen}}
{{/moshi}}
{{#gson}}
implementation "com.google.code.gson:gson:2.10.1"
implementation "com.google.code.gson:gson:2.13.2"
{{/gson}}
{{#jackson}}
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.20.0"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.20.0"
{{/jackson}}
{{#kotlinx_serialization}}
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0"
{{/kotlinx_serialization}}
{{#jvm-ktor}}
implementation "io.ktor:ktor-client-core:$ktor_version"
Expand All @@ -161,29 +175,29 @@ dependencies {
{{/jackson}}
{{/jvm-ktor}}
{{#jvm-okhttp4}}
implementation "com.squareup.okhttp3:okhttp:4.12.0"
implementation "com.squareup.okhttp3:okhttp:5.1.0"
{{/jvm-okhttp4}}
{{#jvm-spring-webclient}}
implementation "org.springframework.boot:spring-boot-starter-webflux:$spring_boot_version"
implementation "io.projectreactor:reactor-core:3.6.5"
implementation "io.projectreactor:reactor-core:3.7.11"
{{/jvm-spring-webclient}}
{{#jvm-spring-restclient}}
implementation "org.springframework.boot:spring-boot-starter-web:$spring_boot_version"
{{/jvm-spring-restclient}}
{{#threetenbp}}
implementation "org.threeten:threetenbp:1.6.8"
implementation "org.threeten:threetenbp:1.7.2"
{{/threetenbp}}
{{#kotlinx-datetime}}
implementation "org.jetbrains.kotlinx:kotlinx-datetime:0.5.0"
implementation "org.jetbrains.kotlinx:kotlinx-datetime:0.7.1"
{{/kotlinx-datetime}}
{{#jvm-retrofit2}}
{{#hasOAuthMethods}}
implementation "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:1.0.2"
{{/hasOAuthMethods}}
implementation "com.squareup.okhttp3:logging-interceptor:4.12.0"
implementation "com.squareup.okhttp3:logging-interceptor:5.1.0"
{{#useRxJava3}}
implementation "io.reactivex.rxjava3:rxjava:$rxJava3Version"
implementation "com.squareup.retrofit2:adapter-rxjava3:2.10.0"
implementation "com.squareup.retrofit2:adapter-rxjava3:$retrofitVersion"
{{/useRxJava3}}
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
{{#gson}}
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
{{/jvm-volley}}
{{^jvm-volley}}
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
{{/jvm-volley}}
networkTimeout=10000
validateDistributionUrl=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +27,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

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

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

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

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

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

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

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

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.google.gson.stream.JsonWriter
import com.google.gson.stream.JsonToken.NULL
import java.io.IOException
{{/gson}}
import kotlinx.datetime.Instant
import kotlin.time.Instant

{{#moshi}}
{{#nonPublicApi}}internal {{/nonPublicApi}}{{^nonPublicApi}}{{#explicitApi}}public {{/explicitApi}}{{/nonPublicApi}}class InstantAdapter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import org.threeten.bp.LocalDateTime
import org.threeten.bp.OffsetDateTime
{{/threetenbp}}
{{#kotlinx-datetime}}
import kotlinx.datetime.Instant
import kotlin.time.Instant
import kotlinx.datetime.LocalDate
import kotlinx.datetime.LocalTime
{{/kotlinx-datetime}}
import java.util.UUID
Expand Down Expand Up @@ -67,6 +68,7 @@ import java.util.concurrent.atomic.AtomicLong
.add(OffsetDateTimeAdapter())
{{#kotlinx-datetime}}
.add(InstantAdapter())
.add(LocalDateAdapter())
.add(LocalTimeAdapter())
{{/kotlinx-datetime}}
.add(LocalDateTimeAdapter())
Expand Down Expand Up @@ -94,6 +96,7 @@ import java.util.concurrent.atomic.AtomicLong
.registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter())
{{#kotlinx-datetime}}
.registerTypeAdapter(Instant::class.java, InstantAdapter())
.registerTypeAdapter(LocalDate::class.java, LocalDateAdapter())
.registerTypeAdapter(LocalTime::class.java, LocalTimeAdapter())
{{/kotlinx-datetime}}
.registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import io.vertx.ext.web.client.WebClient
import io.vertx.uritemplate.UriTemplate

{{#useCoroutines}}
import io.vertx.kotlin.coroutines.await
import io.vertx.kotlin.coroutines.coAwait
import io.vertx.kotlin.coroutines.dispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
Expand Down Expand Up @@ -119,7 +119,7 @@ import {{packageName}}.infrastructure.*
throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
}
}
}{{#useCoroutines}}.await(){{/useCoroutines}}
}{{#useCoroutines}}.coAwait(){{/useCoroutines}}
}

/**
Expand Down
Loading
Loading