-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
131 lines (108 loc) · 3.34 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
plugins {
id 'java'
id 'jacoco'
id 'org.springframework.boot' version '3.0.2'
id 'io.spring.dependency-management' version '1.1.0'
}
group = 'com.github.albertloubet'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
repositories {
mavenCentral()
maven { url 'https://artifactory-oss.prod.netflix.net/artifactory/maven-oss-candidates' }
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
ext {
set('springCloudVersion', "2022.0.1")
set('lombokVersion', '1.18.24')
set('mapStructVersion', '1.5.1.Final')
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.flywaydb:flyway-core'
implementation 'org.flywaydb:flyway-mysql'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
implementation "org.projectlombok:lombok:${lombokVersion}"
implementation "org.mapstruct:mapstruct:${mapStructVersion}"
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'org.webjars:webjars-locator-core:0.52'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.2'
implementation('org.springframework.boot:spring-boot-starter-security')
compileOnly "org.projectlombok:lombok:${lombokVersion}"
compileOnly "org.mapstruct:mapstruct:${mapStructVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapStructVersion}"
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.mysql:mysql-connector-j'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testAnnotationProcessor "org.projectlombok:lombok:${lombokVersion}"
testAnnotationProcessor "org.mapstruct:mapstruct-processor:${mapStructVersion}"
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
tasks.named('test') {
useJUnitPlatform()
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs = [
'-Amapstruct.unmappedTargetPolicy=IGNORE'
]
}
def coverageExclusions = [
'**/base/**/*',
'**/model/*',
'**/configuration/*',
'**/constant/**/*',
'**/exception/*',
'**/repository/**/*',
'PixManagerApplication.java'
]
private excludeFiles(classDirectories, coverageExclusions) {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: coverageExclusions)
}))
}
jacocoTestReport {
reports {
xml.enabled = true //true for link jacoco report with sonar
xml.enabled true //true for link jacoco report with sonar
csv.enabled false
html.destination file("${buildDir}/jacocoHtml")
xml.destination file("${buildDir}/reports/jacoco.xml")
}
afterEvaluate {
excludeFiles(classDirectories, coverageExclusions)
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
counter = 'BRANCH'
value = 'COVEREDRATIO'
minimum = 0.3
}
}
}
afterEvaluate {
excludeFiles(classDirectories, coverageExclusions)
}
}
check {
dependsOn jacocoTestCoverageVerification
}
test {
finalizedBy(jacocoTestReport)
}