Skip to content

Commit f27c540

Browse files
committed
Update README & prepare next version
1 parent 4d5a05d commit f27c540

File tree

3 files changed

+41
-31
lines changed

3 files changed

+41
-31
lines changed

README.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Furthermore, this repository provides a small showcase of the functionality prov
2323
```groovy
2424
buildscript {
2525
dependencies {
26-
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.0.30"
26+
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.0.31"
2727
}
2828
}
2929
```
@@ -53,8 +53,7 @@ dependencies {
5353
// By declaring this dependency, you have to use a minSdkVersion
5454
// of at least 26, since the nature of JUnit 5 relies on APIs that aren't
5555
// available on Android devices before then.
56-
// Additionally, you are required to explicitly enable support for instrumented tests in the
57-
// "junitPlatform" configuration closure (see the section below for details).
56+
// Consider creating a product flavor for this - see the sample project for details.
5857
androidTestImplementation junit5.instrumentationTests()
5958
}
6059
```
@@ -78,25 +77,24 @@ android.testOptions {
7877
vintageVersion "4.12.2"
7978
8079
// Options related to running unit tests with JUnit 5.
81-
unitTests {
82-
// Whether or not JUnit 5 test tasks should be affected by
83-
// JVM Arguments, System Properties & Environment Variables
84-
// declared through "unitTests.all" closures
85-
applyDefaultTestOptions true
80+
unitTests.all { test ->
81+
// Configure custom jvmArgs, system properties and environment variables
82+
jvmArgs "--my-argument"
83+
systemProperty "my.system.property", "true"
84+
environment "MY_ENVIRONMENT", "development"
8685
}
8786
8887
// Options related to running instrumented tests with JUnit 5.
8988
// This is an incubating feature which utilizes the backwards-compatibility
9089
// of the JUnit Platform in order to enhance the default Test Instrumentation Runner
91-
// with new power. However, because of their experimental nature and steep minSdkVersion requirement,
92-
// they are turned off by default. If you choose to enable them, you also have to declare
93-
// the library dependency in your androidTest scope. Please refer to the "Setup"
94-
// section for more details.
90+
// with new power. As of version 1.0.31, instrumentation test support is provided by default,
91+
// but it's up to you to include the JUnit 5 dependencies and write some tests with it.
9592
instrumentationTests {
96-
enabled false
93+
// Enable instrumentation tests (default: true)
94+
enabled true
9795
98-
// The Android-Instrumentation-Test dependency version to use
99-
version "0.1.1"
96+
// The Android-Instrumentation-Test dependency version to use (default: latest)
97+
version "0.2.1"
10098
}
10199
102100
// Configuration of companion tasks for JaCoCo Reports,
@@ -110,6 +108,17 @@ android.testOptions {
110108
// by default, R.class & BuildConfig.class are excluded.
111109
excludedClasses += []
112110
excludedSources += []
111+
112+
// By default, Jacoco tasks will be generated by the plugin
113+
// if the project also applies the Jacoco plugin.
114+
// To disable completely, use this flag
115+
taskGenerationEnabled = true
116+
117+
// If instead, you want to generate Jacoco tasks only for certain variants,
118+
// this can be specified here. By default, tasks are generated for all variants
119+
onlyGenerateTasksForVariants "debug", "release"
120+
121+
// Configuration for generated Code Coverage reports
113122
xml {
114123
enabled true
115124
destination project.file()

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ LICENSE_NAME = Apache-2.0
1212
PLUGIN_GROUP_ID = de.mannodermaus.gradle.plugins
1313
PLUGIN_ARTIFACT_ID = android-junit5
1414
PLUGIN_DESCRIPTION = Unit Testing with JUnit 5 for Android.
15-
PLUGIN_RUNTIME_VERSION_NAME = 1.0.31
16-
PLUGIN_RUNTIME_VERSION_NAME_LATEST_STABLE = 1.0.30
15+
PLUGIN_RUNTIME_VERSION_NAME = 1.0.32-SNAPSHOT
16+
PLUGIN_RUNTIME_VERSION_NAME_LATEST_STABLE = 1.0.31
1717

1818
# Artifact configuration (embedded-runtime)
1919
RUNTIME_GROUP_ID = de.mannodermaus.gradle.plugins

sample/build.gradle

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ android {
2929

3030
// Since the minSdkVersion requirement for JUnit 5 Instrumentation Tests is quite high,
3131
// we introduce a product flavor that uses an elevated version other than the application's default.
32-
// With this, we are able to write JUnit 5
33-
// flavorDimensions "kind"
34-
// productFlavors {
35-
// experimental {
36-
// dimension "kind"
37-
// minSdkVersion 26
38-
// }
39-
//
40-
// normal {
41-
// dimension "kind"
42-
// }
43-
// }
32+
// With this, we are able to try JUnit 5 tests without sacrificing the minSdkVersion completely.
33+
flavorDimensions "kind"
34+
productFlavors {
35+
experimental {
36+
dimension "kind"
37+
minSdkVersion 26
38+
}
39+
40+
normal {
41+
dimension "kind"
42+
}
43+
}
4444

4545
// Add Kotlin source directory to all source sets
4646
sourceSets.each {
@@ -74,6 +74,7 @@ dependencies {
7474
androidTestImplementation "junit:junit:$JUNIT4_VERSION"
7575
androidTestImplementation "com.android.support.test:runner:$SUPPORT_TEST_LIBRARY_VERSION"
7676

77-
// androidTestExperimentalImplementation junit5.unitTests()
78-
// androidTestExperimentalImplementation junit5.instrumentationTests()
77+
// Include the instrumentation test dependencies to the product flavor
78+
androidTestExperimentalImplementation junit5.unitTests()
79+
androidTestExperimentalImplementation junit5.instrumentationTests()
7980
}

0 commit comments

Comments
 (0)