File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
src/main/groovy/com/vanniktech/android/junit/jacoco Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -9,11 +9,21 @@ class Generation implements Plugin<Project> {
9
9
void apply (final Project rootProject ) {
10
10
rootProject. extensions. create(' junitJacoco' , JunitJacocoExtension )
11
11
12
- rootProject. subprojects { subProject ->
13
- afterEvaluate {
12
+ final def hasSubProjects = rootProject. subprojects. size() > 0
13
+
14
+ if (hasSubProjects) {
15
+ rootProject. subprojects { subProject ->
16
+ afterEvaluate {
17
+ final def extension = rootProject. junitJacoco
18
+
19
+ addJacoco(subProject, extension)
20
+ }
21
+ }
22
+ } else {
23
+ rootProject. afterEvaluate {
14
24
final def extension = rootProject. junitJacoco
15
25
16
- addJacoco(subProject , extension)
26
+ addJacoco(rootProject , extension)
17
27
}
18
28
}
19
29
}
You can’t perform that action at this time.
0 commit comments