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
A Gradle plugin that allows for the execution of [JUnit 5][junit5gh] tests in Android environments using **Android Gradle Plugin 4.0.0 or later.**
9
10
10
11
## How?
11
12
12
-
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`.
13
+
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] and facilitates the usage of JUnit 5 for instrumentation tests.
14
+
15
+
Instructions on how to write tests with the JUnit 5 framework can be found [in their User Guide][junit5ug]. To get a first look at its features, a small showcase project can be found [here][sampletests].
13
16
14
-
Instructions on how to write JUnit 5 tests can be found [in their User Guide][junit5ug].
15
-
Furthermore, this repository provides a small showcase of the functionality provided by JUnit 5 [here][sampletests].
17
+
## Setup
16
18
17
-
## Download
19
+
To get started, declare the plugin in your `app` module's build script alongside the latest version. Snapshots of the development version are available through [Sonatype's `snapshots` repository][sonatyperepo].
Snapshots of the development version are available through [Sonatype's `snapshots` repository][sonatyperepo].
71
+
### Alternative: Legacy DSL
46
72
47
-
## Setup
48
-
<detailsopen>
49
-
<summary>Kotlin</summary>
73
+
If you prefer to use the legacy way to declare the dependency instead, remove the `version()` block from above and declare the plugin in your _root project's build script_ like so:
50
74
51
-
```kotlin
52
-
plugins {
53
-
id("de.mannodermaus.android-junit5")
54
-
}
75
+
<details>
76
+
<summary>Kotlin</summary>
55
77
78
+
```kotlin
79
+
buildscript {
56
80
dependencies {
57
-
// (Required) Writing and executing Unit Tests on the JUnit Platform
Copy file name to clipboardExpand all lines: README.md.template
+36-31Lines changed: 36 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -8,43 +8,16 @@ This plugin configures the unit test tasks for each build variant of a project t
8
8
9
9
Instructions on how to write tests with the JUnit 5 framework can be found [in their User Guide][junit5ug]. To get a first look at its features, a small showcase project can be found [here][sampletests].
Snapshots of the development version are available through [Sonatype's `snapshots` repository][sonatyperepo].
13
+
To get started, declare the plugin in your `app` module's build script alongside the latest version. Snapshots of the development version are available through [Sonatype's `snapshots` repository][sonatyperepo].
40
14
41
-
## Setup
42
15
<details open>
43
16
<summary>Kotlin</summary>
44
17
45
18
```kotlin
46
19
plugins {
47
-
id("de.mannodermaus.android-junit5")
20
+
id("de.mannodermaus.android-junit5") version "${pluginVersion}"
48
21
}
49
22
50
23
dependencies {
@@ -66,7 +39,9 @@ Snapshots of the development version are available through [Sonatype's `snapshot
// (Required) Writing and executing Unit Tests on the JUnit Platform
@@ -85,6 +60,36 @@ Snapshots of the development version are available through [Sonatype's `snapshot
85
60
86
61
<br/>
87
62
63
+
### Alternative: Legacy DSL
64
+
65
+
If you prefer to use the legacy way to declare the dependency instead, remove the `version()` block from above and declare the plugin in your _root project's build script_ like so:
0 commit comments