forked from Apress/java-unit-testing-with-junit-5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
62 lines (52 loc) · 1.67 KB
/
build.gradle
File metadata and controls
62 lines (52 loc) · 1.67 KB
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
buildscript {
repositories {
mavenCentral()
// The following is only necessary if you want to use SNAPSHOT releases.
// maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-RC2'
}
}
group 'com.junit5book'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: 'jacoco'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
def junitVersion = '5.0.0-RC2'
testCompile 'org.junit.jupiter:junit-jupiter-api:' + junitVersion
testCompile 'org.junit.jupiter:junit-jupiter-params:' + junitVersion
testRuntime 'org.junit.jupiter:junit-jupiter-engine:' + junitVersion
testCompile 'org.assertj:assertj-core:3.5.2'
testCompile 'org.mockito:mockito-core:2.+'
testCompile 'org.junit.platform:junit-platform-runner:1.0.0-RC2'
testCompile 'org.junit.jupiter:junit-jupiter-migrationsupport:' + junitVersion
testCompile 'junit:junit:4.12'
}
junitPlatform {
filters {
includeClassNamePattern '.*Spec'
enableStandardTestTask false
}
}
afterEvaluate {
jacoco {
toolVersion = '0.7.4.201502262128'
applyTo junitPlatformTest
}
task junit5JacocoReport(type: JacocoReport, dependsOn: junitPlatformTest) {
executionData junitPlatformTest
sourceDirectories = files(sourceSets.main.allSource.srcDirs)
classDirectories = files(sourceSets.main.output)
reports {
xml.enabled = true
html.enabled = true
}
}
build.dependsOn junit5JacocoReport
}