-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
107 lines (95 loc) · 3.79 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
plugins {
id 'java'
id 'org.openapi.generator' version '4.2.2'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
// https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-gradle-plugin
task generateImagePojos(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
inputSpec = "https://api.ecgmove.com/docs/spec/images".toString()
modelPackage = "ecg.move.sellermodel.imageapi".toString()
generatorName = "jaxrs-jersey"
outputDir = "$buildDir/gen-sellermodel".toString()
apiPackage = "ignorethis"
invokerPackage = "ignorethis"
modelPackage = "ecg.move.sellermodel.imageapi"
configOptions = [
dateLibrary: "legacy"
]
systemProperties = [
modelDocs: "false"
]
logToStderr = true
}
task generateListingPojos(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
inputSpec = "https://api.ecgmove.com/docs/spec/listings".toString()
modelPackage = "ecg.move.sellermodel.listing".toString()
generatorName = "jaxrs-jersey"
outputDir = "$buildDir/gen-sellermodel".toString()
apiPackage = "ignorethis"
invokerPackage = "ignorethis"
modelPackage = "ecg.move.sellermodel.listing"
configOptions = [
dateLibrary: "legacy"
]
systemProperties = [
modelDocs: "false"
]
logToStderr = true
}
task generateDealerPojos(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
inputSpec = "https://api.ecgmove.com/docs/spec/dealers".toString()
modelPackage = "ecg.move.sellermodel.dealer".toString()
generatorName = "jaxrs-jersey"
outputDir = "$buildDir/gen-sellermodel".toString()
apiPackage = "ignorethis"
invokerPackage = "ignorethis"
modelPackage = "ecg.move.sellermodel.dealer"
configOptions = [
dateLibrary: "legacy"
]
systemProperties = [
modelDocs: "false"
]
logToStderr = true
}
task deleteUnusedResults(dependsOn: ['generateListingPojos', 'generateImagePojos', 'generateDealerPojos'], type: Delete) {
// this removes a number of generated stuff that is not needed (and in parts broken)
delete "$buildDir/gen-sellermodel/src/gen/java/ecg/move/sellermodel/ignorethis",
"$buildDir/gen-sellermodel/src/gen/java/ecg/move/sellermodel/dealer/PagedResultDealerDetailResponseV2.java",
"$buildDir/gen-sellermodel/src/gen/java/ecg/move/sellermodel/dealer/PagedResultDealerOverviewResponse.java",
"$buildDir/gen-sellermodel/src/gen/java/ecg/move/sellermodel/dealer/PagedResultDealerDetailResponse.java",
"$buildDir/gen-sellermodel/src/gen/java/ignorethis"
followSymlinks = true
}
task generatePojosFromRemoteApiSpec(dependsOn: ['deleteUnusedResults'])
compileJava.dependsOn generatePojosFromRemoteApiSpec
sourceSets {
main.java.srcDirs += "${project.buildDir}/gen-sellermodel/src/gen/java"
}
dependencies {
compile 'org.glassfish.jersey.media:jersey-media-json-jackson:2.25.1'
compile 'org.glassfish.jersey.core:jersey-client:2.25.1'
compile 'org.glassfish.jersey.media:jersey-media-multipart:2.25.1'
compile 'javax.validation:validation-api:1.0.0.GA'
compile 'javax.activation:activation:1.1'
implementation "javax.xml.bind:jaxb-api:2.2.11"
implementation "com.sun.xml.bind:jaxb-core:2.2.11"
implementation "com.sun.xml.bind:jaxb-impl:2.2.11"
implementation 'io.swagger:swagger-annotations:1.5.20'
testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.2")
testImplementation("org.assertj:assertj-core:3.16.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.2")
}
test {
useJUnitPlatform {
}
testLogging {
events 'FAILED', 'SKIPPED', "PASSED"
showStandardStreams = false
exceptionFormat = 'full'
}
}