@@ -29,7 +29,7 @@ following methods:
29
29
``` groovy
30
30
// Below buildscript {}
31
31
plugins {
32
- id "nl.neotech.plugin.rootcoverage" version "1.5.3 "
32
+ id "nl.neotech.plugin.rootcoverage" version "1.6.0 "
33
33
}
34
34
```
35
35
</details >
@@ -42,7 +42,7 @@ following methods:
42
42
43
43
buildscript {
44
44
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 '
46
46
}
47
47
}
48
48
```
@@ -51,21 +51,30 @@ following methods:
51
51
52
52
# 2. How to use
53
53
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)
55
58
56
59
``` groovy
57
60
android {
58
61
buildTypes {
59
62
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
60
68
testCoverageEnabled true
61
69
}
62
70
}
63
71
}
64
72
```
65
73
66
74
> 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 ) ).
69
78
70
79
2 . Run one of the automatically configured Gradle tasks to generate a Jacoco report:
71
80
- ** For combined coverage:** ` ./gradlew :rootCoverageReport `
@@ -121,6 +130,7 @@ rootCoverage {
121
130
# 4. Compatibility
122
131
| Version | [ Android Gradle plugin version] ( https://developer.android.com/studio/releases/gradle-plugin#updating-gradle ) | Gradle version |
123
132
| ----------------| --------------------------------------------------------------------------------------------------------------| -------------------|
133
+ | ** 1.6.0** | 7.3 | 7.4+ |
124
134
| ** 1.5.3** | 7.2 | 7.3+ |
125
135
| ** See note 2** | 7.0-7.2-alpha05 | n.a. |
126
136
| ** 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
170
180
sure to follow the code-style as found in the rest of the project.
171
181
172
182
** 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