Closed mzgreen closed 9 years ago
Is it already possible to move all the code to Kotlin?
Here is a sample from JetBrains https://github.com/JetBrains/kotlin-examples/tree/master/gradle/kotlin-dagger and only one class is in java. That class uses code that should be generated by Dagger. Unfortunately if I rewrite it to Kotlin then Dagger is not generating anything. According to this blog post http://blog.jetbrains.com/kotlin/2015/06/better-annotation-processing-supporting-stubs-in-kapt/ it should work now. Am I missing something?
I have tried to use 0.1-SNAPSHOT version of Kotlin as well as the newest 1.0 beta and result is the same.
I have found a solution. You have to add
kapt { generateStubs = true }
In your build.gradle file and it will work with all the codr written in Kotlin :)
done
Is it already possible to move all the code to Kotlin?
Here is a sample from JetBrains https://github.com/JetBrains/kotlin-examples/tree/master/gradle/kotlin-dagger and only one class is in java. That class uses code that should be generated by Dagger. Unfortunately if I rewrite it to Kotlin then Dagger is not generating anything. According to this blog post http://blog.jetbrains.com/kotlin/2015/06/better-annotation-processing-supporting-stubs-in-kapt/ it should work now. Am I missing something?
I have tried to use 0.1-SNAPSHOT version of Kotlin as well as the newest 1.0 beta and result is the same.