// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath 'com.google.gms:google-services:4.3.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.0.0"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

configurations.all {
    resolutionStrategy {
        force 'androidx.legacy:legacy-support-v4:1.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
        google()
        mavenCentral()
    }
}

ext {

    buildToolsVersion = '28.0.3'
    compileSdkVersion = 28
    targetSdkVersion = 28
    minSdkVersion = 21

    support_version = '1.0.0'
    appCompatVersion = '1.1.0-beta01'
    rxJavaVersion = '2.1.14'
    rxKotlinVersion = '2.2.0'
    rxAnimationsVersion = '0.0.6'
    timberVersion = '4.7.0'
    daggerVersion = '2.23.2'
    retrofitVersion = '2.5.0'
    okHttpVersion = '3.14.1'
    picassoVersion = '2.71828'
    crashlyticsVersion = '2.10.1'
    gsonVersion = '2.8.5'
    lifecycle_version = "1.1.1"
    coroutines_version = "1.2.0"
    anko_version = "0.10.8"
    navigationVersion = "1.0.0-rc02"
    lottieVersion = "3.0.2"
    threetenabpVersion = "1.2.0"
    stethoVersion = "1.5.1"
    firebaseCoreVersion = "17.0.1"
    firebaseDatabaseVersion = "18.0.0"
    firebaseAuthVersion = "18.1.0"
    firebaseStorageVersion = "18.1.0"
    firebaseUiStorageVersion = "3.2.1"
    firebaseMessagingVersion = "20.0.0"
    pushBotsVersion = "3.2.8@aar"
    scalingLayoutVersion = "1.2.1"
    circularImageViewVersion = "3.2.0"
    legacySupportv4Version = "1.0.0"
    lifecycleViewModelKtxVersion = "2.0.0"
    simpleTextVersion = "2.0.1"
    glideVersion = "4.9.0"
    lifecycleVersion = "2.0.0"
    roomVersion = "2.1.0"
    pagingVersion = "2.1.0"
    dataBindingVersion = "3.5.0"
    exoPlayerVersion = "2.9.6"
    jUnitTestVersion = "4.12"
    archCoreTestVersion = "2.0.1"
    roomTestVersion = "2.1.0"
    pagingTestVersion = "2.1.0"
    autoDisposeVersion = "1.3.0"
    stethoVersion = "1.5.1"
    timeAgoVersion = "4.0.1"

    //supportLib
    supportv4 = "androidx.legacy:legacy-support-v4:$support_version"
    appCompat = "androidx.appcompat:appcompat:$appCompatVersion"
    materialDesign = "com.google.android.material:material:$support_version"
    recyclerView = "androidx.recyclerview:recyclerview:$support_version"
    cardView = "androidx.cardview:cardview:$support_version"
    coreKtx = 'androidx.core:core-ktx:1.2.0-alpha01'

    //firebase
    firebaseCore = "com.google.firebase:firebase-core:$firebaseCoreVersion"
    firebaseDatabase = "com.google.firebase:firebase-database:$firebaseDatabaseVersion"
    firebaseAuth = "com.google.firebase:firebase-auth:$firebaseAuthVersion"
    firebaseStorage = "com.google.firebase:firebase-storage:$firebaseStorageVersion"
    firebaseUiStorage = "com.firebaseui:firebase-ui-storage:$firebaseUiStorageVersion"
    firebaseMessaging = "com.google.firebase:firebase-messaging:$firebaseMessagingVersion"

    //rx
    rxJava = "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
    rxAndroid = "io.reactivex.rxjava2:rxandroid:2.0.1"
    rxKotlin = "io.reactivex.rxjava2:rxkotlin:$rxKotlinVersion"
    rxAnimations = "com.mikhaellopez:rxanimation:$rxAnimationsVersion"

    //autoDispose
    autoDisposeAndroidExt = "com.uber.autodispose:autodispose-android:$autoDisposeVersion"
    autoDispose = "com.uber.autodispose:autodispose:$autoDisposeVersion"
    autoDisposeLifecycle = "com.uber.autodispose:autodispose-lifecycle:$autoDisposeVersion"
    autoDisposeArchComponents = "com.uber.autodispose:autodispose-android-archcomponents:$autoDisposeVersion"

    //arch-comp Lifecycles, LiveData, and ViewModel
    lifecycleExt = "androidx.lifecycle:lifecycle-extensions:$lifecycleVersion"
    lifecycleAnnotation = "androidx.lifecycle:lifecycle-compiler:$lifecycleVersion"
    lifecycleViewModelKtx = "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleViewModelKtxVersion"

    //navigation
    navigationFragment = 'androidx.navigation:navigation-fragment-ktx:2.0.0-rc02'
    navigationUI = 'androidx.navigation:navigation-ui-ktx:2.0.0-rc02'

    //room
    roomRuntime = "androidx.room:room-runtime:$roomVersion"
    roomCompiler = "androidx.room:room-compiler:$roomVersion"

    //dataBinding
    dataBindingCompilerKapt = "androidx.databinding:databinding-compiler:$dataBindingVersion"
    dataBindingCompilerAnnotation = "androidx.databinding:databinding-compiler:$dataBindingVersion"

    //paging
    pagingRuntime = "androidx.paging:paging-runtime:$pagingVersion"

    //dagger
    dagger = "com.google.dagger:dagger-android:$daggerVersion"
    daggerSupport = "com.google.dagger:dagger-android-support:$daggerVersion"
    // if you use the support libraries
    daggerAnnotation = "com.google.dagger:dagger-android-processor:$daggerVersion"
    //for annotationProcessor
    daggerApt = "com.google.dagger:dagger-compiler:$daggerVersion"

    //net
    retrofit = "com.squareup.retrofit2:retrofit:$retrofitVersion"
    okHttp = "com.squareup.okhttp3:okhttp:$okHttpVersion"
    gson = "com.google.code.gson:gson:$gsonVersion"
    rxJavaAdapter = "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
    gsonConverter = "com.squareup.retrofit2:converter-gson:$retrofitVersion"

    //pushBots
    pushBots = "com.pushbots:pushbots-lib:3.2.8@aar"

    //coroutines
    coroutinesCore = "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version"

    //anko
    anko = "org.jetbrains.anko:anko:$anko_version"
    ankoCoroutines = "org.jetbrains.anko:anko-coroutines:$anko_version"

    //exoPlayer
    exoPlayer = "com.google.android.exoplayer:exoplayer:$exoPlayerVersion"

    //picasso
    picasso = "com.squareup.picasso:picasso:$picassoVersion"

    //glide
    glide = "com.github.bumptech.glide:glide:$glideVersion"
    glideAnnotation = "com.github.bumptech.glide:compiler:$glideVersion"

    //simpleText
    simpleText = "com.jaychang:simpletext:$simpleTextVersion"

    //timeAgo
    timeAgo = "com.github.marlonlom:timeago:$timeAgoVersion"

    //scalingLayout
    scalingLayout = "com.github.iammert:ScalingLayout:$scalingLayoutVersion"

    //circularImageView
    circularImageView = "com.mikhaellopez:circularimageview:$circularImageViewVersion"

    //flagKit
    flagKit = "com.github.KaKaVip:Android-Flag-Kit:v0.1"

    //threetenabp
    threetenabp = "com.jakewharton.threetenabp:threetenabp:$threetenabpVersion"

    //lottie
    lottie = "com.airbnb.android:lottie:$lottieVersion"

    //timber
    timber = "com.jakewharton.timber:timber:$timberVersion"

    //crashlytics
    crashlytics = "com.crashlytics.sdk.android:crashlytics:$crashlyticsVersion@aar"

    //stetho
    stethoCore = "com.facebook.stetho:stetho:$stethoVersion"
    stethoOkHttp = "com.facebook.stetho:stetho-okhttp3:$stethoVersion"
    stethoUrlConnection = "com.facebook.stetho:stetho-urlconnection:$stethoVersion"

    //test
    jUnit = "junit:junit:$jUnitTestVersion"
    archCoreTest = "androidx.arch.core:core-testing:$archCoreTestVersion"
    roomTest = "androidx.room:room-testing:$roomTestVersion"
    pagingTest = "androidx.paging:paging-common:$pagingTestVersion"

    buildTime = new Date().format("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC"))
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
