File tree Expand file tree Collapse file tree 4 files changed +20
-3
lines changed
main/groovy/com/vanniktech/android/junit/jacoco
test/groovy/com/vanniktech/android/junit/jacoco Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,16 @@ class Generation implements Plugin<Project> {
84
84
toolVersion extension. jacocoVersion
85
85
}
86
86
87
+ subProject. android {
88
+ testOptions {
89
+ unitTests. all {
90
+ jacoco {
91
+ includeNoLocationClasses = extension. includeNoLocationClasses
92
+ }
93
+ }
94
+ }
95
+ }
96
+
87
97
final def buildTypes = subProject. android. buildTypes. collect { type -> type. name }
88
98
final def productFlavors = subProject. android. productFlavors. collect { flavor -> flavor. name }
89
99
Original file line number Diff line number Diff line change @@ -22,4 +22,10 @@ class JunitJacocoExtension {
22
22
* @since 0.5.0
23
23
*/
24
24
List<String > excludes = null
25
+
26
+ /**
27
+ * Whether or not to include no location classes
28
+ * @since 0.6.0
29
+ */
30
+ boolean includeNoLocationClasses
25
31
}
Original file line number Diff line number Diff line change @@ -66,9 +66,9 @@ public class GenerationTest {
66
66
Generation . addJacoco(androidLibraryProject, extension)
67
67
Generation . addJacoco(javaProject, extension)
68
68
69
- assert androidAppProject. jacoco. toolVersion == ' 0.7.6.201602180812 '
70
- assert androidLibraryProject. jacoco. toolVersion == ' 0.7.6.201602180812 '
71
- assert javaProject. jacoco. toolVersion == ' 0.7.6.201602180812 '
69
+ assert androidAppProject. jacoco. toolVersion == extension . jacocoVersion
70
+ assert androidLibraryProject. jacoco. toolVersion == extension . jacocoVersion
71
+ assert javaProject. jacoco. toolVersion == extension . jacocoVersion
72
72
}
73
73
74
74
@Test
Original file line number Diff line number Diff line change @@ -10,5 +10,6 @@ public class JunitJacocoExtensionTest {
10
10
assert extension. jacocoVersion == ' 0.7.2.201409121644'
11
11
assert extension. ignoreProjects. size() == 0
12
12
assert extension. excludes == null
13
+ assert ! extension. includeNoLocationClasses
13
14
}
14
15
}
You can’t perform that action at this time.
0 commit comments