I'm using an annotation from a library that requires a list of arguments, and there are a lot of classes throughout my project that use this annotation with those exact same arguments.
@AnnotationFromDependency(values = [long, list, of, variables, that, might, change])
class Foo {
fun bar() {
println("dostuff")
}
}
How can I avoid copying the same arguments for @AnnotationDependency
to every class that uses it? Defining the arguments list in a variable does not work because it is not a compile-time constant.
val myValues = arrayOf("long", "list", "of", "values", "that", "might", "change")
@AnnotationFromDependency(values = myValues) // error: An annotation argument must be a compile-time constant
class Foo {
fun bar() {
println("dostuff")
}
}