-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjacoco.gradle
More file actions
73 lines (63 loc) · 2.26 KB
/
jacoco.gradle
File metadata and controls
73 lines (63 loc) · 2.26 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
plugins.withId('jacoco') {
jacoco { toolVersion = "0.8.13" }
// 모든 Test 작업 공통 설정: JUnit5
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
// 기본 test만 끝난 뒤 리포트 1회 실행
tasks.named('test', Test).configure {
finalizedBy('jacocoTestReport')
}
// 3) 리포트 → 검증 순서 고정
tasks.named('jacocoTestReport', JacocoReport).configure {
dependsOn('test')
reports {
xml.required = true // CI 파싱용 (PR 코멘트 액션)
csv.required = false
html.required = true // 로컬/아티팩트 열람용
}
def javaMainDir = layout.buildDirectory.dir('classes/java/main').get().asFile
classDirectories.setFrom(
fileTree(javaMainDir) {
exclude(
'**/config/**','**/dto/**','**/model/**','**/*Application.class',
'**/exception/**','**/common/**','**/constant/**',
'**/logging/**','**/notification/**','**/test/**','**/infrastructure/**'
)
}
)
finalizedBy('jacocoTestCoverageVerification')
}
tasks.named('jacocoTestCoverageVerification', JacocoCoverageVerification).configure {
dependsOn('jacocoTestReport')
violationRules {
rule {
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.00
}
}
rule {
limit {
counter = 'BRANCH'
value = 'COVEREDRATIO'
minimum = 0.00
}
}
rule {
element = 'CLASS'
excludes = [
'*.config.*','*.dto.*','*.model.*','*Application',
'*.exception.*','*.common.*','*.constant.*',
'*.logging.*','*.notification.*','*.test.*','*.infrastructure.*'
]
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.00
}
}
}
}
}