-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
142 lines (112 loc) · 4.32 KB
/
build.gradle
File metadata and controls
142 lines (112 loc) · 4.32 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.4'
id 'io.spring.dependency-management' version '1.1.7'
id 'jacoco'
}
group = 'org.devkor.apu'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
// https://mvnrepository.com/artifact/org.hibernate.orm/hibernate-spatial
implementation("org.hibernate.orm:hibernate-spatial:6.6.11.Final")
implementation 'org.flywaydb:flyway-core:11.7.1'
implementation 'org.flywaydb:flyway-database-postgresql:11.7.1'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.6'
testImplementation 'org.testcontainers:testcontainers'
testImplementation 'org.testcontainers:postgresql'
implementation 'org.mapstruct:mapstruct:1.6.3'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.6.3'
testAnnotationProcessor 'org.mapstruct:mapstruct-processor:1.6.3'
// QueryDSL 의존성 설정
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta"
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.security:spring-security-test' // 보안 테스트를 위한 의존성 추가
// AWS SDK BOM, S3 SDK + Presigner
implementation platform('software.amazon.awssdk:bom:2.27.21')
implementation 'software.amazon.awssdk:s3'
// AWS KMS
implementation 'software.amazon.awssdk:kms'
// JWT 발급 및 검증
implementation 'com.auth0:java-jwt:4.5.0'
// WebClient를 쓰기 위해 WebFlux 의존성 추가
implementation 'org.springframework.boot:spring-boot-starter-webflux'
// 금칙어 필터링 라이브러리 의존성 추가
implementation 'io.github.vaneproject:badwordfiltering:1.0.0'
// FCM admin SDK 추가
implementation 'com.google.firebase:firebase-admin:9.5.0'
// Redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
// Guava (동시성 제어용)
implementation 'com.google.guava:guava:33.4.0-jre'
}
tasks.named('test') {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
reports {
html.required = true
xml.required = true
}
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs += [
'-Amapstruct.incrementalProcessing=true',
'-Amapstruct.suppressGeneratorTimestamp=true'
]
}
tasks.withType(Test).configureEach {
systemProperty 'file.encoding', 'UTF-8'
}
tasks.named('jacocoTestReport') {
doLast {
def xmlFile = reports.xml.outputLocation.get().asFile
if (!xmlFile.exists()) {
logger.lifecycle("⛔ JaCoCo XML not found: $xmlFile")
return
}
// DOCTYPE 제거 후 문자열 파싱
def cleaned = xmlFile.getText('UTF-8')
.replaceFirst(/<!DOCTYPE[^>]*>\R?/, '')
def report = new XmlSlurper().parseText(cleaned)
def instr = report.counter.find { it.@type == 'INSTRUCTION' }
// ➡ 문자열로 바꾼 뒤 숫자로 변환
def covered = instr.@covered.text().toInteger()
def missed = instr.@missed.text().toInteger()
def pct = (covered + missed)
? (covered / (covered + missed) * 100).round(2)
: 0
println """
────────────────────────────────────────────
JaCoCo Total Instruction Coverage: ${pct}%
covered = $covered, missed = $missed
────────────────────────────────────────────
""".stripIndent()
}
}