plugins {
    id "com.android.application"
    id "kotlin-android"
    id "kotlin-parcelize"
    id "com.github.ben-manes.versions"
    id "org.jlleitschuh.gradle.ktlint"
    id "androidx.navigation.safeargs"
}

android {
    compileSdkVersion versions.compileSdk
    buildToolsVersion versions.buildTools

    defaultConfig {
        applicationId constants.applicationId
        minSdkVersion versions.minSdk
        targetSdkVersion versions.targetSdk
        versionCode versions.versionCode

        versionName versions.versionName
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            shrinkResources true
            minifyEnabled true
            proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
        }
        applicationVariants.all { variant ->
            variant.outputs.all {
                outputFileName = "${constants.applicationName}-${defaultConfig.versionName}-${defaultConfig.versionCode}.apk"
            }
        }
    }
    compileOptions {
        coreLibraryDesugaringEnabled true
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
        freeCompilerArgs += [
                "-Xinline-classes",
                "-Xallow-result-return-type",
                "-Xuse-experimental=" +
                        "kotlin.Experimental," +
                        "kotlinx.coroutines.ExperimentalCoroutinesApi," +
                        "kotlinx.coroutines.InternalCoroutinesApi," +
                        "kotlinx.coroutines.FlowPreview"
        ]
    }
    buildFeatures {
        viewBinding true
    }
}

dependencies {
    coreLibraryDesugaring libs.desugaring
    implementation project(path: ":domain")
    implementation project(path: ":data")
    implementation libs.appcompat
    implementation libs.constraintlayout
    implementation libs.coroutines
    implementation libs.ktxCore
    implementation libs.koinCore
    implementation libs.kotlinStdLib
    implementation libs.kotpref
    implementation libs.kotprefEnum
    implementation libs.livedataKtx
    implementation libs.logger
    implementation libs.material
    implementation libs.navigationRuntimeKtx
    implementation libs.navigationUiKtx
    implementation libs.navigationFragmentKtx
    implementation libs.viewModelKtx
    implementation libs.lifecycleKtx
    implementation libs.recyclerView
}