-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
56 lines (46 loc) · 1.62 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
plugins {
id "org.openapi.generator" version "6.2.0"
id 'java'
}
import org.openapitools.codegen.DefaultGenerator
import org.openapitools.codegen.config.CodegenConfigurator
group 'de.pg.fine.bugs'
version '1.0'
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3'
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'io.gsonfire:gson-fire:1.8.5'
// https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api
implementation group: 'javax.ws.rs', name: 'javax.ws.rs-api', version: '2.1.1'
}
test {
useJUnitPlatform()
}
clean {
delete "src/main/java/de/fine/pg/bugs/autogen"
}
task generateApiClient {
doLast {
def config = new CodegenConfigurator()
config.setGeneratorName("java")
config.setInputSpec(projectDir.toURI().resolve('api.yaml').toString())
config.setOutputDir(projectDir.toString())
config.setVerbose(false)
config.setApiPackage('de.fine.pg.bugs.autogen.api')
config.setModelPackage('de.fine.pg.bugs.autogen.model')
config.setLibrary("okhttp-gson")
config.setSkipOverwrite(false)
config.setAdditionalProperties([
"dateLibrary": "java8"
])
new DefaultGenerator().opts(config.toClientOptInput()).generate()
}
}
compileJava.dependsOn tasks.generateApiClient