/*
 *
 * Copyright 2019 Arunkumar
 *
 * 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'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'androidx.navigation.safeargs'

android {
    compileSdkVersion buildDetails.compileSdk

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        applicationId buildDetails.packageName
        minSdkVersion buildDetails.minSdk
        targetSdkVersion buildDetails.targetSdk
        versionCode buildDetails.versionCode
        versionName buildDetails.versionName

        vectorDrawables.useSupportLibrary = true

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        debug {
            minifyEnabled false
            shrinkResources false
            debuggable true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        release {
            minifyEnabled true
            shrinkResources true
            debuggable false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

androidExtensions {
    experimental = true
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation project(':transitionx')

    implementation "androidx.core:core-ktx:${versions.ktx}"

    implementation "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}"

    // Support
    implementation "com.android.support:design:${versions.supportLibrary}"
    implementation "com.android.support:cardview-v7:${versions.supportLibrary}"
    implementation "com.android.support:support-vector-drawable:${versions.supportLibrary}"
    implementation "com.android.support:recyclerview-v7:${versions.supportLibrary}"

    implementation "com.android.support.constraint:constraint-layout:${versions.constraintLayout}"

    implementation "com.google.android:flexbox:${versions.flexbox}"

    // Logging
    implementation "com.jakewharton.timber:timber:${versions.timber}"

    // Glide - Image loading
    implementation "com.github.bumptech.glide:glide:${versions.glide}"
    kapt "com.github.bumptech.glide:compiler:${versions.glide}"

    // Navigation
    implementation "android.arch.navigation:navigation-fragment:${versions.navigation}"
    implementation "android.arch.navigation:navigation-ui:${versions.navigation}"
    implementation "android.arch.navigation:navigation-ui:${versions.navigation}"
    implementation "android.arch.navigation:navigation-ui-ktx:${versions.navigation}"

    // Adapter Delegates
    implementation "com.hannesdorfmann:adapterdelegates3:${versions.adapterDelegates}"

    testImplementation "junit:junit:${versions.junit}"
    testImplementation "org.robolectric:robolectric:${versions.roboelectric}"
}
