ext {

    compiler = [
            java  : JavaVersion.VERSION_1_8,
            kotlin: '1.5.30'
    ]

    android = [
            buildTools: '31.0.3',
            minSdk    : 16,
            targetSdk : 31,
            compileSdk: 31
    ]

    build = [
            ciBuild: System.getenv("CI_BUILD") == "true",
    ]

    application = [
            id                       : 'com.andremion.theatre',
            versionCode              : 3,
            versionName              : "1.0.2",
            testInstrumentationRunner: "androidx.test.runner.AndroidJUnitRunner"
    ]

    // Libraries
    multidexVersion = '2.0.1'
    daggerVersion = '2.38.1'
    androidxAnnotationVersion = '1.2.0'
    rxJavaVersion = '2.2.21'
    rxKotlinVersion = '2.4.0'
    rxAndroidVersion = '2.1.1'
    retrofitVersion = '2.9.0'
    okHttpVersion = '4.9.1'
    moshiVersion = '1.12.0'
    moshiLazyAdapterVersion = '2.2'
    lifecycleVersion = '2.3.1'
    roomVersion = '2.3.0'
    constraintLayoutVersion = '2.0.4'
    androidKtxVersion = '1.6.0'
    androidFragmentKtxVersion = '1.3.6'
    cardViewVersion = '1.0.0'
    materialVersion = '1.4.0'
    recyclerViewVersion = '1.2.1'
    swipeRefreshLayoutVersion = "1.1.0"
    vectorDrawableVersion = "1.1.0"
    glideVersion = '4.12.0'
    stethoVersion = '1.6.0'

    // Testing
    jUnitVersion = '4.13.2'
    mockitoVersion = '3.12.4'
    espressoVersion = '3.4.0'
    testRunnerVersion = '1.4.0'
    jacocoVersion = '0.8.7'

    // Presentation

    presentationKaptDependencies = [
            "com.google.dagger:dagger-compiler:${daggerVersion}",
            "com.google.dagger:dagger-android-processor:${daggerVersion}"
    ]

    presentationDependencies = [
            "androidx.multidex:multidex:$multidexVersion",
            "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$compiler.kotlin",
            "com.google.dagger:dagger:${daggerVersion}",
            "com.google.dagger:dagger-android-support:${daggerVersion}",
            "androidx.lifecycle:lifecycle-common-java8:$lifecycleVersion",
            "androidx.lifecycle:lifecycle-runtime:$lifecycleVersion",
            "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion",
            "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion",
            "androidx.lifecycle:lifecycle-reactivestreams:$lifecycleVersion",
            "com.google.android.material:material:$materialVersion",
            "androidx.vectordrawable:vectordrawable:$vectorDrawableVersion",
            "androidx.recyclerview:recyclerview:$recyclerViewVersion",
            "androidx.cardview:cardview:$cardViewVersion",
            "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion",
            "androidx.constraintlayout:constraintlayout-solver:$constraintLayoutVersion",
            "androidx.swiperefreshlayout:swiperefreshlayout:$swipeRefreshLayoutVersion",
            "androidx.core:core-ktx:${androidKtxVersion}",
            "androidx.fragment:fragment-ktx:$androidFragmentKtxVersion",
            "io.reactivex.rxjava2:rxjava:${rxJavaVersion}",
            "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}",
            "io.reactivex.rxjava2:rxandroid:${rxAndroidVersion}",
            "com.github.bumptech.glide:glide:${glideVersion}",
            "androidx.room:room-runtime:$roomVersion",
            "com.facebook.stetho:stetho:$stethoVersion"
    ]

    presentationTestDependencies = [
            "junit:junit:$jUnitVersion",
            "org.mockito:mockito-core:${mockitoVersion}"
    ]

    presentationInstrumentationTestDependencies = [
            "androidx.test.espresso:espresso-core:$espressoVersion",
            "androidx.test:runner:$testRunnerVersion",
            "androidx.test:rules:$testRunnerVersion",
            "androidx.annotation:annotation:$androidxAnnotationVersion"
    ]

    // Domain

    domainDependencies = [
            "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$compiler.kotlin",
            "org.jetbrains.kotlin:kotlin-reflect:$compiler.kotlin",
            "io.reactivex.rxjava2:rxjava:${rxJavaVersion}",
            "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}"
    ]

    domainTestDependencies = [
            "junit:junit:$jUnitVersion",
            "org.mockito:mockito-core:${mockitoVersion}"
    ]

    // Data

    dataKaptDependencies = [
            "androidx.room:room-compiler:$roomVersion"
    ]

    dataDependencies = [
            "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$compiler.kotlin",
            "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}",
            "com.squareup.retrofit2:retrofit:$retrofitVersion",
            "com.squareup.okhttp3:logging-interceptor:$okHttpVersion",
            "com.squareup.retrofit2:converter-moshi:$retrofitVersion",
            "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion",
            "com.squareup.moshi:moshi-kotlin:$moshiVersion",
            "com.serjltt.moshi:moshi-lazy-adapters:$moshiLazyAdapterVersion",
            "androidx.room:room-runtime:$roomVersion",
            "androidx.room:room-rxjava2:$roomVersion"
    ]

    dataTestDependencies = [
            "junit:junit:$jUnitVersion",
            "org.mockito:mockito-core:${mockitoVersion}",
            "com.squareup.okhttp3:mockwebserver:$okHttpVersion"
    ]

}
