-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
151 lines (124 loc) · 4.22 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
151 lines (124 loc) · 4.22 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
143
144
145
146
147
148
149
150
151
plugins {
java
id("org.springframework.boot") version "3.5.11"
id("io.spring.dependency-management") version "1.1.7"
}
group = "com.ject"
version = "0.0.1-SNAPSHOT"
description = "Ject2-4th-server"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
sourceSets {
create("unitTest") {
java.setSrcDirs(listOf("src/unitTest/java"))
resources.setSrcDirs(listOf("src/unitTest/resources", "src/testFixtures/resources"))
compileClasspath += sourceSets.main.get().output
runtimeClasspath += output + compileClasspath
}
create("integrationTest") {
java.setSrcDirs(listOf("src/integrationTest/java"))
resources.setSrcDirs(listOf("src/integrationTest/resources", "src/testFixtures/resources"))
compileClasspath += sourceSets.main.get().output
runtimeClasspath += output + compileClasspath
}
}
configurations {
named("unitTestImplementation") {
extendsFrom(configurations.testImplementation.get())
}
named("unitTestRuntimeOnly") {
extendsFrom(configurations.testRuntimeOnly.get())
}
named("integrationTestImplementation") {
extendsFrom(configurations.testImplementation.get())
}
named("integrationTestRuntimeOnly") {
extendsFrom(configurations.testRuntimeOnly.get())
}
}
repositories {
mavenCentral()
}
dependencies {
implementation(Dependencies.SpringBoot.DATA_JPA)
implementation(Dependencies.SpringBoot.SECURITY)
implementation(Dependencies.SpringBoot.VALIDATION)
implementation(Dependencies.SpringBoot.WEB)
implementation(Dependencies.SpringBoot.ACTUATOR)
implementation(Dependencies.SpringBoot.OAUTH2_CLIENT)
implementation(Dependencies.SpringBoot.WEBSOCKET)
// Jwt
implementation(Dependencies.Jwt.API)
runtimeOnly(Dependencies.Jwt.IMPL)
runtimeOnly(Dependencies.Jwt.JACKSON)
// Database
runtimeOnly(Dependencies.Database.POSTGRESQL)
runtimeOnly(Dependencies.Database.H2)
implementation(Dependencies.Database.FLYWAY)
runtimeOnly(Dependencies.Database.FLYWAY_POSTGRESQL)
// Swagger / OpenAPI
implementation(Dependencies.Swagger.SPRINGDOC)
// Firebase (FCM)
implementation(Dependencies.Firebase.ADMIN)
// AWS S3
implementation(Dependencies.Aws.S3)
// Google Gemini AI
implementation(Dependencies.Ai.GEMINI)
// Cache (Caffeine)
implementation(Dependencies.Cache.CAFFEINE)
compileOnly(Dependencies.Lombok.LOMBOK)
annotationProcessor(Dependencies.Lombok.LOMBOK)
testImplementation(Dependencies.SpringBoot.TEST)
testImplementation(Dependencies.SpringSecurity.TEST)
testRuntimeOnly(Dependencies.Test.JUNIT_LAUNCHER)
// Testcontainers (for Postgres-specific integration tests)
"integrationTestImplementation"("org.testcontainers:testcontainers:1.21.3")
"integrationTestImplementation"("org.testcontainers:junit-jupiter:1.21.3")
"integrationTestImplementation"("org.testcontainers:postgresql:1.21.3")
// Spring Boot official Testcontainers support
"integrationTestImplementation"("org.springframework.boot:spring-boot-testcontainers:3.5.11")
}
tasks.withType<Test> {
useJUnitPlatform()
outputs.upToDateWhen { false }
outputs.cacheIf { false }
}
tasks.test {
enabled = false
}
val unitTest by tasks.registering(Test::class) {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Runs unit tests."
testClassesDirs = sourceSets["unitTest"].output.classesDirs
classpath = sourceSets["unitTest"].runtimeClasspath
}
val integrationTest by tasks.registering(Test::class) {
group = LifecycleBasePlugin.VERIFICATION_GROUP
description = "Runs integration tests. (Testcontainers 기반 실제 PostgreSQL 사용)"
testClassesDirs = sourceSets["integrationTest"].output.classesDirs
classpath = sourceSets["integrationTest"].runtimeClasspath
shouldRunAfter(unitTest)
// Docker가 없는 환경에서 통합 테스트를 건너뛰기 위한 옵션
onlyIf {
!project.hasProperty("skipIntegrationTests")
}
}
tasks.check {
setDependsOn(listOf(unitTest, integrationTest))
}
// API Client Generation Tasks
val extractSwagger by tasks.registering(apiclient.ExtractSwaggerTask::class)
val generateApiClient by tasks.registering(apiclient.GenerateApiClientTask::class) {
dependsOn(extractSwagger)
}
val publishApiClient by tasks.registering(apiclient.PublishApiClientTask::class) {
dependsOn(generateApiClient)
}