Skip to content

Commit c19d8de

Browse files
committed
Do not fail for tests
1 parent a0489f6 commit c19d8de

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • tapmoc-gradle-plugin/src/kgp/kotlin/tapmoc/internal

tapmoc-gradle-plugin/src/kgp/kotlin/tapmoc/internal/KgpImpl.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,12 @@ private class KgpImpl(private val dependencyHandler: DependencyHandler, extensio
131131
* useful for tapmoc itself, which has several compilations for AGP vs KGP
132132
*/
133133
kotlinProjectExtension.forAllTargets { target ->
134-
target.compilations.matching { it.name != "test" }.configureEach { compilation ->
134+
target.compilations.matching {
135+
/**
136+
* TODO: refine this, KGP has a lot of custom logic to avoid adding to the api configuration for tests
137+
*/
138+
!it.name.lowercase().contains("test")
139+
}.configureEach { compilation ->
135140
compilation.allKotlinSourceSets.forEach { sourceSet ->
136141
dependencyHandler.add(sourceSet.apiConfigurationName, "org.jetbrains.kotlin:kotlin-stdlib:${version}")
137142
}

0 commit comments

Comments
 (0)