This repository has been archived by the owner on Aug 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
155 lines (131 loc) · 3.56 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
plugins {
id 'org.springframework.boot' version '2.5.3'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
id 'groovy'
id 'java'
id 'checkstyle'
id 'jacoco'
id 'java-test-fixtures'
id 'com.dorongold.task-tree' version '2.1.0'
}
group = 'kr.flab'
version = '1.0.1'
sourceCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
ext {
set('snippetsDir', file("build/generated-snippets"))
set('testcontainersVersion', "1.15.3")
}
// CheckStyle Configurations
checkstyle {
maxWarnings = 0
configFile = file("${rootDir}/coding-style/google-checkstyle.xml")
configProperties = ["suppressionFile" : "${rootDir}/coding-style/checkstyle-suppressions.xml"]
sourceSets = [project.sourceSets.main]
showViolations = true
toolVersion = "8.45"
}
task preCheckStyle() {
copy {
from "./githooks/pre-commit"
into "./.git/hooks"
}
}
checkstyleMain.dependsOn preCheckStyle
// Jacoco Configurations
def jacocoExcludes = [
'**/mybatis/typehandler/**',
'**/FreamApplication.class'
]
tasks.jacocoTestReport {
executionData(fileTree(project.buildDir).include("jacoco/*.exec"))
reports {
csv.enabled(true)
}
afterEvaluate {
getClassDirectories().setFrom(classDirectories.files.collect {
fileTree(dir: it, exclude: jacocoExcludes)
})
}
}
jacocoTestCoverageVerification {
executionData(fileTree(project.buildDir).include("jacoco/*.exec"))
violationRules {
rule {
element = 'CLASS'
limit {
counter = 'BRANCH'
minimum = 1.0
}
}
rule {
element = 'CLASS'
limit {
counter = 'LINE'
minimum = 1.0
}
}
}
afterEvaluate {
getClassDirectories().setFrom(classDirectories.files.collect {
fileTree(dir: it, exclude: jacocoExcludes)
})
}
}
test.finalizedBy jacocoTestReport
check.dependsOn jacocoTestCoverageVerification
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.flywaydb:flyway-core'
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.0'
implementation 'org.mybatis:mybatis-typehandlers-jsr310:1.0.2'
implementation 'org.codehaus.groovy:groovy:3.0.8'
implementation 'org.modelmapper:modelmapper:2.4.4'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'org.mindrot:jbcrypt:0.4'
implementation 'org.springframework.session:spring-session-jdbc'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'mysql:mysql-connector-java'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter-test:2.2.0'
testImplementation 'org.testcontainers:mysql'
testImplementation 'org.testcontainers:spock:1.15.3'
testImplementation 'org.spockframework:spock-core:2.0-groovy-3.0'
testImplementation 'org.spockframework:spock-spring:2.0-groovy-3.0'
testImplementation 'org.spockframework:spock-junit4:2.0-groovy-3.0'
testImplementation 'org.assertj:assertj-core:3.19.0'
}
dependencyManagement {
imports {
mavenBom "org.testcontainers:testcontainers-bom:${testcontainersVersion}"
}
}
test {
outputs.dir snippetsDir
useJUnitPlatform()
jacoco {
excludes += jacocoExcludes
}
}
tasks.withType(Test) {
useJUnitPlatform()
testLogging {
events = ["passed", "failed", "skipped"]
exceptionFormat = "full"
}
}
asciidoctor {
inputs.dir snippetsDir
dependsOn test
}