/*
 * Copyright 2017, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 28
    buildToolsVersion rootProject.buildToolsVersion
    defaultConfig {
        applicationId 'com.example.android.persistence'
        minSdkVersion 21
        targetSdkVersion 28
        compileSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    buildFeatures {
        dataBinding = true
    }
    productFlavors {
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {

    implementation fileTree(include: ['*.jar'], dir: 'libs')

    implementation 'com.google.android.material:material:' + rootProject.materialVersion
    implementation 'androidx.cardview:cardview:' + rootProject.supportLibVersion
    implementation 'androidx.recyclerview:recyclerview:' + rootProject.supportLibVersion
    implementation 'androidx.lifecycle:lifecycle-extensions:' + rootProject.archLifecycleVersion
    implementation 'androidx.room:room-runtime:' + rootProject.archRoomVersion
    kapt "androidx.lifecycle:lifecycle-compiler:" + rootProject.archLifecycleVersion
    kapt "androidx.room:room-compiler:" + rootProject.archRoomVersion

    testImplementation 'junit:junit:4.12'

    // Testing-only dependencies
    androidTestImplementation 'androidx.test:runner:' + rootProject.testVersion
    androidTestImplementation 'androidx.test:rules:' + rootProject.testVersion
    androidTestImplementation 'androidx.test.espresso:espresso-core:' + rootProject.espressoVersion

    androidTestImplementation 'androidx.test.espresso:espresso-contrib:' + rootProject.espressoVersion

    // Force usage of dependencies in the test app, since it is internally used by the runner module.
    androidTestImplementation 'com.google.android.material:material:' + rootProject.materialVersion
    androidTestImplementation 'androidx.recyclerview:recyclerview:' + rootProject.supportLibVersion

    implementation 'androidx.leanback:leanback:' + rootProject.supportLibVersion
    implementation 'androidx.appcompat:appcompat:' + rootProject.supportLibVersion

    implementation 'androidx.preference:preference:' + rootProject.supportLibVersion
    implementation 'androidx.leanback:leanback-preference:' + rootProject.supportLibVersion
    implementation 'androidx.legacy:legacy-preference-v14:' + rootProject.supportLibVersion

    implementation "com.google.code.gson:gson:2.8.2"
    implementation "androidx.palette:palette:" + rootProject.supportLibVersion
    implementation 'com.google.android.exoplayer:exoplayer:r2.2.0'

    implementation 'com.github.bumptech.glide:glide:4.0.0-RC1'
    implementation 'androidx.tvprovider:tvprovider:' + rootProject.supportLibVersion

    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'

    implementation "com.google.dagger:dagger:" + rootProject.daggerVersion
    implementation "com.google.dagger:dagger-android:" + rootProject.daggerVersion
    implementation "com.google.dagger:dagger-android-support:" + rootProject.daggerVersion

    kapt "com.google.dagger:dagger-android-processor:" + rootProject.daggerVersion
    kapt "com.google.dagger:dagger-compiler:" + rootProject.daggerVersion
}

