I am working on a Lombok like plugin for Kotlin classes. The source is here: GitHub - bivektor/lombokt: Lightweight port of Lombok utilities for Kotlin
My purpose is as follows:
- Provide utilities like
ToString
andEqualsAndHashCode
for Kotlin non-data classes (almost complete) - Provide support for
Builders
to have a neat Java API so that a Kotlin class with several constructor parameters can be used from Java through builders
I have a few questions:
- I have already implemented ToString and EqualsAndHashCode by registering declarations in FIR and implementing them in IR. Do I really need FIR for this or is IR enough?
- For the @Builder annotation, again, is IR enough as we don’t want the generated methods to be in the Kotlin class? And is it enough to implement a SyntheticJavaResolveExtension as in the official Kotlin Lombok plugin for IDE support?
- I structured the code similar to how official Kotlin plugins are structured i.e. a gradle project with submodules for backend, cli, k1, k2, common and all these modules are ultimately compiled into a single plugin jar. Is this really necessary and why does JetBrains choose such a project structure?