-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
139 lines (116 loc) · 5.49 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
139 lines (116 loc) · 5.49 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
plugins {
kotlin("jvm") version "2.3.21"
kotlin("plugin.spring") version "2.3.21"
kotlin("plugin.jpa") version "2.3.21"
id("org.springframework.boot") version "4.1.0"
id("io.spring.dependency-management") version "1.1.7"
id("org.jlleitschuh.gradle.ktlint") version "12.1.2"
jacoco
}
group = "com.nexters"
version = "0.0.1-SNAPSHOT"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
}
dependencies {
// Web / JSON
implementation("org.springframework.boot:spring-boot-starter-webmvc")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("tools.jackson.module:jackson-module-kotlin")
// Persistence
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
runtimeOnly("com.mysql:mysql-connector-j")
// 로컬 실행 시 docker-compose(MySQL) 자동 기동·종료 (배포 산출물에는 미포함)
developmentOnly("org.springframework.boot:spring-boot-docker-compose")
// DB Migration (Flyway) — spring-boot-flyway 모듈이 Boot 4 자동설정을 제공
implementation("org.springframework.boot:spring-boot-flyway")
implementation("org.flywaydb:flyway-core")
implementation("org.flywaydb:flyway-mysql")
// Security · Validation
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-validation")
// JWT — 자체 토큰 발급/파싱(jjwt), 소셜 토큰 서명 검증(nimbus)
implementation("io.jsonwebtoken:jjwt-api:0.12.6")
runtimeOnly("io.jsonwebtoken:jjwt-impl:0.12.6")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.12.6")
implementation("com.nimbusds:nimbus-jose-jwt:10.0.2")
// API Docs (Swagger)
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:3.0.0")
// Actuator (헬스체크 · 메트릭)
implementation("org.springframework.boot:spring-boot-starter-actuator")
// Prometheus 노출 포맷. 앱 코드는 Micrometer 코어 API(Actuator에 포함)만 쓰고 이 레지스트리는
// /actuator/prometheus 응답을 만드는 런타임 구현이라 runtimeOnly 로 둔다.
runtimeOnly("io.micrometer:micrometer-registry-prometheus")
// LLM — Gemini 공식 SDK (버전은 구현 시 Maven Central에서 최신으로 재확인)
implementation("com.google.genai:google-genai:1.51.0")
// 푸시 알림 — FCM 발송(Admin SDK). 소셜 로그인 토큰 검증은 이 SDK가 아니라 nimbus로 직접 한다.
implementation("com.google.firebase:firebase-admin:9.9.0")
// google-genai 내부 구현이 Jackson 2(com.fasterxml.jackson.databind)를 쓰고, 그 jar 안에
// META-INF/services에 Jackson2용 KotlinModule 등록이 딸려 있어서(google-genai 쪽 잔재 추정),
// 그 클래스가 클래스패스에 없으면 Hibernate의 Jackson JSON 포맷 매퍼 자동 감지(ObjectMapper.findModules())가
// ServiceConfigurationError로 죽는다. 우리 앱은 Jackson 3(tools.jackson)만 쓰고 이 모듈 자체는
// 안 쓰지만, 그 ServiceLoader 조회를 만족시키기 위해 runtime에만 추가한다.
runtimeOnly("com.fasterxml.jackson.module:jackson-module-kotlin:2.21.4")
// Test
testImplementation("org.springframework.boot:spring-boot-starter-webmvc-test")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.springframework.security:spring-security-test")
testImplementation("org.springframework.boot:spring-boot-testcontainers")
testImplementation(platform("org.testcontainers:testcontainers-bom:1.20.4"))
testImplementation("org.testcontainers:junit-jupiter")
testImplementation("org.testcontainers:mysql")
testImplementation("io.mockk:mockk:1.13.13")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict", "-Xannotation-default-target=param-property")
}
}
tasks.withType<Test> {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport)
}
// 실행 가능한 boot jar만 사용하므로 일반(plain) jar는 생성하지 않는다.
tasks.named("jar") {
enabled = false
}
ktlint {
version.set("1.8.0")
}
jacoco {
toolVersion = "0.8.13"
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required.set(true)
html.required.set(true)
}
// 부트스트랩 진입점(main)은 단위 테스트 대상이 아니므로 커버리지에서 제외한다.
classDirectories.setFrom(
classDirectories.files.map {
fileTree(it) { exclude("**/GamssApplication*") }
},
)
}
// Docker 이미지 빌드의 레이어 캐싱용 태스크. 컴파일·런타임·테스트 classpath 의존성을 미리 모두
// 내려받아, 소스와 분리된 Docker 레이어에 캐시되게 한다(build.gradle 이 그대로면 재다운로드 없음).
// configuration cache 호환: 해석 대상 FileCollection 을 설정 시점에 캡처하고, 실행 시점엔
// project/configurations 를 참조하지 않는다. lenient 로 개별 해석 실패가 빌드를 깨지 않게 한다.
tasks.register("resolveDependencies") {
val classpaths =
configurations
.filter { it.isCanBeResolved }
.map { it.incoming.artifactView { isLenient = true }.files }
inputs.files(classpaths)
doLast {
classpaths.forEach { it.count() }
}
}