forked from loafle/openapi-generator-original
* fix(ktor-client): do not add jsonBlock if using kotlinx-serialization * update existing templates * add new kotlin-jvm-ktor-kotlinx_serialization * add new kotlin-jvm-ktor-kotlinx_serialization to samples-kotlin-client.yaml pipeline actually, kotlin-jvm-ktor-gson was duplicated, so I'm replacing the second one by kotlin-jvm-ktor-kotlinx_serialization * extra FILES entry in the template * enumUnknownDefaultCase=false for now since it's currently broken for ktor + kotlinx_serialization * use openapi 3 petstore
47 lines
1.3 KiB
Groovy
47 lines
1.3 KiB
Groovy
group 'org.openapitools'
|
|
version '1.0.0'
|
|
|
|
wrapper {
|
|
gradleVersion = '7.5'
|
|
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
|
|
}
|
|
|
|
buildscript {
|
|
ext.kotlin_version = '1.7.21'
|
|
ext.ktor_version = '2.1.3'
|
|
|
|
repositories {
|
|
maven { url "https://repo1.maven.org/maven2" }
|
|
}
|
|
dependencies {
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
|
}
|
|
}
|
|
|
|
apply plugin: 'kotlin'
|
|
apply plugin: 'kotlinx-serialization'
|
|
apply plugin: 'maven-publish'
|
|
|
|
repositories {
|
|
maven { url "https://repo1.maven.org/maven2" }
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
dependencies {
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1"
|
|
implementation "io.ktor:ktor-client-core:$ktor_version"
|
|
implementation "io.ktor:ktor-client-content-negotiation:$ktor_version"
|
|
testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2"
|
|
}
|
|
|
|
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
|
|
kotlinOptions {
|
|
freeCompilerArgs += "-Xopt-in=kotlinx.serialization.ExperimentalSerializationApi"
|
|
}
|
|
}
|