I'm following the guide over at
http://kotlinlang.org/docs/reference/using-gradle.html and have successfully added the Kotlin plugin to my Android's application build script. I've added the kotlin folder to the app's source set like this:
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
And I can launch my app and use Kotlin classes without problems.
However, if I try to run the tests, the compilation fails with the following output:
JavaClassTest.java:14: error: package package.name does not exist
import package.name.KotlinClass;
^
JavaClassTest.java:32: error: cannot find symbol
private KotlinClass getResult() {
^
symbol: class KotlinClass
location: class JavaClassTest
When running with --debug flag, the folder "build\tmp\kotlin-classes\debugTest" seems to be part of the class path, but this folder doesn't exist. However the folder "build\tmp\kotlin-classes\debug" is there and contains all the necessary classes.
I would really appreciate some help, since I'm not the biggest Gradle pro. Thanks in advance.
Cross reference to StackOverflow:
http://stackoverflow.com/questions/26340426/android-unit-test-of-kotlin-class-fails-with-cannot-find-symbol-class