Modified the project structure, removed module extension and went instead for a non-complete core dependency graph

This commit is contained in:
Ernir Erlingsson
2016-03-13 22:31:14 +01:00
parent 7670bc48ea
commit 4da63b3800
33 changed files with 314 additions and 398 deletions

View File

@@ -6,12 +6,7 @@ import java.util.logging.Logger;
import android.app.Application;
import android.content.Context;
import org.briarproject.CoreComponent;
import org.briarproject.CoreEagerSingletons;
import org.briarproject.DaggerCoreComponent;
import org.briarproject.plugins.PluginsModuleExtension;
import org.briarproject.system.PlatformModuleExtension;
import org.briarproject.system.SystemModuleExtension;
import org.briarproject.CoreModule;
public class BriarApplication extends Application {
@@ -30,20 +25,14 @@ public class BriarApplication extends Application {
CrashHandler newHandler = new CrashHandler(ctx, oldHandler);
Thread.setDefaultUncaughtExceptionHandler(newHandler);
CoreComponent coreComponent = DaggerCoreComponent.builder()
.systemModule(new SystemModuleExtension(this))
.platformModule(new PlatformModuleExtension(this))
.pluginsModule(new PluginsModuleExtension(this))
.build();
applicationComponent = DaggerAndroidComponent.builder()
.appModule(new AppModule(this))
.coreComponent(coreComponent)
.androidModule(new AndroidModule())
.build();
// We need to load the eager singletons directly after making the
// dependency graphs
CoreEagerSingletons.initEagerSingletons(coreComponent);
CoreModule.initEagerSingletons(applicationComponent);
AndroidEagerSingletons.initEagerSingletons(applicationComponent);
}