-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
108 lines (95 loc) · 2.41 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
plugins {
id 'org.springframework.boot' version '2.5.2'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'org.sonarqube' version '3.3'
id 'jacoco'
}
group = 'br.ufrn'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
compileOnly {
extendsFrom annotationProcessor
}
integrationImplementation.extendsFrom testImplementation
integrationRuntimeOnly.extendsFrom testRuntimeOnly
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'mysql:mysql-connector-java'
annotationProcessor 'org.projectlombok:lombok'
implementation 'org.springdoc:springdoc-openapi-ui:1.5.9'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
sourceSets {
test {
java.srcDirs = ['src/test/java']
resources.srcDirs = ['src/test/resources']
}
integration {
java.srcDirs = ['src/integration/java']
resources.srcDirs = ['src/integration/resources']
compileClasspath += sourceSets.main.output + sourceSets.test.output
runtimeClasspath += sourceSets.main.output + sourceSets.test.output
}
}
task integration(type:Test, description: 'Integration testing of API', group:'Verification') {
testClassesDirs = sourceSets.integration.output.classesDirs
classpath = sourceSets.integration.runtimeClasspath
outputs.upToDateWhen {false}
useJUnitPlatform(){
failFast = true
}
}
test {
systemProperty 'cucumber.options', '--plugin junit:target/surefire-reports/cucumber-junit.xml'
include '**/*Test.class'
useJUnitPlatform()
}
sonarqube {
properties {
property "sonar.projectKey", "Samuellucas97_Goal-List-CI-CD"
property "sonar.organization", "samuellucas97"
property "sonar.host.url", "https://sonarcloud.io"
}
}
jacocoTestReport {
dependsOn test
reports {
xml.required = true
csv.required = false
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.5
}
}
rule {
enabled = false
element = 'CLASS'
includes = ['org.gradle.*']
limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 0.3
}
}
}
}
build.dependsOn integration
integration.mustRunAfter test