Hello everyone! We developed a
plugin for the Kotlin compiler that leverages the flows of the standard reflection approach and can find classes, objects or functions by some conditions in compile-time.
The current latest version is ready and stable!
Two ways of using the plugin are supported: by limited DSL (searching of classes and objects by supertypes and annotations; and searching of functions by signature and annotations) and by extended DSL (searching of classes and objects by custom condition and supertype; and searching of functions by custom condition and signature).
Since we use IR generation, the plugin can be used by all platforms (JVM, Nativa and JavaScript). Although currently, we can analyze only kt files.
Additionally, the plugin uses a code generation approach in limited DSL to support compile-time reflection in libraries. It means, if you have a library that uses Reflekt and you call something from this library in your project, all Reflekt calls will be in the compile-time.
Currently we support 1.5.30, 1.5.21, 1.5.20, 1.5.10, 1.5.0 Kotlin versions.
Unfortunately, we do not support incremental compilation yet, but in the next release, we will be!
We will be happy if the plugin would be helpful for you! If you are interested in this project and have some ideas for improving the plugin, please don’t hesitate to contact me!
To discuss it see
#compiler channel