-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
114 lines (89 loc) · 3.08 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
plugins {
id 'org.springframework.boot' version '2.5.4'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id "org.asciidoctor.jvm.convert" version "3.3.2"
id 'jacoco'
}
group = 'com.ae'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
asciidoctorExtensions
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
//롬복 설치
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
//Spring Data JPA
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
//Firebase 연동
implementation group: 'com.google.firebase', name: 'firebase-admin', version: '8.0.1'
// MariaDB 드라이버 추가
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
// H2 DB 드라이버 추가
runtimeOnly 'com.h2database:h2'
// .adoc 파일에서 빌드, 스니펫 생성을 자동으로 구성되기 위해 추가하는 의존성
asciidoctorExtensions 'org.springframework.restdocs:spring-restdocs-asciidoctor'
// restdocs에서 MockMvc를 사용할 때 사용하는 의존성
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
implementation group: 'org.springframework.restdocs', name: 'spring-restdocs-core'
// Valid 애노테이션 사용을 위한 의존성 추가
implementation group: 'javax.validation', name: 'validation-api'
//AWS S3 의존성 추가
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-aws', version: '2.2.1.RELEASE'
}
// 스니펫이 위치할 경로를 지정한다.
ext {
snippetsDir = file('build/generated-snippets')
}
test {
useJUnitPlatform()
// 스니펫 디렉터리를 출력으로 추가하도록 테스트 작업
outputs.dir snippetsDir
// Jenkins에서 빌드할때에는 JPA구성이 되어있지 않아 빌드시에는 제외하도록 설정
filter {
excludeTestsMatching "com.ae.stagram.domain.**.dao.*"
}
finalizedBy('jacocoTestReport')
}
// ext에서 정의한 경로에 스니펫을 넣어준뒤 테스트를 진행한다.
asciidoctor {
configurations "asciidoctorExtensions"
inputs.dir snippetsDir
dependsOn test
}
asciidoctor.doFirst {
delete file('src/main/resources/static/docs')
}
task copyDocument(type: Copy) {
dependsOn asciidoctor
from file("build/docs/asciidoc")
// into file("${sourceSets.main.output.resourcesDir}/static/docs")
into file("src/main/resources/static/docs")
}
build {
dependsOn copyDocument
}
jar {
// springboot v2.5 이상부터는 빌드 시 plain 아카이브가 생성된다.
// docker로 배포하기위해서는 하나의 jar만 필요함으로 plan.jar를 제거하기위한 설정
enabled = false
}
jacoco{
toolVersion = "0.8.5"
}
jacocoTestReport{
reports{
xml.enabled = true
html.enabled = true
}
}