~/talk

Code Generation Using Kotlin Symbol Processing (KSP)

TalkinJapaneseat DroidKaigi 2021 · 2021-10-19..10-21· [kotlin, compilers-and-language-design]
name:Kenji Abe
links:none on file
slides:none on file

Kotlin Symbol Processing (KSP) is presented as a faster alternative to KAPT by parsing Kotlin natively; the talk shows a concrete example that builds a Processor module and a consumer module using SymbolProcessorProvider and a SymbolProcessor that calls Resolver and codeGenerator.newFile to emit code. It covers multi-round processing by deferring symbols via validate = false and explains how to enable incremental builds by declaring inputs and outputs. It notes that Room already supports KSP but many major libraries do not, so additional migration work is needed for production use.

AI-written summary · about

  1. 0:00Introduction
  2. 0:49KSP basics
  3. 2:14Project setup
  4. 3:37Symbol processor provider
  5. 6:06Processor implementation
  6. 7:49Code analysis
  7. 9:54Retrieve analysis data
  8. 10:16Code generation
  9. 12:01Multi-round processing
  10. 15:14Multi-round delays
  11. 17:01Resolver methods per round
  12. 18:04Incremental processing
  13. 19:09Incremental implementation
  14. 21:17Incremental setup
  15. 23:21KSP roadmap
  16. 24:26Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.