i just realized that ksp can process java sources, too. this shouldn't have surprised me. maybe it's been obvious/known to everyone but me. but this realization just reduced the amount of work I have to do by orders of magnitude (as measured on the Saffir-Simpson scale).
🆒 2
today i learned 1
t
twisterrob
06/14/2024, 7:31 PM
I came to the channel to ask something similar. I take this realisation is from the perspective of a processor author. From a consumer perspective, is it also true? Can I just replace kapt with KSP even if I still have annotated classes in Java?
e
evanchooly
06/14/2024, 7:38 PM
iirc, kapt works with classes directly much like the java annotation processors where KSP will work on the parsed source during the compile phase. so the timing becomes a possible factor, too.
t
twisterrob
06/14/2024, 7:41 PM
Thanks.
Kotlin 2 doesn't support KAPT (yet), so I'm kind of forced to migrate to KSP, but I'm wondering if I can even attempt it with Java classes still present.
twisterrob
06/14/2024, 7:41 PM
I guess performance-wise, konverting the Java classes to Kotlin will also slow things down, but Kotlin!
e
evanchooly
06/14/2024, 7:43 PM
it's not that ksp converts it, it's just that it knows how to parse java in to an AST and it just happens to be the same(ish) internally. the kotlin compiler is the MVP here and KSP just wraps the AST it's given.