@@ -29,7 +29,7 @@ following methods:
2929 ``` groovy
3030 // Below buildscript {}
3131 plugins {
32- id "nl.neotech.plugin.rootcoverage" version "1.5.3 "
32+ id "nl.neotech.plugin.rootcoverage" version "1.6.0 "
3333 }
3434 ```
3535</details >
@@ -42,7 +42,7 @@ following methods:
4242
4343 buildscript {
4444 dependencies {
45- classpath 'nl.neotech.plugin:android-root-coverage-plugin:1.5.3 '
45+ classpath 'nl.neotech.plugin:android-root-coverage-plugin:1.6.0 '
4646 }
4747 }
4848 ```
@@ -51,21 +51,30 @@ following methods:
5151
5252# 2. How to use
5353
54- 1 . Enable running tests with coverage in the desired modules:
54+ 1 . Enable running tests with code coverage
55+ This is required so that code will be instrumented, but also to tell this plugin to include
56+ modules that have at least on of these properties enabled in the final report (or individual
57+ reports)
5558
5659 ``` groovy
5760 android {
5861 buildTypes {
5962 debug {
63+ // AGP 7.3+ (at least one should be true for this module to be included in the reporting)
64+ enableUnitTestCoverage true
65+ enableAndroidTestCoverage true
66+
67+ // AGP before 7.3
6068 testCoverageEnabled true
6169 }
6270 }
6371 }
6472 ```
6573
6674 > Only Android modules (` com.android.application ` or ` com.android.library ` ) are supported, this plugin will not execute
67- tests and generate coverage reports for non-android modules. Also any Android module that does not have
68- > ` testCoverageEnabled true ` for the desired coverage variant (default: ` debug ` ) will be ignored.
75+ tests and generate coverage reports for non-android modules. Also keep in mind that by default
76+ this plugin is configured to create reports for the ` debug ` variant, so coverage must be
77+ enabled for the ` debug ` variant, unless you change this ([ Configuration] ( #3-configuration ) ).
6978
70792 . Run one of the automatically configured Gradle tasks to generate a Jacoco report:
7180 - ** For combined coverage:** ` ./gradlew :rootCoverageReport `
@@ -121,6 +130,7 @@ rootCoverage {
121130# 4. Compatibility
122131| Version | [ Android Gradle plugin version] ( https://developer.android.com/studio/releases/gradle-plugin#updating-gradle ) | Gradle version |
123132| ----------------| --------------------------------------------------------------------------------------------------------------| -------------------|
133+ | ** 1.6.0** | 7.3 | 7.4+ |
124134| ** 1.5.3** | 7.2 | 7.3+ |
125135| ** See note 2** | 7.0-7.2-alpha05 | n.a. |
126136| ** 1.4.0** | 4.2<br />4.1 | 6.7.1+<br />6.5+ |
@@ -170,9 +180,5 @@ Want to contribute? Great! Just clone the repo, code away and create a pull-requ
170180sure to follow the code-style as found in the rest of the project.
171181
172182** How to test your changes/additions?**
173- The plugin comes with an integration test. You can run this test either by executing
174- ` ./gradlew clean test ` or run the test directly from Android Studio (or IntelliJ IDEA).
175-
176-
177- # 6. Honorable mentions
178- Many thanks to [ Hans van Dam] ( https://github.com/hansvdam ) for helping with testing and the initial idea.
183+ The plugin comes with an integration test and unit tests. You can run these tests either by executing
184+ ` ./gradlew clean test ` or run the test directly from Android Studio (or IntelliJ IDEA).
0 commit comments