Skip to content
This repository was archived by the owner on Nov 13, 2025. It is now read-only.

Commit e363d60

Browse files
committed
ktLint openapi generated source
1 parent 2281568 commit e363d60

File tree

4 files changed

+59
-1
lines changed

4 files changed

+59
-1
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,14 @@ indent_size = 2
88
indent_style = space
99
trim_trailing_whitespace = true
1010
continuation_indent_size = 4
11+
12+
[*.{kt,kts}]
13+
# possible values: number (e.g. 2), "unset" (makes ktlint ignore indentation completely)
14+
indent_size = 2
15+
# true (recommended) / false
16+
insert_final_newline = true
17+
# possible values: number (e.g. 120) (package name, imports & comments are ignored), "off"
18+
# it's automatically set to 100 on `ktlint --android ...` (per Android Kotlin Style Guide)
19+
max_line_length = off
20+
trim_trailing_whitespace = true
21+
disabled_rules = no-wildcard-imports

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ plugins {
1212
id("org.jetbrains.kotlin.jvm") version "1.4.31" apply false
1313
id("org.jetbrains.kotlin.kapt") version "1.4.31" apply false
1414
id("org.openapi.generator") version "5.1.1" apply false
15+
id("org.jlleitschuh.gradle.ktlint") version "10.1.0" apply false
1516
}
1617

1718
val dependencyVersions = listOf(

engine-api-model/build.gradle.kts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,59 @@ plugins {
1111
id("net.ossindex.audit")
1212
id("io.freefair.maven-central.validate-poms")
1313
id("org.openapi.generator")
14+
id("org.jlleitschuh.gradle.ktlint")
1415
}
1516

1617
openApiGenerate {
1718
inputSpec.set(file("./docker-engine-api-v1.41.yaml").absolutePath)
1819
configFile.set(file("./openapi-generator-config.yaml").absolutePath)
1920
outputDir.set(file(".").absolutePath)
2021
}
22+
val openApiGenerateCleanup by tasks.register("openApiGenerateCleanup") {
23+
dependsOn(tasks.openApiGenerate)
24+
doLast {
25+
listOf(
26+
"build.gradle",
27+
"gradlew",
28+
"gradlew.bat",
29+
"settings.gradle"
30+
).onEach {
31+
file(it).delete()
32+
}
33+
listOf(
34+
"gradle",
35+
"src/main/kotlin/de/gesellix/docker/engine/api",
36+
"src/main/kotlin/de/gesellix/docker/engine/client"
37+
).onEach {
38+
file(it).deleteRecursively()
39+
}
40+
}
41+
}
42+
tasks.runKtlintFormatOverKotlinScripts.get().dependsOn(tasks.openApiGenerate, openApiGenerateCleanup)
43+
tasks.ktlintKotlinScriptFormat.get().dependsOn(tasks.openApiGenerate, openApiGenerateCleanup)
44+
tasks.ktlintMainSourceSetFormat.get().dependsOn(tasks.openApiGenerate, openApiGenerateCleanup)
45+
tasks.ktlintFormat.get().dependsOn(tasks.openApiGenerate, openApiGenerateCleanup)
46+
val updateApiModelSources by tasks.register("updateApiModelSources") {
47+
group = "openapi tools"
48+
dependsOn(tasks.ktlintFormat)
49+
doLast {
50+
listOf(
51+
"build.gradle",
52+
"gradlew",
53+
"gradlew.bat",
54+
"settings.gradle"
55+
).onEach {
56+
file(it).delete()
57+
}
58+
listOf(
59+
"gradle",
60+
"src/main/kotlin/de/gesellix/docker/engine/api",
61+
"src/main/kotlin/de/gesellix/docker/engine/client"
62+
).onEach {
63+
file(it).deleteRecursively()
64+
}
65+
}
66+
}
2167

2268
repositories {
2369
mavenCentral()

engine-api-model/docker-engine-api-v1.41.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3140,7 +3140,7 @@ definitions:
31403140
[hosts(5)](http://man7.org/linux/man-pages/man5/hosts.5.html)
31413141
man page:
31423142
3143-
IP_address canonical_hostname [aliases...]
3143+
IP_address canonical_hostname [aliases]
31443144
items:
31453145
type: "string"
31463146
DNSConfig:

0 commit comments

Comments
 (0)