Hi! Does anyone know any good article or documenta...
# compiler
l
Hi! Does anyone know any good article or documentation with Kotlin compiler internals overview? Particularly, I’m interested in how JVM interop works. Does Kotlin compiler run javac first? If yes, then how it resolves reference cycles between Java <-> Kotlin? For example, if I have some Android gradle module with mixed java/kotlin source code I can see that Gradle executes
KotlinCompile
task and
AndroidJavaCompile
task (from Android Gradle Plugin). Is
KotlinCompile
task contain java compilation or not?
👍 1
g
As I remember (and not sure where I read or watched this) Kotlin compiler also understands Java source code declarations, this allows to compile Kotlin before Java and then run javac to compile Java code with already compiled Kotlin .class files in compilation classpath
And no, KotlinCompile task (or kotlinc) doesn't compile Java code itself