Metaprogramming with Kotlin Symbol Processing
Starts:
25. Juni 2025 um 17:05:00
Ends:
25. Juni 2025 um 17:45:00
Status:
Accepted
From generating Moshi JSON adapters, to generating dependency injection code with Dagger, to generating database code with Room, most Android developers will interact with a code generator at some point throughout their career. However, the inner workings of these tools are opaque, and writing one can be even more daunting. This talk will walk through a simple example of generating log tags using Kotlin symbol processing. It will aim to make understanding code generators more accessible and to inspire listeners to solve problems with code generation.
Key Takeaways:
- A short history of code generation on the JVM.
- How to identify whether a problem is appropriately solved using metaprogramming techniques.
- How to set up a KSP project.
- How to use KSP APIs to process code as input and use KotlinPoet to generate code as output.
- Where code generation fits in a world where we generate code with LLMs.