Skip to content

Commit 3271208

Browse files
committed
ergonomics
1 parent 192a3a6 commit 3271208

File tree

1 file changed

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

1 file changed

+8
-7
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,16 @@ internal fun Project.configureJacoco(
9090
html.required = true
9191
}
9292

93-
// Collect all java and kotlin source directories from the variant's source sets
94-
fun SourceDirectories.Flat.toFilePaths(): Provider<List<String>> = this
95-
.all
96-
.map { directories -> directories.map { it.asFile.path } }
93+
fun SourceDirectories.Flat?.toFilePaths(): Provider<List<String>> = this
94+
?.all
95+
?.map { directories -> directories.map { it.asFile.path } }
96+
?: provider { emptyList() }
97+
operator fun Provider<List<String>>.plus(other: Provider<List<String>>) =
98+
zip(other) { first, second -> first + second }
9799
sourceDirectories.setFrom(
98100
files(
99-
variant.sources.java?.toFilePaths(),
100-
variant.sources.kotlin?.toFilePaths()
101-
)
101+
variant.sources.java.toFilePaths() + variant.sources.kotlin.toFilePaths()
102+
),
102103
)
103104

104105
executionData.setFrom(

0 commit comments

Comments
 (0)