You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-57
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,11 @@
2
2
3
3

4
4
5
-
A Gradle plugin that allows for the execution of [JUnit 5][junit5gh] tests in Android environments using **Android Gradle Plugin 3.0.0 or later.**
5
+
A Gradle plugin that allows for the execution of [JUnit 5][junit5gh] tests in Android environments using **Android Gradle Plugin 3.2.0 or later.**
6
6
7
-
## Why a separate plugin?
7
+
## How?
8
8
9
-
The JUnit Platform team provides a Gradle plugin for running JUnit 5 on the JVM. However,
10
-
that plugin is tailored to the needs of a "purely Java" application, and doesn't work in
11
-
the context of the multi-variant world that we live in on Android. As a result, `android-junit5` was born.
12
-
13
-
This plugin configures a `junitPlatformTest` task for each registered build variant of a project.
14
-
Furthermore, it automatically attaches both the Jupiter & Vintage Engines
15
-
during the execution phase of your tests as well, so there's very little configuration
16
-
necessary to get your project up-and-running on the JUnit Platform.
9
+
This plugin configures the unit test tasks for each build variant of a project to run on the JUnit Platform. Furthermore, it provides additional configuration options for these tests [through a DSL][wiki-dsl] attached to `android.testOptions`.
17
10
18
11
Instructions on how to write JUnit 5 tests can be found [in their User Guide][junit5ug].
19
12
Furthermore, this repository provides a small showcase of the functionality provided by JUnit 5 [here][sampletests].
@@ -23,7 +16,7 @@ Furthermore, this repository provides a small showcase of the functionality prov
More information on Getting Started can be found [on the wiki][wiki-gettingstarted].
57
46
58
-
The plugin can be configured through a new configuration container inside `android.testOptions`.
59
-
Please check out the [Wiki page][wikiconfigpage] for an overview of the available DSL.
47
+
## Requirements
60
48
61
-
## Gradle Compatibility
49
+
The latest version of this plugin requires:
50
+
* Android Gradle Plugin `3.2.0` or above
51
+
* Gradle `4.7` or above
62
52
63
-
The plugin's minimum required version of Gradle has increased over time to maximize its leverage with new APIs and performance.
64
-
The chart describes the evolution of this requirement. If you can't use the latest version of this plugin due to your
65
-
project's Gradle version, please refer to the following table to find the corresponding plugin that works for you.
53
+
## Instrumentation Test Support
66
54
67
-
|Plugin Version|Minimum Gradle Version|
68
-
|---|---|
69
-
|`1.0.30` and older|`2.5`|
70
-
|`1.0.31` and later|`4.3`|
55
+
There is experimental support for Android instrumentation tests, which requires some additional configuration & dependencies. Note that since JUnit 5 is built on Java 8 from the ground up, these libraries require you to have a `minSdkVersion` of at least `26`.
71
56
72
-
## Licenses
57
+
To include the experimental instrumentation test support, add the following to your `build.gradle`:
73
58
74
-
#### android-junit5-embedded-runtime:
59
+
```groovy
60
+
android {
61
+
deaultConfig {
62
+
// (Required) Make sure to use the AndroidJUnitRunner, of a subclass of it
Licensed under the Apache License, Version 2.0 (the "License");
80
-
you may not use this file except in compliance with the License.
81
-
You may obtain a copy of the License at
82
78
83
-
http://www.apache.org/licenses/LICENSE-2.0
84
-
85
-
Unless required by applicable law or agreed to in writing, software
86
-
distributed under the License is distributed on an "AS IS" BASIS,
87
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
88
-
See the License for the specific language governing permissions and
89
-
limitations under the License.
90
-
```
79
+
# Migration from 1.0.x
91
80
92
-
See also the [full License text](android-junit5-embedded-runtime/LICENSE).
81
+
Since the move to utilize the native JUnit 5 support built into the build system, a lot has changed from the previous version of the plugin. Users seeking to migrate to the new version are encouraged to check out the migration guide located [on the Wiki][wiki-migration] of this repository.
93
82
94
-
#### Everything else:
83
+
##License
95
84
96
85
```
97
86
Copyright 2017-2018 Marcel Schnelle
@@ -113,10 +102,9 @@ See also the [full License text](LICENSE).
0 commit comments