This repository has been archived by the owner on Aug 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
167 lines (137 loc) · 4.24 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
import com.github.spotbugs.snom.SpotBugsTask
plugins {
id 'jacoco'
id 'org.springframework.boot' version '2.5.3'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'org.asciidoctor.convert' version '1.5.8'
id 'org.ec4j.editorconfig' version '0.0.3'
id 'com.github.spotbugs' version '4.7.0'
id 'checkstyle'
id 'java'
}
group = 'com.yam'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
all {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
}
repositories {
mavenCentral()
}
ext {
set('snippetsDir', file("build/generated-snippets"))
}
asciidoctor {
inputs.dir snippetsDir
dependsOn test
}
dependencies {
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.0'
testImplementation 'com.h2database:h2'
runtimeOnly 'mysql:mysql-connector-java'
implementation 'com.lmax:disruptor:3.4.4'
implementation 'org.springframework.boot:spring-boot-starter-log4j2'
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.security:spring-security-crypto:5.5.2'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'de.codecentric:spring-boot-admin-starter-client:2.4.3'
implementation 'it.ozimov:embedded-redis:0.7.2'
testImplementation 'it.ozimov:embedded-redis:0.7.2'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.session:spring-session-data-redis'
testImplementation 'io.github.javaunit:autoparams:0.3.0'
testImplementation 'com.tngtech.archunit:archunit-junit5:0.20.1'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
implementation 'org.apache.commons:commons-lang3:3.12.0'
}
test {
outputs.dir snippetsDir
useJUnitPlatform()
finalizedBy('jacocoTestReport')
}
editorconfig {
excludes = ["build"]
}
jacoco {
toolVersion = '0.8.7'
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled true
csv.enabled false
}
finalizedBy 'jacocoTestCoverageVerification'
}
jacocoTestCoverageVerification {
violationRules {
rule {
enabled = true
element = 'CLASS'
excludes = [
"*.YouAndMeApplication",
"*.*Request",
"*.*Response",
"*.*Repository",
"*.*Reader",
"*.Role",
"*.configuration.*",
"*.SmtpMail*",
"*.RoleTypeHandler",
]
limit {
counter = 'BRANCH'
value = 'COVEREDRATIO'
minimum = 0.80
}
limit {
counter = 'INSTRUCTION'
value = 'COVEREDRATIO'
minimum = 0.50
}
}
}
}
check.dependsOn editorconfigCheck
checkstyle {
configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
configProperties = ["suppressionFile": "${project.rootDir}/config/checkstyle/checkstyle/checkstyle-suppressions.xml"]
toolVersion = "8.40"
ignoreFailures = false
maxErrors = 0
maxWarnings = 0
}
spotbugs {
ignoreFailures = false
reportLevel = "high"
spotbugsTest.enabled = false
}
tasks.withType(SpotBugsTask) {
reports {
text.enabled = true
xml.enabled = false
html.enabled = false
}
}
tasks.register("printSpotbugsMain") {
doLast {
File mainResult = file("${buildDir}/reports/spotbugs/main.txt")
if (mainResult.exists()) {
mainResult.readLines().forEach {
println(it)
}
}
}
}
tasks.getByPath("spotbugsMain").finalizedBy("printSpotbugsMain")