Many developers are quite optimistic about Kotlin future for Android. It sounds so sweet: less verbose, more type-safety, zero-overhead null-safety, Java interop. But not everyone is ready to take a risk and start writing production code using new programming language. Indeed, it could be not mature enough and will add dependencies which increase method count of APK for more than 6.5K.
But what if we’ll use Android testing using Kotlin?
So we can setup Kotlin plugin and related libraries to be only in testCompile dependencies scope. Here is what we should set in build.gradle:
compile fileTree(dir: ‘libs’, include: [‘*.jar’])
Another important detail in build.gradle is setting proper source sets to make Kotlin tests folders visible to compiler and IDE.