https://kotlinlang.org logo
#compiler
Title
# compiler
r

rrva

03/21/2023, 9:40 PM
can I create a compiler plugin which generates additional code based on existing code, but without needing an annotation on the classes it modifies?
yes black 2
j

jw

03/21/2023, 10:02 PM
Yes
r

rrva

03/22/2023, 9:22 AM
sorry, let me rephrase. Where can I find example code for a compiler plugin that modifies generates additional code based on existing classes, but where the classes do not need an annotation on them? I was looking at https://github.com/google/ksp/blob/main/examples/playground/test-processor/src/main/kotlin/JavaBuilderProcessor.kt and it is annotation based
c

christophsturm

03/22/2023, 10:04 AM
j

jw

03/22/2023, 11:13 AM
You can do whatever you want with an IrElementTransformer
8 Views