Skip to content

Commit de99f98

Browse files
committed
Migrate to AGP 3.x syntax for README & deal with bundled JUnit 5 inconsistencies manually
1 parent ef5e6f7 commit de99f98

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A Gradle plugin that allows for the execution of [JUnit 5][junit5gh] unit tests
99
```groovy
1010
buildscript {
1111
dependencies {
12-
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.0.0-M5"
12+
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.0.0-M4-rev3"
1313
}
1414
}
1515
```
@@ -23,10 +23,10 @@ apply plugin: "com.android.application"
2323
apply plugin: "de.mannodermaus.android-junit5"
2424
2525
dependencies {
26-
testCompile junitJupiter()
26+
testApi junitJupiter()
2727
2828
// (Optional) If you need "parameterized tests"
29-
testCompile junitParams()
29+
testApi junitParams()
3030
}
3131
```
3232

@@ -46,9 +46,9 @@ However, there are some additional properties that you can apply:
4646
```groovy
4747
junitPlatform {
4848
// The JUnit Jupiter dependency version to use; matches the platform's milestone by default
49-
jupiterVersion "5.0.0-M5"
49+
jupiterVersion "5.0.0-M4"
5050
// The JUnit Vintage Engine dependency version to use; matches the platform's milestone by default
51-
vintageVersion "4.12.0-M5"
51+
vintageVersion "4.12.0-M4"
5252
}
5353
```
5454

android-junit5/src/main/groovy/de/mannodermaus/gradle/plugins/android_junit5/AndroidJUnitPlatformPlugin.groovy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,19 @@ class AndroidJUnitPlatformPlugin implements Plugin<Project> {
7777
project.dependencies.ext.junitJupiter = {
7878
def jupiterVersion = junitExtension.jupiterVersion
7979
def platformVersion = junitExtension.platformVersion
80+
def vintageVersion = junitExtension.vintageVersion
8081

8182
return [
8283
project.dependencies.create("junit:junit:4.12"),
8384
project.dependencies.create("org.junit.jupiter:junit-jupiter-api:${jupiterVersion}"),
8485
project.dependencies.create("org.junit.platform:junit-platform-engine:${platformVersion}"),
86+
87+
// Only needed to run tests in an Android Studio that bundles an older version
88+
// (see also http://junit.org/junit5/docs/current/user-guide/#running-tests-ide-intellij-idea)
89+
project.dependencies.create("org.junit.platform:junit-platform-launcher:$platformVersion"),
90+
project.dependencies.create("org.junit.platform:junit-platform-console:$platformVersion"),
91+
project.dependencies.create("org.junit.jupiter:junit-jupiter-engine:$jupiterVersion"),
92+
project.dependencies.create("org.junit.vintage:junit-vintage-engine:$vintageVersion"),
8593
]
8694
}
8795

0 commit comments

Comments
 (0)