-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
123 lines (100 loc) · 3.03 KB
/
build.gradle
File metadata and controls
123 lines (100 loc) · 3.03 KB
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
plugins {
id 'java'
id 'application'
id 'checkstyle'
id "com.diffplug.spotless" version "8.2.1"
id 'org.springframework.boot' version '4.0.2'
id 'io.spring.dependency-management' version '1.1.7'
}
repositories {
mavenCentral()
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
springBoot {
mainClass = "ci.CiApplication"
}
configurations {
checkstyle {
exclude group: "com.google.collections", module: "google-collections"
}
}
dependencies {
implementation 'org.apache.tomcat.embed:tomcat-embed-jasper'
implementation 'commons-io:commons-io:2.16.1'
implementation 'jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api:3.0.0'
implementation 'org.glassfish.web:jakarta.servlet.jsp.jstl:3.0.1'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
}
spotless {
java {
target 'src/**/*.java'
// Google Java Format
googleJavaFormat("1.33.0")
// Other checks
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
}
checkstyle {
toolVersion = "10.12.5"
configFile = file("config/checkstyle/checkstyle.xml")
}
tasks.withType(Checkstyle).configureEach {
reports {
xml.required = false
html.required = true
}
}
application {
mainClass = 'ci.CiApplication'
}
tasks.register("format") {
group = "formatting"
description = "Auto-formats code (Google Java Format) + other cleanups"
dependsOn("spotlessApply")
}
tasks.register("formatCheck") {
group = "formatting"
description = "Checks formatting without changing files"
dependsOn("spotlessCheck")
}
tasks.register("ci") {
group = "verification"
description = "Format, style-check, build, and test."
// Apply Spotless
dependsOn("spotlessApply")
// Verify formating and stylecheck
dependsOn("check")
// run all tests
dependsOn("test")
// ensure the build works
dependsOn("build")
}
// Make sure webapp is included
tasks.named("bootRun") {
sourceResources sourceSets.main
}
// Defines the order if several tasks are called
tasks.named("spotlessCheck").configure { mustRunAfter("spotlessApply") }
tasks.named("check").configure { mustRunAfter("spotlessApply") }
tasks.named("build").configure { mustRunAfter("check") }
check.dependsOn("spotlessCheck")
check.dependsOn("checkstyleMain")
check.dependsOn("checkstyleTest")