@@ -23,7 +23,7 @@ Furthermore, this repository provides a small showcase of the functionality prov
2323``` groovy
2424buildscript {
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()
0 commit comments