Annotation Argument API
Codegen.kt offers a type safe way to access annotation arguments from an KSAnnotation
instance.
annotation class TestAnnotation(
val type: KClass<*>,
val boolean: Boolean
)
fun KSAnnotation.process() {
val arguments = arguments<TestAnnotation>()
val type: KType = arguments[TestAnnotation::type]
val boolean: Boolean = arguments[TestAnnotation::boolean]
}
Full documentation can be found here
Last modified: 15 September 2023