-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
130 lines (110 loc) · 4.29 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
plugins {
id 'java'
id 'org.springframework.boot' version '3.3.2'
id 'io.spring.dependency-management' version '1.1.6'
id 'jacoco'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'
//Security
implementation 'org.springframework.boot:spring-boot-starter-security'
//JWT
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
implementation 'io.jsonwebtoken:jjwt-impl:0.11.5'
implementation 'io.jsonwebtoken:jjwt-jackson:0.11.5'
implementation 'javax.validation:validation-api:2.0.1.Final'
//firebase
implementation 'com.google.firebase:firebase-admin:9.2.0'
//redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-cache'
//rabbi-mq
implementation 'org.springframework.boot:spring-boot-starter-amqp'
runtimeOnly 'com.mysql:mysql-connector-j'
implementation 'mysql:mysql-connector-java:8.0.33'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'com.h2database:h2'
testImplementation "org.junit.jupiter:junit-jupiter:5.8.1"
testImplementation "org.testcontainers:testcontainers:1.17.6"
testImplementation "org.testcontainers:junit-jupiter:1.17.6"
testImplementation 'org.springframework.security:spring-security-test'
}
tasks.named('test') {
useJUnitPlatform()
}
tasks.named('test') {
useJUnitPlatform()
finalizedBy 'jacocoTestReport' // test가 끝나면 jacocoTestReport 동작
}
// jacoco report 설정
jacocoTestReport {
reports {
// html로 report 생성하기
// 빌드경로/jacoco/report.html 폴더 내부로 경로 설정
html.destination file("$buildDir/jacoco/report.html")
}
// 커버리지 보고서 제외 범위 설정
getClassDirectories().setFrom(
files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'**/dto',
'**/entity',
'**/global/**',
'**/user/**',
])
})
)
// jacocoTestReport가 끝나면 jacocoTestCoverageVerification 동작
finalizedBy 'jacocoTestCoverageVerification'
}
// jacoco 커버리지 검증 설정
jacocoTestCoverageVerification {
violationRules {
rule {
enabled = true // 커버리지 적용 여부
element = 'CLASS' // 커버리지 적용 단위
// 라인 커버리지 설정
// 적용 대상 전체 소스 코드들을 한줄 한줄 따졌을 때 테스트 코드가 작성되어 있는 줄의 빈도
// 테스트 코드가 작성되어 있는 비율이 90% 이상이어야 함
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.80
}
// 브랜치 커버리지 설정
// if-else 등을 활용하여 발생되는 분기들 중 테스트 코드가 작성되어 있는 빈도
// 테스트 코드가 작성되어 있는 비율이 90% 이상이어야 함
limit {
counter = 'BRANCH'
value = 'COVEREDRATIO'
minimum = 0.80
}
// 라인 최대 갯수 설정
// 빈 줄을 제외하고 하나의 자바 파일에서 작성될 수 있는 최대 라인 갯수
// 한 파일에 최대 500줄까지 작성되어야 함
limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 500
}
}
}
}