~/talk

Exploring Kotlin Symbol Processing: A Practical Guide

Talkat droidcon London 2024 · 2024-10-31..11-01· [kotlin]
slides:none on file

Demonstrates using Kotlin Symbol Processing (KSP) plus KotlinPoet to auto‑generate mapper interfaces and implementations (Peoplehub: Person ↔ PersonEntity), with a multi‑module setup (app, annotation, processor), KSP invoked during Gradle builds and writing files to build/generated/ksp. Notes KSP is Kotlin‑compiler‑version specific, up to two times faster than KAPT per Google, cannot modify existing source or inspect expressions, and supports multiplatform and K2 (KSP 2 in beta). Generated DBMapper and Impl compile and log from the processor.

AI-written summary · about

  1. 0:00Introduction
  2. 1:29What is KSP
  3. 3:13KAP and compiler plugin limits
  4. 4:58Why choose KSP
  5. 7:30Setting up KSP in Gradle
  6. 9:14How KSP models code
  7. 12:34Practical KSP demo
  8. 16:48Project architecture and mapper gen
  9. 18:16Custom annotations for KSP
  10. 20:43Implementing symbol processor
  11. 23:12KSP resolver and code gen
  12. 25:38Code gen with Kotlin Poet
  13. 27:24Extracting annotation params
  14. 28:48Mapper interface and impl
  15. 30:57Adding functions to mappers
  16. 33:25KSP in multiplatform projects
  17. 34:06Future plans and summary
~/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.