Skip to content

Commit

Permalink
Fix: shouldn't filter out non-test sources that ends with *test, su…
Browse files Browse the repository at this point in the history
…ch as `latest`, `fastest`, `cutest`, `shortest`, etc.
  • Loading branch information
jasonsparc committed May 31, 2023
1 parent 1da7f7e commit a19327a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ internal fun KotlinProjectExtension.sources(): List<Source> {
}

private fun sourcesForTarget(target: KotlinTarget) = target.compilations
.filter { !it.name.endsWith(suffix = "Test", ignoreCase = true) }
// Excludes "*Test" and "test", but includes "*test" (e.g., "latest", "shortest", etc.)
.filter { !it.name.endsWith(suffix = "Test") && it.name != "test" }

.map { compilation ->
val (defaultSourceSet, sourceSets) = when (target.platformType) {
KotlinPlatformType.androidJvm -> {
Expand Down

0 comments on commit a19327a

Please sign in to comment.