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

android {
    sourceSets {
        main {
            jniLibs.srcDirs = ['src/main/jniLibs']
        }
    }
    namespace 'xn.xxp'
    compileSdk 35

    defaultConfig {
        applicationId "xn.xxp"
        minSdk 31
        targetSdk 35
        versionCode 2
        versionName "2.21"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        room {
            schemaDirectory("$projectDir/schemas")
        }
        ndk {
            //noinspection ChromeOsAbiSupport
            abiFilters 'armeabi-v7a'
        }
    }

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

    buildFeatures {
        viewBinding true
    }

    kotlinOptions {
        jvmTarget = '17'
    }

    applicationVariants.configureEach { variant ->
        variant.outputs.configureEach { output ->
            def formattedDate = new Date().format('yyyyMMddHHmm')
            output.outputFileName = "xn_xxp_${variant.versionName}_${formattedDate}.apk"
        }
    }

}

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

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

    // androidx
    implementation libs.androidx.core.ktx
    implementation libs.androidx.annotation
    implementation libs.androidx.lifecycle.extensions
    implementation libs.androidx.lifecycle.livedata.ktx
    implementation libs.androidx.lifecycle.viewmodel.ktx
    implementation libs.androidx.work.runtime
    //room
    implementation libs.androidx.room.runtime
    ksp libs.androidx.room.compiler
    // Retrofit
    implementation libs.retrofit
    implementation libs.converter.gson
    implementation libs.converter.scalars
    implementation libs.adapter.rxjava3
    // OkHttp
    implementation libs.okhttp
    implementation libs.logging.interceptor
    // RxJava
    implementation libs.rxjava
    // RxAndroid
    implementation libs.rxandroid
    // gson
    implementation libs.gson
    // auc
    implementation libs.utilcodex
    // swiperefreshlayout
    implementation libs.androidx.swiperefreshlayout
    //noinspection UseTomlInstead 3.0其实已经过时了 但是项目中依赖过多 懒得弄
    implementation "io.github.cymchad:BaseRecyclerViewAdapterHelper:3.0.14"
    // eventbus
    implementation libs.eventbus
    // dialogX
    implementation libs.dialogx
    // glide
    implementation libs.glide
    // xxPermissions
    implementation libs.xxpermissions
    // flexbox
    implementation libs.flexbox
    // lottie
    implementation libs.lottie
    // mqtt
    implementation libs.org.eclipse.paho.client.mqttv3
    // refresh
    implementation libs.refresh.layout.kernel
    implementation libs.refresh.footer.classics
    implementation libs.refresh.header.classics
    // zxing
    implementation libs.zxing.core
    implementation libs.zxing.android.core
    // coil
    implementation libs.coil
    implementation libs.coil.svg
    // fotoapparat
    //implementation libs.fotoapparat
    // gsPlayer
    implementation libs.gsyvideoplayer.java
    implementation libs.gsyvideoplayer.armv7a
    // jsoup
    implementation libs.jsoup
    // pdfView
    implementation libs.android.pdf.viewer
    // banner
    implementation 'com.github.zhpanvip:bannerviewpager:3.5.12'
    implementation 'com.github.NodeMedia:NodeMediaClient-Android:2.9.23'
}