plugins {
    id("com.android.application")
    id("org.jetbrains.kotlin.android")
    kotlin("kapt") version Sdk.kotlin
}

android {
    compileSdk = Sdk.compileSdk

    defaultConfig {
        applicationId = "com.ys.bdtp.adm"
        minSdk = Sdk.minSdk
        targetSdk = Sdk.targetSdk
        versionCode = Sdk.versionCode
        versionName = Sdk.versionName

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables {
            useSupportLibrary = true
        }
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = "1.8"
        // 将数据库
        kapt {
            arguments {
                arg("room.schemaLocation", "$rootDir/schemas")
            }
        }
    }

    buildFeatures {
        compose = true
    }

    composeOptions {
        kotlinCompilerExtensionVersion = Sdk.compose
    }

    packagingOptions {
        resources {
            excludes += "/META-INF/{AL2.0,LGPL2.1}"

        }
    }
}
dependencies {

    // androidx
    implementation(Deps.Androidx.Core)
    implementation(Deps.Androidx.Appcompat)

    // google
    implementation(Deps.Google.Material)
    implementation(Deps.Google.Accompanist.Coil)
    implementation(Deps.Google.Accompanist.Insets)
    implementation(Deps.Google.Gson)

    // lifecycle
    implementation(Deps.Lifecycle.Runtime)
    implementation(Deps.Lifecycle.Livedata)
    implementation(Deps.Lifecycle.ViewModel)
    implementation(Deps.Lifecycle.Compose)

    // room
    kapt(Deps.Room.Compiler)
    implementation(Deps.Room.Ktx)
    implementation(Deps.Room.Runtime)

    // navigation
    implementation(Deps.Navigation.Runtime)
    implementation(Deps.Navigation.Compose)

    // kodein
    implementation(Deps.Kodein.Di)
    implementation(Deps.Kodein.Compose)
    implementation(Deps.Kodein.Androidx)
    implementation(Deps.Kodein.ViewModel)

    // kotlinx
    implementation(Deps.Kotlinx.Json)

    // square
    implementation(Deps.Square.Retrofit)
    implementation(Deps.Square.Converter.Gson)
    implementation(Deps.Square.Interceptor.Logging)

    // Compose
    implementation(Deps.Compose.Animation)
    implementation(Deps.Compose.Compiler)
    implementation(Deps.Compose.Foundation)
    implementation(Deps.Compose.Material.Material)
    implementation(Deps.Compose.Material.Extended)
    implementation(Deps.Compose.Runtime.Runtime)
    implementation(Deps.Compose.Runtime.LiveData)
    implementation(Deps.Compose.UI.UI)
    implementation(Deps.Compose.UI.Preview)
    implementation(Deps.Compose.UI.Tooling)
    implementation(Deps.Compose.Paging)
    implementation(Deps.Compose.ConstraintLayout)

    // .Compose
    implementation(Deps.Androidx.Compose)
    implementation(Deps.Lifecycle.Compose)
    implementation(Deps.Navigation.Compose)

    // Accompanist
    implementation(Deps.Accompanist.Insets)
    implementation(Deps.Accompanist.InsetsUI)
    implementation(Deps.Accompanist.FlowLayout)
    implementation(Deps.Accompanist.SystemUiController)

    // Coil
    implementation(Deps.Coil.Compose)

    // test
    testImplementation(Deps.Test.Junit)
    testImplementation(Deps.Room.Test)
    androidTestImplementation(Deps.AndroidXTest.Espresso)
    androidTestImplementation(Deps.Compose.Test.Compose)
    androidTestImplementation(Deps.AndroidXTest.Ktx)
    androidTestImplementation(Deps.AndroidXTest.Ext)
    debugImplementation(Deps.Compose.Debug.Tooling)
}