import app.akane.Deps

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

if (file("google-services.json").exists()) {
    apply plugin: 'com.google.gms.google-services'
    apply plugin: 'io.fabric'
}

android {
    compileSdkVersion 'android-Q'
    defaultConfig {
        applicationId "app.akane"
        targetSdkVersion 29
        minSdkVersion 21
        versionCode 2
        versionName "0.0.2"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        kapt {
            arguments {
                arg("room.schemaLocation", "$projectDir/schemas".toString())
            }
        }

    }

    androidExtensions {
        experimental = true
    }

    packagingOptions {
        exclude 'META-INF/atomicfu.kotlin_module'
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    dataBinding {
        enabled = true
    }
}

dependencies {
    implementation project(":core")
    implementation project(":data")
    implementation Deps.Kotlin.stdlib
    implementation Deps.AndroidX.appcompat
    implementation Deps.AndroidX.corekts
    implementation Deps.Google.material
    implementation Deps.AndroidX.constraint
    implementation Deps.Lifecycle.extension
    implementation Deps.API.jraw

    implementation Deps.Dagger.androidSupport
    implementation Deps.AndroidX.legacy
    // implementation Deps.AndroidX.viewpager
    implementation Deps.AndroidX.recyclerView
    kapt Deps.Dagger.compiler
    kapt Deps.Dagger.androidProcessor

    compileOnly Deps.AssistedInject.annotationDagger2
    kapt Deps.AssistedInject.processorDagger2

    implementation Deps.Lifecycle.viewmodel

    implementation Deps.Room.runtime
    implementation Deps.Room.coroutine
    kapt Deps.Room.compiler

    implementation Deps.Fragment.fragment
    implementation Deps.Fragment.fragmentKtx


    // Fresco
    implementation Deps.Facebook.fresco
    implementation Deps.Facebook.frescoGif

    debugImplementation Deps.LeakCanary.debug
    releaseImplementation Deps.LeakCanary.release
    debugImplementation Deps.LeakCanary.fragment

    implementation Deps.Paging.runtime
    implementation Deps.Paging.common

    implementation Deps.Navigation.fragment
    implementation Deps.Navigation.navigationUI

    implementation Deps.Epoxy.epoxy
    implementation Deps.Epoxy.paging
    implementation Deps.Epoxy.dataBinding
    kapt Deps.Epoxy.processor
    implementation Deps.MvRx.mvrx

    implementation 'com.jakewharton.threetenabp:threetenabp:1.2.0'
    debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'

    implementation Deps.Helpers.timber
    implementation Deps.Coroutines.core
    implementation Deps.Coroutines.android
    //
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
