forked from Universenn/my-sns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
103 lines (83 loc) · 2.72 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
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.5'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id 'jacoco'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = '11'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter'
compileOnly 'org.projectlombok:lombok'
//Swagger
implementation 'io.springfox:springfox-swagger-ui:3.0.0'
implementation 'io.springfox:springfox-boot-starter:3.0.0'
// jpa
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
// thymeleaf
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
// implementation 'eu.cedarsoft.devtools:devtools:1.1'
// db
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'
// security
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.security:spring-security-test'
// jwt
implementation 'io.jsonwebtoken:jjwt:0.9.1'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
jacoco {
// JaCoCo 버전
toolVersion = '0.8.8'
}
jacocoTestReport {
reports {
// 원하는 리포트를 켜고 끌 수 있습니다.
html.enabled true
xml.enabled false
csv.enabled false
afterEvaluate {
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it,
includes: [
'com/example/mysns/controller/*',
'com/example/mysns/service/*',
],
excludes: [
'com/example/mysns/controller/HelloController**',
])
})
)
}
//리포트 위치 지정
html.destination file('build/reports/myReport.html')
}
finalizedBy 'jacocoTestCoverageVerification'
}
jacocoTestCoverageVerification{
violationRules {
rule {
enabled = true // 활성화
element = 'CLASS' // 클래스 단위로 커버리지 체크
includes = [
'**/restController*',
'**/service'
]
}
}
}
tasks.named('test') {
useJUnitPlatform()
finalizedBy 'jacocoTestReport'
}