Dealing With KSP in Common Code for Android and iOS
summary
Kotlin Symbol Processing (KSP) replaces KAPT to generate annotation-based code using the Kotlin AST rather than Java stubs, producing results about 2–3x faster in the presenter’s tests. The project uses KSP on the JVM target, KotlinPoet for file templates, and custom scanners/resolvers to build a small multiplatform dependency injection library that generates container and resolver classes. It works automatically for Android and produces usable commonMain sources for iOS with manual build steps; KSP is still experimental.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:13What is KSP
- 2:59KSP vs KAPT
- 9:02How KSP works
- 12:14Implementing KSP processors
- 17:50DI with KSP in Android
- 21:45KSP in multiplatform
- 28:53KSP limits with Kotlin Native
- 33:14KSP with Kotlin Native
- 35:47KSP with iOS
- 39:04KSP challenges and future
- 41:11Summary
- 42:38Q&A
related talks
38mKSP and Plugins. Optimizing Kotlin Multiplatform common code
37mWhy you should positively consider introducing and migrating to KSP
36mExploring Kotlin Symbol Processing: A Practical Guide
35mExploring Kotlin Symbol Processing: A Practical Guide
33mMeta-programming with KSP and Kotlin compiler plugins
25mCode Generation Using Kotlin Symbol Processing (KSP)
46mCodegen with KSP: A Farewell to Stubs
15mOn the Applicability of Annotation-Based Source Code Modification in Kotlin (Work...
