-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
58 lines (46 loc) · 1.23 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-M2'
}
}
group 'ch.ocram.demo'
version '1.0.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: "jacoco"
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testCompile 'org.junit.jupiter:junit-jupiter-api:5.0.0-M2'
testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.0.0-M2'
}
project.afterEvaluate {
def junitPlatformTestTask = project.tasks.getByName('junitPlatformTest')
// configure jacoco to analyze the junitPlatformTest task
jacoco {
applyTo junitPlatformTestTask
}
// create junit platform jacoco task
project.task(type: JacocoReport, "junitPlatformJacocoReport",
{
sourceDirectories = files("./src/main")
classDirectories = files("$buildDir/classes/main")
executionData junitPlatformTestTask
})
}
jacocoTestReport {
group = "Reporting"
reports {
executionData = files("$buildDir/jacoco/junitPlatformTest.exec")
xml.enabled false
csv.enabled false
html.enabled true
html.destination "${buildDir}/reports/coverage"
}
}
check.dependsOn jacocoTestReport