-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
126 lines (107 loc) · 3.36 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
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.13'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id 'com.google.osdetector' version "1.7.1" // https://github.com/netty/netty/issues/11020
id 'jacoco' // add jacoco plugin
}
jacoco {
toolVersion = '0.8.10'
}
jacocoTestReport {
reports {
html.required.set(true)
// To use codecov, enable xml.
// reference link: https://docs.codecov.com/docs/supported-report-formats
xml.required.set(true)
csv.required.set(false)
// path where result is saved
html.destination file("jacoco/")
}
// Ignore classes: Application, DTO, Config, etc
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"org/ai/roboadvisor/**/**AdvisorApplication*",
"org/ai/roboadvisor/**/*Dto*",
"org/ai/roboadvisor/**/*dto*",
"org/ai/roboadvisor/**/*Request*",
"org/ai/roboadvisor/**/*Response*",
"org/ai/roboadvisor/**/*entity*",
"**/*Config*",
"**/*Exception*",
"**/*exception*",
])
}))
}
finalizedBy 'jacocoTestCoverageVerification'
}
jacocoTestCoverageVerification {
violationRules {
rule {
enabled = true
limit {
value = 'COVEREDRATIO'
minimum = 0.10
}
excludes = [
"**.*AdvisorApplication*",
"**.*Dto*",
"**.*dto*",
"**.*Request*",
"**.*Response*",
"**.*entity*",
"**.*Config*",
"**.*Exception*",
"**.*exception*",
]
}
}
}
group = 'org.ai'
version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = '17'
}
// To remove plain.jar in build/libs
jar {
enabled = false
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
if (osdetector.classifier == "osx-aarch_64") {
runtimeOnly("io.netty:netty-resolver-dns-native-macos:4.1.77.Final:${osdetector.classifier}")
}
// spring
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
// lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
// database
implementation group: 'mysql', name: 'mysql-connector-java', version: '8.0.31'
// swagger
implementation 'org.springdoc:springdoc-openapi-ui:1.7.0'
// jsoup
implementation 'org.jsoup:jsoup:1.16.1'
// etc
implementation 'com.google.code.gson:gson:2.9.0'
// test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
// WireMock
testImplementation "com.github.tomakehurst:wiremock-jre8:2.35.0"
testImplementation "org.assertj:assertj-core:3.24.2"
}
tasks.named('test') {
useJUnitPlatform()
finalizedBy 'jacocoTestReport'
}