https://kotlinlang.org logo
Title
s

spierce7

03/02/2021, 6:20 AM
Does Compose use KSP?
:stackoverflow: 1
:nope: 2
z

Zach Klippenstein (he/him) [MOD]

03/02/2021, 4:43 PM
Compose uses a compiler plugin. KSP is built on the same compiler plugin infrastructure that Compose uses, but they are completely independent.
y

yigit

03/02/2021, 4:45 PM
also, compose cannot use KSP because it modifies your code while KSP can only generate additional code
z

Zach Klippenstein (he/him) [MOD]

03/02/2021, 4:55 PM
Yep, and in general, I think the philosophy of KSP is to provide a more limited, but simpler and arguably easier to learn, API, that targets the same set of use cases as annotation processors used to. Full-fledged compiler plugins let you do virtually anything (parcelize, kotlinx-serialization are also compiler plugins).