Working Around KAPT
summary
Lyft replaces KAPT by building NAPT which skips Kotlin stub generation and reduces annotation processing overhead, claiming much faster builds vs KAPT where Uber found 95% overhead for Kotlin plus KAPT versus ~5% for Java AP. Implementation uses a JavaC plugin that forces compiled Kotlin class files into the annotation processing pass so Dagger generates factories from dependencies, and bridges Kotlin code to generated Java statics. Limitations include cannot reference generated code from Kotlin and potential multimodule clashes if not managed.
AI-written summary · about
related talks
15mOn the Applicability of Annotation-Based Source Code Modification in Kotlin (Work...
38mKSP and Plugins. Optimizing Kotlin Multiplatform common code
43mCompile Kotlin faster with ABI
41mAnnotation Processing in a Kotlin World
36mFact or kapt? Build your next annotation processor with KSP
37mWhy you should positively consider introducing and migrating to KSP
46mCodegen with KSP: A Farewell to Stubs
33mMeta-programming with KSP and Kotlin compiler plugins
