-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
117 lines (94 loc) · 2.65 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
117 lines (94 loc) · 2.65 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
plugins {
id("java")
id("checkstyle")
alias(libs.plugins.spring.boot)
alias(libs.plugins.spring.dependency.management)
}
// QueryDSL 설정
val querydslDir = "build/generated/querydsl"
group = "com.bifos"
version = "1.0-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_21
configurations {
compileOnly {
extendsFrom(configurations.annotationProcessor.get())
}
}
repositories {
mavenCentral()
}
dependencies {
// Spring Boot Starters (Bundle 사용)
implementation(libs.bundles.spring.boot.starters)
// Database
runtimeOnly(libs.mysql.connector.j)
implementation(libs.flyway.mysql)
// SQL Logging (DataSource Proxy)
implementation(libs.p6spy.spring.boot.starter)
// JWT (Bundle 사용)
implementation(libs.jjwt.api)
runtimeOnly(libs.bundles.jwt)
// OpenAPI (Swagger)
implementation(libs.springdoc.openapi.starter.webmvc.ui)
// Cache
implementation(libs.caffeine)
// Lombok
compileOnly(libs.lombok)
annotationProcessor(libs.lombok)
testCompileOnly(libs.lombok)
testAnnotationProcessor(libs.lombok)
// QueryDSL
implementation("${libs.querydsl.jpa.get()}:jakarta")
annotationProcessor("${libs.querydsl.apt.get()}:jakarta")
annotationProcessor(libs.spring.boot.starter.data.jpa)
// Jackson
implementation(libs.jackson.module.parameter.names)
implementation(libs.jackson.datatype.jsr310)
// Test (Bundle 사용)
testImplementation(libs.bundles.spring.test)
testRuntimeOnly(libs.junit.platform.launcher)
testRuntimeOnly(libs.h2.database)
}
// QueryDSL 컴파일 설정
tasks.withType<JavaCompile> {
options.generatedSourceOutputDirectory.set(file(querydslDir))
}
// QueryDSL 소스 디렉토리 추가
sourceSets {
main {
java {
srcDirs(querydslDir)
}
}
}
// clean 시 generated 디렉토리 삭제
tasks.clean {
delete(querydslDir)
}
tasks.test {
useJUnitPlatform()
}
// Checkstyle 설정 (Google Java Style)
checkstyle {
toolVersion = "10.12.5"
configFile = file("${rootDir}/config/checkstyle/google_checks.xml")
isIgnoreFailures = false
maxWarnings = 0
}
tasks.withType<Checkstyle> {
// Generated 파일 제외 (QueryDSL Q클래스 등)
exclude("**/generated/**", "**/build/generated/**", "**/Q*.java")
reports {
xml.required.set(false)
html.required.set(true)
}
}
// checkstyleMain은 compile 이후에만 실행
tasks.named("checkstyleMain") {
mustRunAfter(tasks.named("compileJava"))
mustRunAfter(tasks.named("compileTestJava"))
}
// Disable plain jar (only create executable boot jar)
tasks.jar {
enabled = false
}