I have a class which has some variables, can we use kotlin symbol processing api to somehow read the value of the variable declared in the class?
resolver.getDeclarationsFromPackage("com.example")
.filter { it is KSClassDeclaration }
.iterator().forEach {
val cls = it as KSClassDeclaration
cls.getDeclaredProperties().first()
}
As of today, KSP doesn't provide the functionality to read the content of the values. However, an exception to this limitation is for Annotation classes, where you can read the arguments values.