forked from junit-team/junit5-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
68 lines (55 loc) · 1.58 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
plugins {
id 'com.gradle.build-scan' version '1.13.4'
id 'java'
id 'eclipse' // optional (to generate Eclipse project files)
id 'idea' // optional (to generate IntelliJ IDEA project files)
}
int javaVersion = Integer.valueOf(JavaVersion.current().getMajorVersion())
if (javaVersion < 9) {
apply plugin: 'jacoco'
}
buildScan {
licenseAgreementUrl = "https://gradle.com/terms-of-service"
licenseAgree = "yes"
}
repositories {
mavenCentral()
}
dependencies {
def junit4Version = '4.12'
def junitVintageVersion = '5.3.1'
def junitJupiterVersion = '5.3.1'
def junitPlatformVersion = '1.3.1'
// JUnit Jupiter API and TestEngine implementation
testCompile("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
testCompile("junit:junit:${junit4Version}")
testRuntime("org.junit.vintage:junit-vintage-engine:${junitVintageVersion}") {
because 'allows JUnit 3 and JUnit 4 tests to run'
}
testRuntime("org.junit.platform:junit-platform-launcher:${junitPlatformVersion}") {
because 'allows tests to run from IDEs that bundle older version of launcher'
}
}
if (project.plugins.findPlugin('jacoco')) {
jacoco {
toolVersion = '0.8.1'
}
}
test {
useJUnitPlatform {
// includeEngines 'junit-jupiter', 'junit-vintage'
// excludeEngines 'custom-engine'
// includeTags 'fast'
excludeTags 'slow'
}
testLogging {
events 'passed', 'skipped', 'failed'
}
if (project.plugins.findPlugin('jacoco')) {
finalizedBy jacocoTestReport
}
}
wrapper {
gradleVersion = '4.8'
}