Dariusz Kuc
07/22/2021, 5:46 PMcompileKotlin
/`compileTestKotlin` tasks. This works great for the regular JVM builds but blows up on the Android builds as those tasks don't exist and instead we have variants (e.g. compileDebugKotlin
).
Since I'm not familiar with Android ecosystem was wondering whether anyone here got some suggestions on
• how to detect whether plugin is applied on Android project? (check for android
extension?)
• how to get all the variants? (get all tasks of compile kotlin type and then apply crude filter looking for test
in the name?)
• do I need to add generated sources to different source sets based on variants?
• anything else that I might be missing?Dariusz Kuc
07/22/2021, 5:48 PMMiSikora
07/22/2021, 5:52 PMDariusz Kuc
07/22/2021, 6:01 PMimport com.android.build.gradle.BaseExtension
)MiSikora
07/22/2021, 6:03 PMtapchicoma
07/22/2021, 6:51 PM1.5.30
release: https://youtrack.jetbrains.com/issue/KT-46626
With this release 'kotlin-android' will do configuration only when some of android plugins is appliedAlexander.Likhachev
07/23/2021, 12:05 PMtasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class.java).configureEach {
if ("Test" in name) return@configureEach
// do something
}
Dariusz Kuc
07/26/2021, 6:30 PMcom/android/build/gradle/api/BaseVariant
changing dependency to implementation does resolve the issue 🤷Dariusz Kuc
07/27/2021, 5:17 PM