Hi! I want to dynamically add (or replace) annotat...
# ksp
c
Hi! I want to dynamically add (or replace) annotations to Methods. For example if I annotate a Method in my source like this:
Copy code
@OneAnnotation(value = "someDetail")
fun methodA() { ... }
I want ksp to add another annotation like this
Copy code
@AnotherAnnotation(value = "someDetail") // value taken from "original" annotation
@OneAnnotation(value = "someDetail")
fun methodA() { ... }
Do you think ksp is a good fit for this task? Any hints on how to do it?
y
No, you need a compiler plugin for that. KSP does not allow modifying code
c
Ah ok, thank you :D