-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
145 lines (113 loc) · 3.65 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
plugins {
id 'java-library'
id 'org.springframework.boot' apply(false)
id 'io.spring.dependency-management'
id 'org.sonarqube' version '4.4.1.3373' apply(false)
}
allprojects {
group = "${projectGroup}"
version = "${applicationVersion}"
sourceCompatibility = project.javaVersion
repositories {
mavenCentral()
}
}
subprojects {
apply plugin: 'java-library'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'org.sonarqube'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
apply plugin: 'jacoco-report-aggregation'
sonar {
properties {
property "sonar.projectKey", "CMC11th-Melly_Melly_Server"
property "sonar.organization", "cmc11th-melly"
property "sonar.host.url", "https://sonarcloud.io"
}
}
bootJar.enabled = false // core-api 모듈 이외에는 모두 boot 되지 않는 모듈
jar.enabled = true // jar는 필요함
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudDependenciesVersion}"
}
}
jacoco {
toolVersion = '0.8.8'
}
jacocoTestReport {
// jacoco report 형식 및 경로 설정
reports {
html.required = true
csv.required = false
xml.required = true
}
def Qdomains = []
for (qPattern in '**/QA'..'**/QZ') {
Qdomains.add(qPattern + '*')
}
afterEvaluate {
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it, excludes: [] + Qdomains)
})
)
}
finalizedBy 'jacocoTestCoverageVerification' // jacocoTestReport를 실행 후 jacocoTestCoverageVerification 실행
}
jacocoTestCoverageVerification {
def Qdomains = []
for (qPattern in '*.QA'..'*.QZ') { // qPattern = '*.QA', '*.QB', ... '*.QZ'
Qdomains.add(qPattern + '*')
}
violationRules {
rule {
enabled = true
element = 'CLASS'
// includes = []
limit {
counter = 'BRANCH'
value = 'COVEREDRATIO'
minimum = 0.0
}
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0.0
}
limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 200
}
excludes = [] + Qdomains
}
}
}
dependencies {
// lombok
implementation 'org.projectlombok:lombok:1.18.20'
annotationProcessor 'org.projectlombok:lombok:1.18.20'
testAnnotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
// test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation group: 'org.testcontainers', name: 'testcontainers', version: '1.17.2'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.8.0'
testImplementation "com.h2database:h2"
}
test {
useJUnitPlatform()
finalizedBy 'jacocoTestReport' // test가 끝나면 jacocoTestReport를 실행
}
}
// Sub-Module 적용
task copyPrivate(type: Copy) {
copy {
from './lib'
include "*.yml", "*.json"
into 'core/core-api/src/main/resources'
}
}