Posted on Leave a comment

Kotlin Symbol Processing API (kapt?)


Compiler plugins are powerful metaprogramming tools that can greatly enhance how you write code. Compiler plugins call compilers directly as libraries to analyze and edit input programs. These plugins can also generate output for various uses. For example, they can generate boilerplate code, and they can even generate full implementations for specially-marked program elements, such as Parcelable. Plugins have a variety of other uses and can even be used to implement and fine-tune features that are not provided directly in a language.

While compiler plugins are powerful, this power comes at a price. To write even the simplest plugin, you need to have some compiler background knowledge, as well as a certain level of familiarity with the implementation details of your specific compiler. Another practical issue is that plugins are often closely tied to specific compiler versions, meaning you might need to update your plugin each time you want to support a newer version of the compiler.

KSP: Fact or kapt?
06.2021 []

Android KSP guide for dummies by a Dummy: Part 1
04.2022 []

KSP for Code-Generation

Announcing Kotlin Symbol Processing (KSP) Alpha
10.02.2021 []

Kotlin Symbol Processing. От теории до практики
12.2023 []

Room & Kotlin Symbol Processing

So, how do I write a Kotlin Symbol Processor (KSP)?

Сколько стоит kapt в многомодульном проекте

Практическое применение KSP

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.