google / dagger

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

Is there any plan that support DFM compilation for Hilt? #2856

Closed SinoReimu closed 3 years ago

SinoReimu commented 3 years ago

Hi! Currently Hilt collect generate all code with Application (such as ActivityCImpl、ApplicationCImpl...) but of course this class cannot access code in DFM code. Also, annotationProcessor in app module will not process the annotation in DFM. We do need to use DFM for feature delivery, should we fallback to use dagger injection?

Thanks!

Chang-Eric commented 3 years ago

Yea, the current guidance for DFM is to use component dependencies. You can find a guide for that here: https://developer.android.com/training/dependency-injection/hilt-multi-module#dfm