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

Log an error when K2 is enabled until we support it #730

Closed JoelWilcox closed 1 year ago

JoelWilcox commented 1 year ago

Compiling a project with Anvil and K2 enabled would fail anyway, this just makes it more obvious that it's a known incompatibility for now.

JoelWilcox commented 1 year ago

Can there be an opt-out for this? For better or worse, it does actually help with K2 prep to have anvil be inert while testing other things

Discussed offline -- this was a misunderstanding on my part around where failures were already occurring vs where Anvil was effectively just not running. Updated to only log an error message

JoelWilcox commented 1 year ago

Also, doesn't this only affect the anvil repo? Or was that the goal? Maybe I misunderstood but not sure why the anvil repo needs this check

No you're right, thanks for catching that. Updated to apply at the plugin level