-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
118 lines (102 loc) · 3.23 KB
/
Copy pathbuild.gradle
File metadata and controls
118 lines (102 loc) · 3.23 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
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
plugins {
id 'java'
id 'org.springframework.boot' version '3.1.1'
id 'io.spring.dependency-management' version '1.1.0'
id 'jacoco'
}
group = 'com.soma'
version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = '17'
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
// Spring Data JPA
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
// OAuth
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
// Spring Security
implementation 'org.springframework.boot:spring-boot-starter-security'
// Web
implementation 'org.springframework.boot:spring-boot-starter-web'
// lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
// devtools
developmentOnly 'org.springframework.boot:spring-boot-devtools'
// h2
runtimeOnly 'com.h2database:h2'
// mariadb
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
// mysql
implementation 'mysql:mysql-connector-java:8.0.32'
// test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
// security test
testImplementation 'org.springframework.security:spring-security-test'
// jwt
implementation 'com.auth0:java-jwt:4.2.1'
// Spring Data Redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
// Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'
// firebase
implementation 'com.google.firebase:firebase-admin:9.1.1'
// sentry - spring boot
implementation 'io.sentry:sentry-spring-boot-starter-jakarta:6.27.0'
// sentry - logback
implementation 'io.sentry:sentry-logback:6.25.2'
// actuator
implementation 'org.springframework.boot:spring-boot-starter-actuator'
// validation
implementation 'org.springframework.boot:spring-boot-starter-validation'
}
tasks.named('test') {
useJUnitPlatform()
}
// Spring Boot 2.5 이상의 버전에서는 빌드시 일반 jar 1개와 -plain.jar 파일 1개가 함께 생성된다.
// 빌드시 plain jar 파일을 생성되지 않도록 아래의 내용 추가
jar {
enabled = false
}
// jacoco
test{
finalizedBy jacocoTestReport // test 작업이 끝나고 jacocoTestReport를 실행
}
jacoco {
toolVersion = "0.8.8"
reportsDirectory = layout.buildDirectory.dir('customJacocoReportDir')
}
// test 결과를 report로 생성
jacocoTestReport {
reports {
xml.required = false
csv.required = false
html.outputLocation = layout.buildDirectory.dir('jacocoHTML')
}
// dependsOn : 이 작업에 지정된 종속성을 추가
dependsOn test // jacocoTestReport 에 test라는 종속성을 추가
finalizedBy 'jacocoTestCoverageVerification'
}
// jacocoTestReport 결과를 바탕으로 coverage가 만족되었는지를 체크
jacocoTestCoverageVerification {
violationRules {
rule {
enabled = true
//코드 버커리지 체크 기준
element = 'CLASS'
limit {
counter = 'METHOD'
value = 'COVEREDRATIO'
minimum = 0.0
}
}
}
}