Dagger 2: What does @Module(includes =) do?

前端 未结 1 1429
春和景丽
春和景丽 2021-01-17 08:56

I\'m working on a project and I\'m trying to make it as modular as possible.

I\'m trying to use the @Module(includes = {}) annotation to achieve my goals, and it\'s

1条回答
  •  有刺的猬
    2021-01-17 09:39

    See the docs for Module.includes:

    Additional @Module-annotated classes from which this module is composed. The de-duplicated contributions of the modules in includes, and of their inclusions recursively, are all contributed to the object graph.

    In short, yes, Module.includes is a way of adding a dependency on the listed modules (AddonModule, VersionModule, and AboutModule in your example) from anything that includes the enclosing Module (CoreModule in your example).

    0 讨论(0)
提交回复
热议问题