plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'org.greenrobot.greendao'
}
//apply plugin: 'org.greenrobot.greendao' // apply plugin

def config = rootProject.ext.android
def depend = rootProject.ext.dependencies

android {

    namespace config.namespace
    compileSdk config.compileSdk

    defaultConfig {
        applicationId config.namespace
        minSdk config.minSdk
        targetSdk config.targetSdk
        versionCode config.versionCode
        versionName config.versionName
        testInstrumentationRunner config.testInstrumentationRunner
        multiDexEnabled true
    }

//    dexOptions {
//        incremental true
//        javaMaxHeapSize "4g"
//    }

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

    signingConfigs {
        release {
            storeFile file("./keystore/rfid.jks")
            storePassword "123456"
            keyAlias "frid"
            keyPassword "123456"
        }
        debug {
            storeFile file("./keystore/rfid.jks")
            storePassword "123456"
            keyAlias "frid"
            keyPassword "123456"
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    buildFeatures {
        viewBinding true
    }

    sourceSets {
        main {
            jni.srcDirs = []
            jniLibs.srcDirs = ['libs']
            res.srcDirs = ['src/main/res',//main
                           'src/main/restitle',//标题
                           'src/main/resdialog',//弹窗
            ]
        }
    }

    //自定义打包时apk名字
    android.applicationVariants.all { variant ->
        variant.outputs.all {
            // SXLS_时间_渠道名_版本名.apk  还可以拼接其他app内容：variant.versionCode  variant.buildType.name
//            outputFileName = "JDGL_${variant.versionName}_${releaseTime()}_${variant.name}.apk"
            outputFileName = "rfid_${variant.versionName}.apk"
        }
    }

    greendao {
        schemaVersion 1 //数据库版本号
        daoPackage 'sql.com.yz.db'// 设置DaoMaster、DaoSession、Dao 包名
        targetGenDir 'src/main/java'//设置DaoMaster、DaoSession、Dao目录  基本上都是这个
    }
}

def releaseTime() {
    return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC"))
}


dependencies {
    implementation depend.appcompat
    implementation depend.material
    implementation depend.constraintlayout
    implementation depend.navigation_fragment
    implementation depend.navigation_ui
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
    testImplementation depend.junit
    androidTestImplementation depend.ext_junit
    androidTestImplementation depend.espresso_core
    implementation depend.multidex
    implementation depend.swiperefreshlayout
    implementation depend.recyclerview
    implementation depend.baseRecyclerViewAdapterHelpers
    implementation depend.retrofit2
    //转换器，请求结果转换成Model
    implementation depend.retrofit2_gson
    //配合Rxjava 使用
    implementation depend.retrofit2_adapter_rxjava2
    implementation depend.jakewharton_retrofit2_adapter_rxjava2
    implementation depend.retrofit2_converter_scalars
    //下面两个是RxJava 和 RxAndroid
    implementation depend.rxjava2_rxandroid
    implementation depend.rxjava2_rxjava
    implementation depend.autodispose
    implementation depend.archcomponents

    implementation depend.okhttp3_okhttp
    implementation depend.okhttp3_okhttp_see

    implementation depend.okio_okio
    implementation depend.okhttp3_logging_interceptor
    //    implementation depend.updateVersion
    implementation depend.updateAppUtilsx

    implementation depend.eventbus
    implementation depend.xxpermissions
//    implementation depend.immersionbar
    implementation depend.hawk
//    implementation depend.tab_magicIndicator
    implementation depend.greendao
    implementation depend.immersionbar
    implementation depend.utilcodex
//    implementation depend.hawk
//    implementation depend.agentweb_core
//    implementation depend.agentweb_filechooser
    implementation depend.nineoldandroids
//    implementation depend.flycoTabLayout
    implementation depend.glide
//    implementation 'com.github.ITxiaoguang:SelectTextHelper:1.1.0'
//    implementation 'com.wang.avi:library:+'
    implementation depend.recyclerviewSideslip
    implementation 'com.ashokvarma.android:bottom-navigation-bar:2.0.3'
//    implementation 'me.himanshusoni.quantityview:quantity-view:1.2.0'
//    implementation 'com.github.donkingliang:LabelsView:1.5.0'
    implementation files('libs\\platform_sdk_v3.1.221124.jar')
    implementation files('libs\\USDKLibrary-v2.3.0710.aar')


}