-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
109 lines (91 loc) · 3.5 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
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.1'
id 'io.spring.dependency-management' version '1.1.7'
}
group = 'site.sharetable'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
// implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6'
implementation 'io.jsonwebtoken:jjwt:0.9.1' // JWT 라이브러리
implementation 'com.google.code.gson:gson:2.11.0'
implementation 'org.bouncycastle:bcprov-jdk18on:1.79'
// queryDsl 설정 ↓↓↓
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta"
annotationProcessor 'jakarta.annotation:jakarta.annotation-api'
annotationProcessor 'jakarta.persistence:jakarta.persistence-api'
// queryDsl 설정 ↑↑↑
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
// testAndDevelopmentOnly 'org.springframework.boot:spring-boot-docker-compose'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'org.postgresql:postgresql'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
// processResource 가 아닌 - `microsoft/variable-substitution@v1`, submodule 사용도 고려
// yaml file 의 환경변수 주입
def activeProfile = System.getenv("SPRING_PROFILES_ACTIVE") ?: "local"
processResources {
doFirst {
def appleKeyContent = System.getenv("APPLE_KEY")
if (appleKeyContent == null) {
throw new GradleException("APPLE_KEY ENV is Null")
}
def decodedAppleKeyContent = Base64.decoder.decode(appleKeyContent)
def outputDir = "${projectDir}/src/main/resources/secrets"
def outputFile = new File(outputDir, "apple-key.p8")
mkdir(outputDir)
outputFile.text = decodedAppleKeyContent
println "Make Apple Key File at ${outputFile}"
}
filesMatching("application.yaml") {
expand(SPRING_PROFILES_ACTIVE: activeProfile)
}
filesMatching("**/application-${activeProfile}.yaml") {
expand([
DATABASE_URL: System.getenv("DATABASE_URL"),
DATABASE_USERNAME: System.getenv("DATABASE_USERNAME"),
DATABASE_PASSWORD: System.getenv("DATABASE_PASSWORD"),
APPLE_TEAM_ID: System.getenv("APPLE_TEAM_ID"),
APPLE_LOGIN_KEY: System.getenv("APPLE_LOGIN_KEY"),
APPLE_CLIENT_ID: System.getenv("APPLE_CLIENT_ID"),
APPLE_REDIRECT_URL: System.getenv("APPLE_REDIRECT_URL"),
APPLE_KEY_PATH: "/secrets/apple-key.p8"
])
}
}
// queryDsl 설정 ↓↓↓
def querydslDir = "src/main/generated"
sourceSets {
main.java.srcDirs += [ querydslDir ]
}
tasks.withType(JavaCompile) {
options.generatedSourceOutputDirectory = file(querydslDir)
}
clean.doLast {
file(querydslDir).deleteDir()
}
// queryDsl 설정 ↑↑↑
tasks.named('test') {
useJUnitPlatform()
}