kotlin-inject
kotlin-inject copied to clipboard
Deprecate and then remove the kapt backend.
The kapt backend requires quite a lot to maintain and causes some api limitations (see https://github.com/evant/kotlin-inject/issues/113 & https://github.com/evant/kotlin-inject/issues/42). Unless there's a good reason to keep it around I think it would be best to remove.
A related question is should we keep the abstraction built around it. I'm leaning towards yes, as we may investigate the plugin api https://youtrack.jetbrains.com/issue/KT-49508 when it becomes stable.
From the description of the ticket it doesn't seem like keeping the abstraction is worth it. They clarify that it's mostly about frontend plugins. Though that makes me wonder why KSP is mentioned there. Anyways if KSP does adopt to K2 we don't need an abstraction if we adopt to KSP.
More context: https://github.com/google/ksp/issues/983
My understanding is ksp is a wrapper of the unstable frontend compiler api. I do want to explore integrating with that api directly if there's something stable as it could help with things like forwarding default argument expressions which ksp doesn't support.
Anyway it was the kapt abstraction that was a pain because it had to deal with parallel java & kotlin metadata models. The ksp one is just a thin wrapper over the ksp classes and is much easier to maintain. I'm comfortable with keeping it short-term while finding out what the future holds for kotlin compiler plugins.