-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
52 lines (43 loc) · 1.11 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
plugins {
id 'java'
id 'jacoco'
}
repositories {
mavenCentral()
}
dependencies {
testImplementation "org.testng:testng:${testngVersion}"
}
test {
useTestNG() {
suites 'src/test/resources/testng.xml'
}
finalizedBy jacocoTestReport
}
jacoco {
toolVersion = jacocoVersion
reportsDirectory = file("$rootProject.projectDir/build/reports/jacoco")
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
xml.required = true
}
}
task codeCoverageReport(type: JacocoReport) {
dependsOn test
executionData fileTree(project.rootDir.absolutePath).include("**/build/coverage-reports/*.exec")
reports {
xml.required = true
html.required = true
csv.required = true
xml.destination(new File("${buildDir}/reports/jacoco/report.xml"))
html.destination(new File("${buildDir}/reports/jacoco/report.html"))
csv.destination(new File("${buildDir}/reports/jacoco/report.csv"))
}
onlyIf = {
true
}
}
jacocoTestReport.dependsOn test
build.dependsOn jacocoTestReport