ext {
    //
    // ===== Versions =====
    //

    //Annotation processor dependencies
    daggerVersion = '2.25.2'
    autoFactoryVersion = '1.0-beta7'
    autoValueVersion = "1.7"
    butterknifeVersion = '10.2.0'

    //Standard dependencies
    supportLibraryVersion = '1.1.0'
    javaxAnnotationsVersion = '10.0-b28'
    autoFactoryVersion = '1.0-beta7'
    rxAndroidVersion = '1.2.1'
    rxJavaVersion = '1.3.8'
    rxBindingVersion = '1.0.1'
    timberVersion = '4.7.1'
    retrofitVersion = '2.6.2'
    gsonVersion = '2.6.2'
    okhttpVersion = '4.2.2'
    guavaVersion = '28.1-android'

    // Testing dependencies
    junitVersion = '4.13-rc-1'
    mockitoVersion = '3.1.0'

    //Functional/end-to-end testing dependencies
    espressoVersion = '3.3.0-alpha02'
    testRunnerVersion = '1.3.0-alpha02'
    testRulesVersion = '1.3.0-alpha02'

    //
    // ===== Libraries =====
    //

    //Annotation processor dependencies
    daggerCompiler = "com.google.dagger:dagger-compiler:${daggerVersion}"
    autoFactoryCompiler = "com.google.auto.factory:auto-factory:${autoFactoryVersion}"
    butterknifeCompiler = "com.jakewharton:butterknife-compiler:${butterknifeVersion}"

    //Standard dependencies
    appCompat = "androidx.appcompat:appcompat:${supportLibraryVersion}"
    recyclerView = "androidx.recyclerview:recyclerview:1.1.0-rc01"

    butterknife = "com.jakewharton:butterknife:${butterknifeVersion}"
    dagger = "com.google.dagger:dagger:${daggerVersion}"
    javaxAnnotations = "org.glassfish:javax.annotation:${javaxAnnotationsVersion}"
    autoFactory = "com.google.auto.factory:auto-factory:${autoFactoryVersion}"
    autoValue = "com.google.auto.value:auto-value:${autoValueVersion}"
    autoValueAnnotations = "com.google.auto.value:auto-value-annotations:${autoValueVersion}"
    rxAndroid = "io.reactivex:rxandroid:${rxAndroidVersion}"
    rxJava = "io.reactivex:rxjava:${rxJavaVersion}"
    rxBinding = "com.jakewharton.rxbinding:rxbinding:${rxBindingVersion}"
    timber = "com.jakewharton.timber:timber:${timberVersion}"
    retrofit = "com.squareup.retrofit2:retrofit:${retrofitVersion}"
    retrofitRxAdapter = "com.squareup.retrofit2:adapter-rxjava:${retrofitVersion}"
    retrofitGsonConverter = "com.squareup.retrofit2:converter-gson:${gsonVersion}"
    okhttp = "com.squareup.okhttp3:okhttp:${okhttpVersion}"
    okhttpLoggingInterceptor = "com.squareup.okhttp3:logging-interceptor:${okhttpVersion}"
    guavaAndroid = "com.google.guava:guava:${guavaVersion}"

    //Testing dependencies
    junit = "junit:junit:${junitVersion}"
    mockito = "org.mockito:mockito-core:${mockitoVersion}"

    //Functional/end-to-end testing dependencies
    espressoCore = "androidx.test.espresso:espresso-core:${espressoVersion}"
    espressoIntents = "androidx.test.espresso:espresso-intents:${espressoVersion}"
    espressoContrib = "androidx.test.espresso:espresso-contrib:${espressoVersion}"
    testRunner = "androidx.test:runner:${testRunnerVersion}"
    testRules = "androidx.test:rules:${testRulesVersion}"

    espressoExcludes = {
        exclude group: 'androidx.legacy', module: 'legacy-support-v4'
        exclude module: 'recyclerview'
    }


    //
    // ===== Modules =====
    //
    app = [
            [configuration: "implementation", dependency: appCompat],
            [configuration: "implementation", dependency: recyclerView],
    ]

    repository = [
    ]

    repos = [
            [configuration: "implementation", dependency: recyclerView],
    ]

    base = [
            [configuration: "api", dependency: butterknife],
            [configuration: "api", dependency: appCompat],
            [configuration: "api", dependency: dagger],
            [configuration: "api", dependency: javaxAnnotations],
            [configuration: "api", dependency: autoFactory],
            [configuration: "api", dependency: autoValue],
            [configuration: "api", dependency: autoValueAnnotations],
            [configuration: "api", dependency: rxAndroid],
            [configuration: "api", dependency: rxJava],
            [configuration: "api", dependency: rxBinding],
            [configuration: "api", dependency: timber],
            [configuration: "api", dependency: retrofit],
            [configuration: "api", dependency: retrofitRxAdapter],
            [configuration: "api", dependency: retrofitGsonConverter],
            [configuration: "api", dependency: okhttp],
            [configuration: "api", dependency: okhttpLoggingInterceptor],
            [configuration: "api", dependency: guavaAndroid],
    ]

    //Imported in all modules
    unitTestsDependencies = [
            [configuration: "testImplementation", dependency: junit],
            [configuration: "testImplementation", dependency: mockito]
    ]

    //Importend in app module only
    instrumentationTestsDependencies = [
            [configuration: "androidTestImplementation", dependency: espressoCore, options: espressoExcludes],
            [configuration: "androidTestImplementation", dependency: espressoIntents, options: espressoExcludes],
            [configuration: "androidTestImplementation", dependency: espressoContrib, options: espressoExcludes],
            [configuration: "androidTestImplementation", dependency: testRunner],
            [configuration: "androidTestImplementation", dependency: testRules],
    ]

    //Imported in all modules
    annotationProcessorsDependencies = [
            [configuration: "annotationProcessor", dependency: autoFactoryCompiler],
            [configuration: "annotationProcessor", dependency: daggerCompiler],
            [configuration: "annotationProcessor", dependency: butterknifeCompiler],
            [configuration: "annotationProcessor", dependency: autoValue],
    ]
}
