나는Dagger Debug SubModule을 디버그 빌드에 포함시키는 방법은 무엇입니까?
protected AppComponent createComponent() {
return DaggerAppComponent.builder().appModule(new AppModule(this)).build();
}
AppModule는 아래와 같이`FeatureModule을 포함 아래로 내 응용 프로그램에서 단검 AppComponent을 만들 수 있어요.
@Module(includes = {FeatureModule.class})
public class AppModule {
// All the provides here
}
이제 FeatureModule에서 Debug 빌드를위한 별도의 항목을 계획합니다. 그래서 나는 또한 AppDebugModule가 마지막으로
@Module(includes = {FeatureDebugModule.class})
public class AppDebugModule : AppModule {
}
그리고 AppModule
에서 상속 만들 FeatureModule 에서 그와@Module
public class FeatureDebugModule extends FeatureModule {
@Override
protected void debugBuildSpecificConfig() {
// Something specific to debug
}
}
을 상속 내 FeatureDebugModule를 작성, 나는 다음과 같이 AppDebugApplication이 설치 단검 구성 요소를 만든 만든
protected AppComponent createComponent() {
return DaggerAppComponent.builder().appModule(new AppDebugModule(this)).build();
}
아무 래도 코드가 내 디버그 모드에서 FeatureDebugModule
에 액세스하지 않지만 여전히 FeatureModule
코드에 있습니다. . 나는 무엇을 잘못 했는가?
은 어떻게 정의 않았다 당신 " AppDebugApplication "? – Benjamin