-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
executable file
·128 lines (117 loc) · 5.41 KB
/
build.gradle
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
buildscript {
ext {
springBootVersion = '3.3.1'
testContainerVersion = '1.19.5'
lombokVersion = '1.18.32'
jwtVersion = '0.11.5'
querydslVersion = '5.1.0'
zxingVersion = '3.5.3'
}
}
plugins {
id 'java'
id 'java-library'
id 'org.springframework.boot' version "${springBootVersion}"
id 'io.spring.dependency-management' version '1.1.4'
id 'com.diffplug.spotless' version '6.25.0'
id 'jacoco'
id 'org.sonarqube' version "5.0.0.4638"
}
wrapper {
gradleVersion = '8.7'
distributionUrl = distributionUrl.replace("bin", "all")
}
group = 'the.young.hana'
version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = '17'
}
repositories {
mavenCentral()
}
apply from: "$rootDir/spotless.gradle"
apply from: "$rootDir/jacoco.gradle"
apply from: "$rootDir/sonarqube.gradle"
dependencies {
implementation group: 'org.springframework.boot', name: 'spring-boot-starter', version: springBootVersion
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: springBootVersion
developmentOnly group: 'org.springframework.boot', name: 'spring-boot-devtools', version: springBootVersion
testRuntimeOnly group: 'org.junit.platform', name: 'junit-platform-launcher', version: '1.10.2'
compileOnly group: 'org.projectlombok', name: 'lombok', version: lombokVersion
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombokVersion
testCompileOnly group: 'org.projectlombok', name: 'lombok', version: lombokVersion
testAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombokVersion
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-log4j2', version: springBootVersion
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-aop', version: springBootVersion
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: springBootVersion
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation', version: springBootVersion
developmentOnly group: 'org.springframework.boot', name: 'spring-boot-docker-compose', version: springBootVersion
testImplementation group: 'org.testcontainers', name: 'testcontainers', version: testContainerVersion
testImplementation group: 'org.testcontainers', name: 'junit-jupiter', version: testContainerVersion
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: '2.5.0'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: springBootVersion
implementation group: 'com.mysql', name: 'mysql-connector-j', version: '8.4.0'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: springBootVersion
implementation group: 'org.springframework', name: 'spring-context', version: '6.1.10'
implementation group: 'io.micrometer', name: 'micrometer-registry-prometheus', version: '1.13.1'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis', version: springBootVersion
annotationProcessor group: 'org.springframework.boot', name: 'spring-boot-configuration-processor', version: springBootVersion
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: springBootVersion
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: jwtVersion
implementation group: 'io.jsonwebtoken', name: 'jjwt-impl', version: jwtVersion
implementation group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: jwtVersion
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf', version: springBootVersion
implementation group: 'com.querydsl', name: 'querydsl-jpa', version: querydslVersion, classifier: 'jakarta'
annotationProcessor group: 'com.querydsl', name: 'querydsl-apt', version: querydslVersion, classifier: 'jakarta'
annotationProcessor group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '3.0.0'
annotationProcessor group: 'jakarta.persistence', name: 'jakarta.persistence-api', version: '3.2.0'
implementation group: 'io.awspring.cloud', name: 'spring-cloud-starter-aws', version: '2.4.4'
implementation group: 'com.google.firebase', name: 'firebase-admin', version: '9.3.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.17.1'
implementation group: 'com.google.zxing', name: 'core', version: zxingVersion
implementation group: 'com.google.zxing', name: 'javase', version: zxingVersion
}
configurations {
all{
exclude module: 'spring-boot-starter-logging'
}
}
tasks.named('test') {
useJUnitPlatform()
testLogging {
events 'PASSED', 'FAILED', 'SKIPPED'
showStandardStreams = true
}
}
tasks.register('preCommitHook') {
doLast {
def gitHooksDirectory = new File("$project.rootDir/.git/hooks/")
if (!gitHooksDirectory.exists()) {
gitHooksDirectory.mkdirs()
}
new File("$project.rootDir/.git/hooks", "pre-commit").text =
"""#!/bin/bash
echo "코드 포맷팅을 검사합니다."
./gradlew spotlessCheck
STYLE_RESULT=\$?
if [ \$STYLE_RESULT -eq 0 ]
then
echo "코드 포맷팅 검사에 통과하였습니다."
echo "테스트를 실행합니다."
./gradlew test
TEST_RESULT=\$?
if [ \$TEST_RESULT -eq 0 ]
then
echo "테스트가 성공하였습니다."
else
echo "테스트가 실패하였습니다." >&2
exit 1
fi
else
echo "코드 포맷팅 검사에 실패하였습니다." >&2
exit 1
fi
"""
"chmod +x .git/hooks/pre-commit".execute()
}
}