Dagger, multi module projects & incremental builds performance

Viewed 105

Does it make sense to create an independent @Component in each module, and couple components using dependencies=[FeatureDepsProvider::class] instead of using Subcomponents to save build time on incremental builds?

For example, if I use subcomponents in gradle feature modules, and change something in subcomponent's graph that requires to regenerate it, it will also regenerate parent component, because it's a subclass, right?

What will happen if I use components? If I change something in feature component, but don't change public interface of this component, will other components which depend on this public interface be regenerated too?

Example:

interface DependencyProvider {
 fun provideDep(): SomeDependency
}

// first gradle module
@Component
interface FeatureComponent : DependencyProvider {}

// second gradle module
@Component(dependencies = [DependencyProvider::class])
interface ConsumerComponent {
}

Also, I'd like to have some explanation on how incremental annotation processor works for Dagger

0 Answers
Related