-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
162 lines (135 loc) · 5.06 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
plugins {
id 'java'
id 'jacoco'
id 'org.springframework.boot' version '3.2.4'
id 'io.spring.dependency-management' version '1.1.4'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
id 'org.sonarqube' version '4.2.1.3168'
}
group = 'site.iris'
version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = '17'
}
repositories {
mavenCentral()
}
ext {
snippetsDir = file('build/generated-snippets')
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
asciidoctorExt
}
dependencies {
// Spring Boot
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: '3.2.0'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-webflux', version: '3.3.2'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-aop', version: '3.3.1'
// DB
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation group: 'com.mysql', name: 'mysql-connector-j', version: '8.2.0'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis', version: '3.2.5'
// Monitoring
implementation group: 'io.micrometer', name: 'micrometer-registry-prometheus', version: '1.12.4'
runtimeOnly 'io.netty:netty-resolver-dns-native-macos:4.1.100.Final:osx-aarch_64'
// JWT
implementation 'io.jsonwebtoken:jjwt-api:0.12.5'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.5'
// MapStruct
implementation 'org.mapstruct:mapstruct:1.5.5.Final'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.5.Final'
// REST Docs
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
// Test
testImplementation group: 'com.squareup.okhttp3', name: 'mockwebserver', version: '4.12.0'
testImplementation 'org.testcontainers:testcontainers:1.19.8'
testImplementation 'org.testcontainers:junit-jupiter:1.19.8'
testImplementation "org.testcontainers:mysql:1.19.8"
testImplementation group: 'io.projectreactor', name: 'reactor-test', version: '3.6.9'
testImplementation 'org.springframework.restdocs:spring-restdocs-webtestclient'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
}
def jacocoDir = layout.buildDirectory.dir("reports/")
sonar {
properties {
property 'sonar.host.url', 'https://sonarcloud.io'
property 'sonar.organization', '2024-iris'
property 'sonar.projectKey', '2024-Iris_issuefy-spring'
property 'sonar.sourceEncoding', 'UTF-8'
property 'sonar.language', 'java'
property 'sonar.java.coveragePlugin', 'jacoco'
property 'sonar.exclusions', '**/test/**, **/Q*.java, **/*Doc*.java, **/resources/**, **/*Application*.java, **/*Config*.java, ' +
'**/*Vo.java, **/*Dto.java, **/*DTO*.java, **/*Request*.java, **/*Response*.java, **/*Exception*.java, **/*ErrorCode*.java, ' +
'**/entity/**, **/*Record*.java, **/component/**, **/util/**'
property 'sonar.coverage.jacoco.xmlReportPaths', jacocoDir.get().file("jacoco/index.xml").asFile
}
}
jacoco {
toolVersion '0.8.8'
}
jacocoTestReport {
reports {
xml.required.set(true)
csv.required.set(true)
html.required.set(true)
html.destination jacocoDir.get().file("jacoco/index.html").asFile
xml.destination jacocoDir.get().file("jacoco/index.xml").asFile
csv.destination jacocoDir.get().file("jacoco/index.csv").asFile
}
afterEvaluate {
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it, excludes: [
'**/*Application.*',
'**/*Status*',
'**/*Exception*',
'**/vo/**',
'**/dto/**',
'**/entity/**',
'**/response/**',
'**/component/**',
'**/util/**'
])
})
)
}
}
test {
outputs.dir snippetsDir
}
asciidoctor {
inputs.dir snippetsDir
configurations 'asciidoctorExt'
dependsOn test
}
asciidoctor.doFirst {
delete file('src/main/resources/static/docs')
}
bootJar {
dependsOn asciidoctor
from("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
}
tasks.register('copyDocument', Copy) {
dependsOn asciidoctor
from file("${asciidoctor.outputDir}")
into file("src/main/resources/static/docs")
}
build {
dependsOn tasks.named('copyDocument')
}
tasks.named('test') {
useJUnitPlatform()
finalizedBy 'jacocoTestReport'
}