Profiling Gradle builds of our project revealed that it spends on average same time compiling java as we spend on Java, however only ~1% of the codebase is Kotlin yet.
Does the Kotlin compilation phase include the Java code compilation?
No, I pulled times for separate Kotlin and Java compilation phases from Gradle “–scan” report. These tasks are executed by gradle separately one after another for each module.
Are Java and Kotlin code partitioned in two different modules or are they mixed in a single one?
~5 of 17 modules have Kotlin code alongside Java code. The rest are pure Java.
Before introducing Kotlin, did the whole project compilation take 21 seconds to complete?
20 seconds is not project compilation time, but execution time of compileDebugJavaWithJavac task (phase). It didn’t visibly change since introducing Kotlin.