forked from robertsmieja/junit5-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
69 lines (58 loc) · 2.14 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-RC3'
}
}
repositories {
mavenCentral()
}
ext.junit4Version = '4.12'
ext.junitVintageVersion = '4.12.0-RC3'
ext.junitPlatformVersion = '1.0.0-RC3'
ext.junitJupiterVersion = '5.0.0-RC3'
//ext.log4jVersion = '2.6.2'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.junit.platform.gradle.plugin'
compileTestJava {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
junitPlatform {
// platformVersion '1.0.0-RC3'
filters {
engines {
// include 'junit-jupiter', 'junit-vintage'
// exclude 'custom-engine'
}
tags {
// include 'fast'
// exclude 'slow'
}
// includeClassNamePattern '.*Test'
}
// enableStandardTestTask true
// reportsDir file('build/test-results/junit-platform') // this is the default
//logManager 'org.apache.logging.log4j.jul.LogManager'
}
tasks['eclipse'].dependsOn tasks['cleanEclipse'] //Delete previous Eclipse project files instead of merging them
tasks['junitPlatformTest'].ignoreExitValue = true //Don't fail the build when a test fails
dependencies {
// JUnit Jupiter API and TestEngine implementation
testCompile("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}")
testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}")
//For parameterized tests
testCompile("org.junit.jupiter:junit-jupiter-params:${junitJupiterVersion}")
//TODO Try removing this on the official release of Eclipse Oxygen.1
//Fix ClassDefNotFound issues in Eclipse
testCompile("org.junit.platform:junit-platform-launcher:${junitPlatformVersion}")
// If you also want to support JUnit 3 and JUnit 4 tests
testCompile("junit:junit:${junit4Version}")
testRuntime("org.junit.vintage:junit-vintage-engine:${junitVintageVersion}")
//testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}")
//testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}")
}