maartenh
05/23/2024, 5:09 PMobject HasAnnotatedProperty {
@MyPropertyAnnotation("annotationParameter")
val myProperty: MyLibraryType by MyLibraryDelegate
}
All the My...
types here are supplied by the library and in particular the MyLibraryDelegate
would then interact with the KSP-generated class to provide the library functionality.
My problem is in how to let the library code for MyLibraryDelegate get a hold of the generated class instance. For a jvm target, this is easy as I could use jvm reflection and predictable class names to get to the class.
But I want to do this for the full multiplatform ecosystem, with my own immediate use cases being Kotlin/Native, and there I don't see a way to go from a class name string to getting hold of an instance of the generated class.
Is there a way to make this design work, or suggestions for an alternate design that works with the available tooling?Jiaxiang
05/23/2024, 5:20 PMmyProperty
so that you can read the delegation from it?maartenh
05/23/2024, 7:41 PMJiaxiang
05/23/2024, 8:04 PMmaartenh
05/23/2024, 8:08 PM