-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
103 lines (86 loc) · 2.61 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
plugins {
id 'org.springframework.boot' version '2.4.5'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'org.sonarqube' version '3.3'
id 'jacoco'
id 'java'
}
group = 'br.com.hello'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
ext {
set('springBootVersion', "2.4.5")
set('swaggerVersion', "2.9.2")
set('apacheCommonsVersion', "2.7")
set('apacheCommonsLangVersions', "2.6")
set('cucumberVersion', "7.2.3")
}
dependencies {
// Spring Boot
implementation "org.springframework.boot:spring-boot-starter:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-web:${springBootVersion}"
implementation "org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}"
// Test
testImplementation "org.springframework.boot:spring-boot-starter-test:${springBootVersion}"
testImplementation "io.cucumber:cucumber-junit:${cucumberVersion}"
testImplementation "io.cucumber:cucumber-spring:${cucumberVersion}"
testImplementation "io.cucumber:cucumber-java:${cucumberVersion}"
// Swagger
implementation "io.springfox:springfox-swagger2:${swaggerVersion}"
implementation "io.springfox:springfox-swagger-ui:${swaggerVersion}"
// Apache Commons
implementation "commons-io:commons-io:${apacheCommonsVersion}"
implementation "commons-lang:commons-lang:${apacheCommonsLangVersions}"
}
apply plugin: 'jacoco'
sonarqube {
properties {
property "sonar.projectKey", "Caiuzu_hello-world"
property "sonar.organization", "caiuzu"
property "sonar.host.url", "https://sonarcloud.io"
property 'sonar.exclusions',
"src/main/java/br/com/hello/world/HelloWorldApplication.java," +
"src/main/java/br/com/hello/world/config/**"
}
}
tasks.named('test') {
useJUnitPlatform()
test.finalizedBy jacocoTestReport
test.finalizedBy jacocoTestCoverageVerification
}
tasks.jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.enabled false
}
afterEvaluate {
getClassDirectories().from(files(classDirectories.files.collect {
fileTree(dir: it,
exclude: ["src/main/java/br/com/hello/world/HelloWorldApplication.java," +
"src/main/java/br/com/hello/world/config/**"]
)
}))
}
}
tasks.jacocoTestCoverageVerification {
violationRules {
rule {
// limit {
// counter = 'LINE'
// minimum = 0.8
// }
//
// limit {
// counter = 'BRANCH'
// minimum = 0.8
// }
excludes = ["src/main/java/br/com/hello/world/HelloWorldApplication.java," +
"src/main/java/br/com/hello/world/config/**"
]
}
}
}