-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
109 lines (94 loc) · 3.19 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
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.11'
id 'com.diffplug.spotless' version '6.11.0'
}
repositories {
mavenCentral()
}
jar.enabled = false
bootJar.enabled = false
subprojects {
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
apply plugin: 'java'
// build.gradle에서 api() 를 사용하려면 java-library 사용
apply plugin: 'java-library'
apply plugin: 'org.springframework.boot'
// spring boot dependency를 사용하여 사용중인 부트 버전에서 자동으로 의존성을 가져온다.
apply plugin: 'io.spring.dependency-management'
apply plugin: 'jacoco'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
// 관리하는 모듈에 공통 dependencies
dependencies {
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-autoconfigure'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
runtimeOnly 'com.h2database:h2'
}
jacoco {
toolVersion = "0.8.10"
}
jacocoTestReport {
reports {
html.enabled true
xml.enabled true
csv.enabled false
html.destination file("${buildDir}/jacoco/index.html")
xml.destination file("${buildDir}/jacoco/index.xml")
// csv.destination file("${buildDir}/jacoco/index.csv")
}
def Qdomains = []
for (qPattern in '**/QA'..'**/QZ') { // qPattern = '**/QA', '**/QB', ... '*.QZ'
Qdomains.add(qPattern + '*')
}
afterEvaluate {
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it, excludes: [
"**/*Application*",
"**/*Config*",
"**/*Dto*",
"**/*Request*",
"**/*Response*",
"**/*Interceptor*",
"**/*Exception*"
] + Qdomains)
})
)
}
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
}
spotless {
java {
target("**/*.java")
targetExclude("**/SecurityConfig.java", "**/SwaggerConfig.java")
googleJavaFormat().aosp() // 구글 자바 포맷 적용
importOrder() // import 순서 정의
removeUnusedImports() // 사용하지 않는 import 제거
trimTrailingWhitespace() // 공백 제거
endWithNewline() // 끝부분 New Line 처리
}
}
tasks.register('updateGitHooks', Copy) {
from './scripts/pre-commit'
into './.git/hooks'
fileMode 0775
}
compileJava.dependsOn updateGitHooks