plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.kotlin.android)
}

android {
    namespace 'xn.hxp'
    compileSdk 35

    defaultConfig {
        applicationId "xn.hxp"
        minSdk 24
        //noinspection ExpiredTargetSdkVersion,OldTargetApi
        targetSdk 28
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled = true
        ndk {
            abiFilters "armeabi-v7a"/*, "arm64-v8a", "x86"*/
        }
    }

    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = '17'
    }
    buildFeatures {
        viewBinding = true
    }
}

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

    implementation project(':serialport')

    implementation libs.androidx.core.ktx
    implementation libs.appcompat
    implementation libs.material
    implementation libs.activity
    implementation libs.constraintlayout
    testImplementation libs.junit
    androidTestImplementation libs.ext.junit
    androidTestImplementation libs.espresso.core

    //noinspection UseTomlInstead
    implementation 'com.github.jenly1314:zxing-lite:3.2.0'
    //noinspection UseTomlInstead
    implementation 'io.fotoapparat:fotoapparat:2.7.0'
    //noinspection UseTomlInstead
    implementation 'com.airbnb.android:lottie:6.6.2'
    //noinspection UseTomlInstead
    implementation "io.github.cymchad:BaseRecyclerViewAdapterHelper:3.0.14"
    //noinspection UseTomlInstead
    implementation 'org.greenrobot:eventbus:3.3.1'
    //noinspection UseTomlInstead
    implementation 'com.blankj:utilcodex:1.31.1'
    //noinspection UseTomlInstead
    implementation 'com.github.bumptech.glide:glide:4.16.0'

    def retrofit = "2.11.0"
    //noinspection UseTomlInstead
    implementation("com.squareup.retrofit2:retrofit:${retrofit}") // 最新稳定版本
    // Gson 转换器 (用于 JSON) - 你很可能需要这个  noinspection UseTomlInstead
    implementation("com.squareup.retrofit2:converter-gson:${retrofit}") // 与 Retrofit 相同的版本
    // RxJava 3 Retrofit 适配器 noinspection UseTomlInstead
    implementation("com.squareup.retrofit2:adapter-rxjava3:${retrofit}") // 与 Retrofit 相同的版本

    def okhttp = "4.12.0"
    //noinspection UseTomlInstead
    implementation("com.squareup.okhttp3:okhttp:${okhttp}") // 最新稳定版本
    // OkHttp 日志拦截器 (用于调试) - 强烈推荐  noinspection UseTomlInstead
    implementation("com.squareup.okhttp3:logging-interceptor:${okhttp}") // 与 OkHttp 相同的版本

    // RxJava 3 noinspection GradleDependency,UseTomlInstead
    implementation("io.reactivex.rxjava3:rxjava:3.1.8") // 最新稳定版本
    //noinspection UseTomlInstead
    implementation("io.reactivex.rxjava3:rxandroid:3.0.2") // 最新稳定版本

    // Gson noinspection UseTomlInstead
    implementation("com.google.code.gson:gson:2.12.1") // 最新稳定版本

    //noinspection UseTomlInstead
    implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")

    //noinspection UseTomlInstead
    implementation 'com.github.codbking:PickTime:v1.0.1'

    //noinspection UseTomlInstead
    implementation "com.kongzue.dialogx:DialogX:0.0.49"

    //noinspection UseTomlInstead
    implementation 'com.github.getActivity:XXPermissions:20.0'

    //noinspection UseTomlInstead
    implementation "androidx.multidex:multidex:2.0.1"

    def room_version = "2.6.1"
    //noinspection UseTomlInstead
    implementation "androidx.room:room-runtime:$room_version"
    // If this project uses any Kotlin source, use Kotlin Symbol Processing (KSP)
    // See KSP Quickstart to add KSP to your build
//    ksp "androidx.room:room-compiler:$room_version"
    // If this project only uses Java source, use the Java annotationProcessor
    // No additional plugins are necessary
    annotationProcessor "androidx.room:room-compiler:$room_version"

    def camerax_version = "1.0.0"
    implementation "androidx.camera:camera-core:${camerax_version}"
    implementation "androidx.camera:camera-camera2:${camerax_version}"
    implementation "androidx.camera:camera-lifecycle:${camerax_version}"
    implementation "androidx.camera:camera-view:1.0.0-alpha28"
    implementation "androidx.camera:camera-extensions:1.0.0-alpha28"

    implementation 'com.google.mlkit:face-detection:16.0.0'
    implementation 'com.github.kongzue.DialogXSample:DatePicker:0.0.14'

}