-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
179 lines (139 loc) · 4.59 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
plugins {
id 'java'
id 'org.springframework.boot' version '3.1.2'
id 'io.spring.dependency-management' version '1.1.2'
id 'jacoco'
}
group = 'com.insert'
version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = '17'
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-graphql'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'com.graphql-java:graphql-java-extended-scalars:21.0'
//s3 settings
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'
implementation 'org.hibernate.validator:hibernate-validator:8.0.1.Final'
implementation "org.hibernate.orm:hibernate-hikaricp:6.3.0.Final"
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
implementation 'com.github.leehj050211:bsm-oauth-java:1.0.3'
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.9.0'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'com.h2database:h2'
testImplementation 'org.assertj:assertj-core:3.21.0'
compileOnly 'org.projectlombok:lombok'
compileOnly 'io.jsonwebtoken:jjwt-api:0.11.5'
runtimeOnly 'com.mysql:mysql-connector-j'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'
//querydsl
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta"
annotationProcessor 'org.projectlombok:lombok'
//querydsl
implementation 'com.querydsl:querydsl-jpa:5.0.0:jakarta'
annotationProcessor "com.querydsl:querydsl-apt:${dependencyManagement.importedProperties['querydsl.version']}:jakarta"
annotationProcessor 'org.hibernate.orm:hibernate-jpamodelgen:6.2.2.Final'
annotationProcessor 'org.hibernate.validator:hibernate-validator-annotation-processor:8.0.1.Final'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'jakarta.persistence:jakarta.persistence-api'
annotationProcessor 'jakarta.annotation:jakarta.annotation-api'
}
compileJava {
options.annotationProcessorPath = configurations.annotationProcessor
}
// === Querydsl 빌드 옵션 (선택사항) ===
def querydslDir = "$buildDir/generated/querydsl"
sourceSets {
main.java.srcDir querydslDir
}
configurations {
querydsl.extendsFrom compileClasspath
}
//jacoco
jacoco {
toolVersion = "0.8.8"
}
jacocoTestReport {
dependsOn test
reports {
html.required = true
html.destination file("${buildDir}/jacoco/index.html")
}
//Evaluation 후에 report에서 뺼 클래스 및 패키지 설정
afterEvaluate {
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it, excludes: [
'com/insert/ogbsm/domain/**',
'com/insert/ogbsm/infra/**',
'com/insert/ogbsm/presentation/**',
])
})
)
}
finalizedBy 'jacocoTestCoverageVerification'
}
jacocoTestCoverageVerification {
def Qdomains = []
for (qPattern in '*.QA'..'*.QZ') { // qPattern = '*.QA', '*.QB', ... '*.QZ'
Qdomains.add(qPattern + '*')
}
violationRules {
rule {
enabled = true
element = "CLASS"
// limit {
// counter = 'LINE'
// value = 'COVEREDRATIO'
// minimum = 0.9
// }
//Evaluation할 때 제외하고 싶은 파일이나 패키지
afterEvaluate {
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it, excludes: [
'com/insert/ogbsm/domain/**',
'com/insert/ogbsm/infra/**',
'com/insert/ogbsm/presentation/**',
] + Qdomains)
})
)
}
}
}
}
task testCoverage(type: Test) {
group 'verification'
description 'Runs the unit tests with coverage'
dependsOn(':test',
':jacocoTestReport',
':jacocoTestCoverageVerification')
tasks['jacocoTestReport'].mustRunAfter(tasks['test'])
tasks['jacocoTestCoverageVerification'].mustRunAfter(tasks['jacocoTestReport'])
}
test {
useJUnitPlatform()
finalizedBy 'jacocoTestReport'
}
jar {
enabled = false
}