-
Notifications
You must be signed in to change notification settings - Fork 397
/
build.gradle
212 lines (189 loc) · 7.46 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
plugins {
id "java"
id "com.github.ben-manes.versions" version "0.51.0"
id "io.franzbecker.gradle-lombok" version "5.0.0" apply false
id "com.diffplug.spotless" version "6.25.0" apply false
}
apply plugin: "eclipse"
ext {
schemasDir = file("config/triplea/schemas")
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
allprojects {
apply plugin: "com.diffplug.spotless"
apply plugin: "java"
spotless {
format "allFiles", {
target "*"
targetExclude "gradlew.bat"
endWithNewline()
indentWithSpaces()
trimTrailingWhitespace()
}
}
}
subprojects {
apply plugin: "checkstyle"
apply plugin: "jacoco"
apply plugin: "java"
apply plugin: "pmd"
apply plugin: "io.franzbecker.gradle-lombok"
apply from: rootProject.file("gradle/scripts/release.gradle")
apply from: rootProject.file("gradle/scripts/version.gradle")
group = "triplea"
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
ext {
apacheHttpComponentsVersion = "4.5.14"
assertjCoreVersion = '3.26.3'
awaitilityVersion = "4.2.2"
caffeineVersion = "3.1.8"
checkstyleVersion = "8.45"
commonsIoVersion = "2.17.0"
commonsMathVersion = "3.6.1"
commonsTextVersion = "1.12.0"
dropwizardWebsocketsVersion = "1.3.14"
equalsVerifierVersion = "3.17.3"
feignVersion = "13.5"
gsonVersion = "2.11.0"
guavaVersion = "33.3.1-jre"
hamcrestOptionalVersion = "2.0.0"
hamcrestVersion = "2.0.0.0"
jacksonDataTypeVersion = "2.18.1"
jakartaMailVersion = "2.0.1"
javaWebSocketVersion = "1.5.7"
jaxbImplVersion = "4.0.5"
jetbrainsAnnotationsVersion = "26.0.1"
jlayerVersion = "1.0.1.4"
junitJupiterVersion = "5.11.3"
junitPlatformLauncherVersion = "1.11.3"
logbackClassicVersion = "1.5.12"
mockitoVersion = "5.14.2"
openFeignVersion = "13.3"
snakeYamlVersion = "2.8"
sonatypeGoodiesPrefsVersion = "2.3.9"
substanceVersion = "4.5.0"
wireMockJunit5Version = "1.3.1"
wireMockVersion = "3.0.1"
xchartVersion = "3.8.8"
xmlUnitCore = "2.10.0"
xmlUnitMatchers = "2.10.0"
}
repositories {
mavenCentral()
}
dependencies {
implementation ("com.googlecode.soundlibs:jlayer:$jlayerVersion") {
exclude group: 'junit', module: 'junit'
}
implementation "ch.qos.logback:logback-classic:$logbackClassicVersion"
implementation "com.github.ben-manes.caffeine:caffeine:$caffeineVersion"
implementation "com.google.code.gson:gson:$gsonVersion"
implementation "com.google.guava:guava:$guavaVersion"
implementation "com.liveperson:dropwizard-websockets:$dropwizardWebsocketsVersion"
implementation "com.sun.mail:jakarta.mail:$jakartaMailVersion"
implementation "com.sun.xml.bind:jaxb-impl:$jaxbImplVersion"
implementation "commons-io:commons-io:$commonsIoVersion"
implementation "io.github.openfeign:feign-gson:$feignVersion"
implementation "org.apache.commons:commons-math3:$commonsMathVersion"
implementation "org.apache.commons:commons-text:$commonsTextVersion"
implementation "org.apache.httpcomponents:httpmime:$apacheHttpComponentsVersion"
implementation "org.java-websocket:Java-WebSocket:$javaWebSocketVersion"
implementation "org.jetbrains:annotations:$jetbrainsAnnotationsVersion"
implementation "org.knowm.xchart:xchart:$xchartVersion"
implementation "org.pushing-pixels:radiance-substance:$substanceVersion"
implementation "org.snakeyaml:snakeyaml-engine:$snakeYamlVersion"
testImplementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonDataTypeVersion"
testImplementation "com.github.npathai:hamcrest-optional:$hamcrestOptionalVersion"
testImplementation "com.github.tomakehurst:wiremock:$wireMockVersion"
testImplementation "nl.jqno.equalsverifier:equalsverifier:$equalsVerifierVersion"
testImplementation "org.assertj:assertj-core:$assertjCoreVersion"
testImplementation "org.awaitility:awaitility:$awaitilityVersion"
testImplementation "org.hamcrest:java-hamcrest:$hamcrestVersion"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junitJupiterVersion"
testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion"
testImplementation "org.mockito:mockito-subclass:$mockitoVersion"
testImplementation "org.sonatype.goodies:goodies-prefs:$sonatypeGoodiesPrefsVersion"
testImplementation "org.xmlunit:xmlunit-core:$xmlUnitCore"
testImplementation "org.xmlunit:xmlunit-matchers:$xmlUnitMatchers"
testImplementation "ru.lanwen.wiremock:wiremock-junit5:$wireMockJunit5Version"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"
testRuntimeOnly "org.junit.platform:junit-platform-launcher:$junitPlatformLauncherVersion"
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs += [
"-Xlint:none,-processing"
]
options.encoding = "UTF-8"
options.incremental = true
}
tasks.withType(Test).configureEach {
useJUnitPlatform() {}
testLogging {
exceptionFormat = "full"
events = ["standardOut", "standardError", "skipped", "failed"]
}
}
// Add a summary of failed test case to the end of execution
// https://stackoverflow.com/questions/43917709/how-do-i-show-a-list-of-all-the-test-failures-after-completion-of-a-gradle-task
// add a collection to track failedTests
ext.failedTests = []
// add a testlistener to all tasks of type Test
tasks.withType(Test) {
afterTest { TestDescriptor descriptor, TestResult result ->
if(result.resultType == TestResult.ResultType.FAILURE){
failedTests << ["${descriptor.className}::${descriptor.name}"]
}
}
}
// print out tracked failed tests when the build has finished
gradle.buildFinished {
if(!failedTests.empty){
println "Failed tests for ${project.name}:"
failedTests.each { failedTest ->
println failedTest
}
println ""
}
}
checkstyle {
toolVersion = "$checkstyleVersion"
configFile = rootProject.file(".build/checkstyle.xml")
configProperties = [samedir: configFile.parent]
}
checkstyleMain {
maxWarnings = 0
source sourceSets.main.output.resourcesDir
}
checkstyleTest {
maxWarnings = 0
source sourceSets.test.output.resourcesDir
exclude "**/map-xmls/*.xml"
}
jacocoTestReport {
reports {
xml.required = true
xml.destination file("${buildDir}/jacoco.xml")
html.required = true
}
}
lombok {
version = "1.18.22"
}
pmd {
consoleOutput = true
ruleSetFiles = files(rootProject.file(".build/pmd.xml"))
ruleSets = []
incrementalAnalysis = true
}
spotless {
java {
googleJavaFormat()
removeUnusedImports()
}
}
}