// Path: app/src/main/java/com/pacoworks/dereference/DereferenceApplication.java
// public class DereferenceApplication extends Application {
//     @Inject
//     MainInitialiser mainInitialiser;
// 
//     @Inject
//     FlavourInitialiser flavourInitialiser;
//     private ApplicationInjectionComponent component;
// 
//     public static DereferenceApplication get(Context context) {
//         return (DereferenceApplication)context.getApplicationContext();
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         buildComponentAndInject();
//     }
// 
//     private void buildComponentAndInject() {
//         component = ApplicationInjectionComponent.Initializer.init(this);
//         /* Force initialisers to be created */
//         component.inject(this);
//     }
// 
//     public ApplicationInjectionComponent component() {
//         return component;
//     }
// }
// 
// Path: app/src/whatever/java/com/pacoworks/dereference/FlavourInitialiser.java
// public class FlavourInitialiser {
//     public FlavourInitialiser(DereferenceApplication application) {
//     }
// }
// 
// Path: app/src/main/java/com/pacoworks/dereference/MainInitialiser.java
// public class MainInitialiser {
//     private final Application.ActivityLifecycleCallbacks initialiserCallbacks = new Application.ActivityLifecycleCallbacks() {
//         @Override
//         public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
//         }
// 
//         @Override
//         public void onActivityStarted(Activity activity) {
//         }
// 
//         @Override
//         public void onActivityResumed(Activity activity) {
//         }
// 
//         @Override
//         public void onActivityPaused(Activity activity) {
//         }
// 
//         @Override
//         public void onActivityStopped(Activity activity) {
//         }
// 
//         @Override
//         public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
//         }
// 
//         @Override
//         public void onActivityDestroyed(Activity activity) {
//         }
//     };
// 
//     public MainInitialiser(DereferenceApplication application, OkHttpClient okHttpClient) {
//         application.registerActivityLifecycleCallbacks(initialiserCallbacks);
//         LeakCanary.install(application);
//         if (BuildConfig.DEBUG) {
//             // FIXME no stetho for now
//             // Stetho.initialize(Stetho.newInitializerBuilder(application)
//             // .enableDumpapp(Stetho.defaultDumperPluginsProvider(application)).build());
//             LumberYard lumberYard = LumberYard.getInstance(application);
//             lumberYard.cleanUp();
//             Timber.plant(lumberYard.tree());
//             Timber.plant(new Timber.DebugTree());
//         }
//     }
// }


import javax.inject.Singleton;
import android.content.Context;
import com.pacoworks.dereference.DereferenceApplication;
import com.pacoworks.dereference.FlavourInitialiser;
import com.pacoworks.dereference.MainInitialiser;
import com.squareup.okhttp.OkHttpClient;
import dagger.Module;
import dagger.Provides;
/*
 * Copyright (c) pakoito 2015
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.pacoworks.dereference.dependencies.modules;





@Module
public class ApplicationModule {
    DereferenceApplication application;

    public ApplicationModule(DereferenceApplication app) {
        application = app;
    }

    @Provides
    @Singleton
    DereferenceApplication provideApplication() {
        return application;
    }

    @Provides
    @Singleton
    Context provideContext() {
        return application;
    }

    @Provides
    @Singleton
// Path: app/src/main/java/com/pacoworks/dereference/DereferenceApplication.java
// public class DereferenceApplication extends Application {
//     @Inject
//     MainInitialiser mainInitialiser;
// 
//     @Inject
//     FlavourInitialiser flavourInitialiser;
//     private ApplicationInjectionComponent component;
// 
//     public static DereferenceApplication get(Context context) {
//         return (DereferenceApplication)context.getApplicationContext();
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         buildComponentAndInject();
//     }
// 
//     private void buildComponentAndInject() {
//         component = ApplicationInjectionComponent.Initializer.init(this);
//         /* Force initialisers to be created */
//         component.inject(this);
//     }
// 
//     public ApplicationInjectionComponent component() {
//         return component;
//     }
// }
// 
// Path: app/src/whatever/java/com/pacoworks/dereference/FlavourInitialiser.java
// public class FlavourInitialiser {
//     public FlavourInitialiser(DereferenceApplication application) {
//     }
// }
// 
// Path: app/src/main/java/com/pacoworks/dereference/MainInitialiser.java
// public class MainInitialiser {
//     private final Application.ActivityLifecycleCallbacks initialiserCallbacks = new Application.ActivityLifecycleCallbacks() {
//         @Override
//         public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
//         }
// 
//         @Override
//         public void onActivityStarted(Activity activity) {
//         }
// 
//         @Override
//         public void onActivityResumed(Activity activity) {
//         }
// 
//         @Override
//         public void onActivityPaused(Activity activity) {
//         }
// 
//         @Override
//         public void onActivityStopped(Activity activity) {
//         }
// 
//         @Override
//         public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
//         }
// 
//         @Override
//         public void onActivityDestroyed(Activity activity) {
//         }
//     };
// 
//     public MainInitialiser(DereferenceApplication application, OkHttpClient okHttpClient) {
//         application.registerActivityLifecycleCallbacks(initialiserCallbacks);
//         LeakCanary.install(application);
//         if (BuildConfig.DEBUG) {
//             // FIXME no stetho for now
//             // Stetho.initialize(Stetho.newInitializerBuilder(application)
//             // .enableDumpapp(Stetho.defaultDumperPluginsProvider(application)).build());
//             LumberYard lumberYard = LumberYard.getInstance(application);
//             lumberYard.cleanUp();
//             Timber.plant(lumberYard.tree());
//             Timber.plant(new Timber.DebugTree());
//         }
//     }
// }


// Path: app/src/main/java/com/pacoworks/dereference/dependencies/modules/ApplicationModule.java
import javax.inject.Singleton;
import android.content.Context;
import com.pacoworks.dereference.DereferenceApplication;
import com.pacoworks.dereference.FlavourInitialiser;
import com.pacoworks.dereference.MainInitialiser;
import com.squareup.okhttp.OkHttpClient;
import dagger.Module;
import dagger.Provides;

/*
 * Copyright (c) pakoito 2015
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.pacoworks.dereference.dependencies.modules;





@Module
public class ApplicationModule {
    DereferenceApplication application;

    public ApplicationModule(DereferenceApplication app) {
        application = app;
    }

    @Provides
    @Singleton
    DereferenceApplication provideApplication() {
        return application;
    }

    @Provides
    @Singleton
    Context provideContext() {
        return application;
    }

    @Provides
    @Singleton
    MainInitialiser provideMainInitialiser(DereferenceApplication application,