kotlin-inject icon indicating copy to clipboard operation
kotlin-inject copied to clipboard

Deprecate and then remove the kapt backend.

Open evant opened this issue 3 years ago • 5 comments

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.

evant avatar Jun 09 '22 17:06 evant

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.

evant avatar Jun 10 '22 14:06 evant

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.

PaulWoitaschek avatar Aug 05 '22 22:08 PaulWoitaschek

More context: https://github.com/google/ksp/issues/983

PaulWoitaschek avatar Aug 05 '22 22:08 PaulWoitaschek

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.

evant avatar Aug 05 '22 23:08 evant

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.

evant avatar Aug 05 '22 23:08 evant