Compare commits

...

2 Commits

Author SHA1 Message Date
kashiuno
26a6f065da Change package 2025-01-02 14:32:20 +03:00
kashiuno
7adf116721 Add openapi kotlin generator to project 2025-01-02 14:29:38 +03:00
2 changed files with 27 additions and 2 deletions

View File

@ -1,21 +1,46 @@
plugins { plugins {
kotlin("jvm") version "2.0.21" kotlin("jvm") version "2.0.21"
id("org.openapi.generator") version "7.10.0"
} }
group = "com.kashiuno" group = "ru.vyatsu"
version = "1.0-SNAPSHOT" version = "1.0.0"
val generatedSourcesDir = "$buildDir/generated/openapi"
repositories { repositories {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
compileOnly("com.squareup.okhttp3:okhttp:4.12.0")
compileOnly("com.squareup.moshi:moshi-kotlin:1.15.2")
testImplementation(kotlin("test")) testImplementation(kotlin("test"))
} }
tasks.test { tasks.test {
useJUnitPlatform() useJUnitPlatform()
} }
kotlin { kotlin {
jvmToolchain(17) jvmToolchain(17)
}
tasks.openApiGenerate {
generatorName.set("kotlin")
inputSpec.set("$rootDir/src/main/resources/openapi-contract.yaml")
outputDir.set(generatedSourcesDir)
packageName.set("ru.vyatsu")
}
sourceSets {
getByName("main") {
kotlin {
srcDir("$generatedSourcesDir/src/main/kotlin")
}
}
}
tasks.compileKotlin {
dependsOn(tasks.openApiGenerate)
} }