square / anvil

A Kotlin compiler plugin to make dependency injection with Dagger 2 easier.
Apache License 2.0
1.31k stars 82 forks source link

Add KSP support to InjectConstructorFactory, MembersInjectorCodeGen, and assisted injection #795

Closed ZacSweers closed 11 months ago

ZacSweers commented 11 months ago

These were done together as they are linked. Tried to share code where possible, but there are some meaty parts in dagger generation util that I couldn't really easily share much.

Note that one test is disabled in KSP until binding module generation supports KSP, and I felt it best to save that for a later PR since that generator requires some reworking to avoid class merging during generation.

I also fixed a few mis-named files along the way.

Ref: #751

ZacSweers commented 11 months ago

Adding some more to this, please hold