louiscad
09/10/2019, 9:50 AMkotlin
block after I setup the targets, and I make sure I add the AndroidX test runner dependency:
fun KotlinMultiplatformExtension.setupAndroidTestSourceSetsAndDependencies() {
val androidTargets = targets.filterIsInstance<KotlinAndroidTarget>()
if (androidTargets.isEmpty()) return
val project = androidTargets.first().project
project.configurations.matching { it.name.startsWith("androidTest") }.all {
val configurationName = name
dependencies.all {
val dependency = this
project.dependencies {
configurationName.replaceFirst("androidTest", "test")(dependency)
}
}
}
}