square / anvil

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

[Bugfix] Incremental compilation via constructor parameter change. #755

Closed Laimiux closed 7 months ago

Laimiux commented 11 months ago

Attempting to fix https://github.com/square/anvil/issues/754, it would be good for someone with a better understanding of compiler plugins to take a look at this. I was able to test various scenarios successfully, but they might not be exhaustive.

CLAassistant commented 11 months ago

CLA assistant check
All committers have signed the CLA.

midery commented 10 months ago

@Laimiux Thanks for taking care of the fix! I also ran it in the sample project and on my own project with different scenarios, and it indeed fixes the problematic behaviour.

@JoelWilcox could you please share the vision of the Anvil team on this fix? I see that it can solve the problem, but as @Laimiux said, it may not be applicable for all the use-cases in complex projects.

JoelWilcox commented 10 months ago

@Laimiux Thanks for taking care of the fix! I also ran it in the sample project and on my own project with different scenarios, and it indeed fixes the problematic behaviour.

➕ Thanks for taking a stab at this @Laimiux!

@JoelWilcox could you please share the vision of the Anvil team on this fix? I see that it can solve the problem, but as @Laimiux said, it may not be applicable for all the use-cases in complex projects.

Due to the nature of the incremental compilation issues and how easy it is for regressions to happen in new areas even if we fix some cases, we're making sure we get appropriate integration test coverage in place before moving forward with related fixes. @RBusarow is currently working on that and applying the fix described in https://github.com/square/anvil/issues/693#issuecomment-1744013947.

JoelWilcox commented 7 months ago

Thanks again for the PR; closing now in favor of https://github.com/square/anvil/pull/836