Skip to content

Commit 27f548f

Browse files
committed
fix: lazy query for task
1 parent f1bfe34 commit 27f548f

File tree

1 file changed

+16
-2
lines changed
  • build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid

1 file changed

+16
-2
lines changed

build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Jacoco.kt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,23 @@ internal fun Project.configureJacoco(
8989
}
9090

9191
// Collect all java and kotlin source directories from the variant's source sets
92+
val kotlin = variant
93+
.sources
94+
.kotlin
95+
?.all
96+
?.map { it.orEmpty() }
97+
?.map { it.map { it.asFile.path } }
98+
val java = variant
99+
.sources
100+
.java
101+
?.all
102+
?.map { it.orEmpty() }
103+
?.map { it.map { it.asFile.path } }
92104
sourceDirectories.setFrom(
93-
variant.sources.kotlin?.all?.get().orEmpty(),
94-
variant.sources.java?.all?.get().orEmpty()
105+
files(
106+
kotlin,
107+
java
108+
)
95109
)
96110

97111
executionData.setFrom(

0 commit comments

Comments
 (0)