1+ buildscript {
2+ repositories {
3+ mavenCentral()
4+ }
5+ dependencies {
6+ classpath ' org.junit.platform:junit-platform-gradle-plugin:1.0.2'
7+ classpath ' com.google.guava:guava:23.5-jre'
8+ classpath ' org.mockito:mockito-all:2.0.2-beta'
9+ }
10+ }
11+
12+ repositories {
13+ mavenCentral()
14+ }
15+
16+ ext. junit4Version = ' 4.12'
17+ ext. junitVintageVersion = ' 4.12.2'
18+ ext. junitPlatformVersion = ' 1.0.2'
19+ ext. junitJupiterVersion = ' 5.0.2'
20+ ext. log4jVersion = ' 2.9.0'
21+
22+ apply plugin : ' java'
23+ apply plugin : ' eclipse'
24+ apply plugin : ' idea'
25+ apply plugin : ' org.junit.platform.gradle.plugin'
26+
27+ jar {
28+ baseName = ' junit5-gradle-consumer'
29+ }
30+
31+ compileTestJava {
32+ sourceCompatibility = 1.9
33+ targetCompatibility = 1.9
34+ options. compilerArgs + = ' -parameters'
35+ }
36+
37+ dependencies {
38+ // JUnit Jupiter API and TestEngine implementation
39+ testCompile(" org.junit.jupiter:junit-jupiter-api:${ junitJupiterVersion} " )
40+ testRuntime(" org.junit.jupiter:junit-jupiter-engine:${ junitJupiterVersion} " )
41+
42+ // If you also want to support JUnit 3 and JUnit 4 tests
43+ testCompile(" junit:junit:${ junit4Version} " )
44+ testRuntime(" org.junit.vintage:junit-vintage-engine:${ junitVintageVersion} " )
45+
46+ // To avoid compiler warnings about @API annotations in JUnit code
47+ testCompileOnly(' org.apiguardian:apiguardian-api:1.0.0' )
48+
49+ // To use Log4J's LogManager
50+ testRuntime(" org.apache.logging.log4j:log4j-core:${ log4jVersion} " )
51+ testRuntime(" org.apache.logging.log4j:log4j-jul:${ log4jVersion} " )
52+
53+ // Only needed to run tests in an (IntelliJ) IDE(A) that bundles an older version
54+ testRuntime(" org.junit.platform:junit-platform-launcher:${ junitPlatformVersion} " )
55+
56+ testCompile group : ' org.hamcrest' , name : ' hamcrest-junit' , version : ' 2.0.0.0'
57+ compile group : ' org.jetbrains' , name : ' annotations' , version : ' 15.0'
58+
59+ compile group : ' com.google.guava' , name : ' guava' , version : ' 23.5-jre'
60+ testCompile group : ' org.mockito' , name : ' mockito-all' , version : ' 2.0.2-beta'
61+ }
62+
63+ task wrapper (type : Wrapper ) {
64+ description = ' Generates gradlew[.bat] scripts'
65+ gradleVersion = ' 4.3.1'
66+ }
0 commit comments