I'd like to set up Kotlin in an existing Java Android (library) project but for now I would like to only set it up for unit tests. Is there a way to achieve this?
c
CLOVIS
06/25/2024, 7:05 AM
Maybe something like
Copy code
android.sourceSets.configureEach {
if (!name.startsWith("test")) {
kotlin.srcDirs = emptyList()
}
}
I can't test it at the moment, but in theory it should make the Kotlin plugin unable to see your production code.
You may also need to add an exclusion for the standard library to avoid adding a new dependency