google / dagger

A fast dependency injector for Android and Java.
https://dagger.dev
Apache License 2.0
17.44k stars 2.01k forks source link

Support Gradle's upcoming incremental annotation processing feature #959

Closed ZakTaccardi closed 6 years ago

ZakTaccardi commented 6 years ago

https://github.com/gradle/incap

Similar to #298

ronshapiro commented 6 years ago

I don't see any docs for this, nor any timeline for when/if this is actually happening. Do you have any context on this?

gabrielittner commented 6 years ago

we do not support APs that have a many-to-1 or many-to-many annotation:genfile relationship

https://github.com/gradle/incap/issues/100

That sounds like a limitation that Dagger falls under.

ZakTaccardi commented 6 years ago

I don't see any docs for this, nor any timeline for when/if this is actually happening. Do you have any context on this?

Unfortunately, not really. This is the biggest issue that blocks me from using Dagger. Unfortunately now annotation processing + gradle == no incremental builds which is a huge pain point in the android development experience.

I was hoping somehow the dagger2/gradle team on this could work together to make this happen.

ronshapiro commented 6 years ago

Thanks @gabrielittner. In that case, I think it makes sense to close this...

JakeWharton commented 6 years ago

The gains to be had from modularization which provides parallelism and compilation avoidance likely will dwarf anything incremental annotation processing could achieve.

ZakTaccardi commented 6 years ago

The gains to be had from modularization which provides parallelism and compilation avoidance likely will dwarf anything incremental annotation processing could achieve.

We should definitely modularize. But it would be nice to have both

LuigiPapino commented 6 years ago

I actually got a 50% cut on my clean build time, modularizing the app. But the process to adapt the dagger components required some effort. Didn't find a way to use properly AndroidInjectors and @Contribute within a feature module.

But definitely worth it for the build speed up.