How to use dagger 2 with Buck containing many buck modules?

My Android Buck project consists of many independent modules. For example, login is your own buck module, some of my large models belong to their own buck module, etc.

The problem I am facing is that if I subclass Application , I am not sure how each buck module will refer to it. If each buck module depends on the buck module that contains it, Application will not be able to access the dagger modules in the buck buck dependent modules because it will create a circular dependency.

Structure example:

  App1_Module -- depends on launcher module, contains manifest Module_1 -- buck module (launcher module), contains Dagger module Module_2 -- buck module, contains Dagger module ... Module_N -- buck module, contains Dagger module 

Is there a way to avoid the Application subclass? If not, where would Application go and how will dependencies work?

+4
source share

All Articles