第四场将由知名 Podcast 节目《二分电台》主理人 2BAB 为大家介绍 Google 基于 Kotlin 编译器插件开源的 Kotlin 元编程框架 Kotlin Symbol Processor,将探索场景背后的通用技巧,解锁 KSP 的更多可能。 更新:本场直播活动已结束,收看直播回放,下载PPT 16:15-16:55 通过 Ktor 框架同步完成 Server 及 Client Side ...
ksp(project(":test-processor")) } Run./gradlew build. You can find the generated code underbuild/generated/source/ksp. Here's a sample build script to apply the KSP plugin to a workload: plugins { id("com.google.devtools.ksp") version "1.5.31-1.0.0" kotlin("jvm") } version = "...
Kotlin Symbol Processing (KSP) is an API that you can use to develop lightweight compiler plugins. KSP provides a simplified compiler plugin API that leverages the power of Kotlin while keeping the learning curve at a minimum. Compared to kapt, annotation processors that use KSP can run up ...
All KSP symbols will not be reusable across multiple rounds, as the resolution result can potentially change based on what was generated in a previous round. However, since KSP does not allow modifying existing code, some information such as the string value for a symbol name should still be ...
You can find the API definition in theKSP GitHub repository. The diagram shows an overview of how Kotlin ismodeledin KSP: Type and resolution The resolution takes most of the cost of the underlying API implementation. So type references are designed to be resolved by processors explicitly (with...
kapt is in maintenance mode. We are keeping it up-to-date with recent Kotlin and Java releases but have no plans to implement new features. Please use theKotlin Symbol Processing API (KSP)for annotation processing.See the list of libraries supported by KSP. ...