Open cedrickcooke opened 4 years ago
After some discussion, we think the approach here is to add an annotation processor to look at @InstallIn
classes and build the list of included modules that way. The goal is providing a generated function which knows which classes to include in the dependency graph w/o having to reflect on the @Component
and @Module
annotations. Something to the effect of:
// before
Replacements.of<ApplicationComponent> { }
// after
Replacements.ofApplicationComponent { }
This will be a breaking change, but with pretty easy transition.
Before, we did @ContributesAndroidInjector
in a module, now it's @AndroidEntryPoint
on the class. This shouldn't require any changes -- Stropping never used the @ContributesAndroidInjector
and has always just used reflection for the @Inject
fields.
We might need to do a lot of special casing for this, but ideally we can simply recurse down the list of components as necessary, just adding bindings at each step.
The relationship is well documented here: https://dagger.dev/hilt/components#component-hierarchy
This is gonna be a big one, but it's also too early to actually start on it. Just tracking for now.