/*
 * Copyright (c) 2020 Ruslan Potekhin
 */

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'kotlin-kapt'
apply plugin: 'de.mannodermaus.android-junit5'
apply plugin: 'androidx.navigation.safeargs'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
android {
    sourceSets {
        androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
    }
    defaultConfig {
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }
    }
    compileOptions {
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    dataBinding {
        enabled = true
    }
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "com.feedapp.app"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 11
        versionName "1.0.10"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    testOptions {
        unitTests {
            includeAndroidResources = true
        }
        junitPlatform {
            filters {
                includeTags "slow"
                excludeTags "integration"
            }
            debugFilters {
                includeTags "integration"
            }
        }
    }
}

dependencies {
    def dagger_version = "2.17"
    def reactivestreams_version = "1.1.1"
    def rxcalladapter_version = '2.5.0'

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.2.0'
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
    implementation 'androidx.navigation:navigation-fragment:2.2.1'
    implementation 'androidx.navigation:navigation-ui:2.2.1'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.2.1'
    implementation 'androidx.navigation:navigation-ui-ktx:2.2.1'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
    implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
    implementation 'com.google.android.material:material:1.2.0-alpha05'
    implementation 'androidx.fragment:fragment-ktx:1.2.4'
    implementation 'androidx.preference:preference:1.1.0'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'


    // databinding
    kapt "com.android.databinding:compiler:3.1.4"

    // appintro
    implementation 'com.github.AppIntro:AppIntro:4.2.3'

    // glide
    kapt 'com.github.bumptech.glide:compiler:4.10.0'
    implementation 'com.github.bumptech.glide:glide:4.10.0'
    implementation "com.github.bumptech.glide:okhttp3-integration:4.5.0"

    // room
    implementation "androidx.room:room-runtime:2.2.5"
    kapt "android.arch.persistence.room:compiler:1.1.1"

    // gson
    implementation 'com.google.code.gson:gson:2.8.6'

    // worker
    implementation "androidx.work:work-runtime-ktx:2.3.1"

    // coroutines
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0"

    // something for solving annotation problem
    implementation 'org.glassfish:javax.annotation:10.0-b28'

    compileOnly "javax.annotation:jsr250-api:1.0"

    //dagger 2
    implementation "com.google.dagger:dagger-android:$dagger_version"
    implementation "com.google.dagger:dagger-android-support:$dagger_version"
    kapt "com.google.dagger:dagger-compiler:$dagger_version"
    kapt "com.google.dagger:dagger-android-processor:$dagger_version"

    // expanded fab
    implementation "com.leinardi.android:speed-dial:3.1.1"

    // retrofit
    implementation "com.squareup.retrofit2:retrofit:2.5.0"
    implementation "com.squareup.retrofit2:converter-gson:2.1.0"

    // okhttp
    implementation 'com.squareup.okhttp3:okhttp:3.12.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'

    // Reactive Streams (convert Observable to LiveData)
    implementation "android.arch.lifecycle:reactivestreams:$reactivestreams_version"

    // Rx-Retrofit Call Adapter
    implementation "com.squareup.retrofit2:adapter-rxjava2:$rxcalladapter_version"

    // kotlin coroutine retrofit vh_recipes_card
    implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'

    // Material SearchView
    implementation 'com.github.mancj:MaterialSearchBar:0.8.2'

    // shimmer effect
    implementation 'com.facebook.shimmer:shimmer:0.5.0'

    // charts
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'

    // tapview
    implementation 'com.getkeepsafe.taptargetview:taptargetview:1.13.0'


    // firebase
    implementation 'com.google.firebase:firebase-analytics:17.2.2'
    implementation 'com.google.firebase:firebase-auth:19.3.0'
    implementation 'com.firebaseui:firebase-ui-auth:6.2.0'
    implementation 'com.google.firebase:firebase-firestore-ktx:21.4.2'
    implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.1.1'


    // lottie
    implementation 'com.airbnb.android:lottie:3.0.3-support'

    // facebook login
    implementation 'com.facebook.android:facebook-login:[5,6)'


    // Add the Firebase SDK for Google Analytics.
    implementation 'com.google.firebase:firebase-analytics-ktx:17.4.2'

    // Add the Firebase Crashlytics SDK.
    implementation 'com.google.firebase:firebase-crashlytics:17.0.0'

    // cloud messaging
    implementation 'com.google.firebase:firebase-messaging:20.2.0'
    
    // test
    testImplementation 'androidx.test:core:1.2.0'
    testImplementation 'org.robolectric:robolectric:4.3.1'
    testImplementation "androidx.arch.core:core-testing:2.1.0"
    testImplementation 'com.android.support.test:rules:1.0.2'
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.5.2'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.5.2'
    testImplementation 'org.junit.jupiter:junit-jupiter-params:5.5.2'
    testImplementation "org.powermock:powermock-api-mockito2:1.7.4"
    testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.5.2'
    debugImplementation('androidx.fragment:fragment-testing:1.1.0', {
        exclude group: 'androidx.test', module: 'core'
    })

    testImplementation 'android.arch.core:core-testing:1.1.1'


}
