import java.text.DateFormat
import java.text.SimpleDateFormat

apply plugin: 'com.android.application'
//apply plugin: 'com.jakewharton.butterknife'
def releaseTime() {
    DateFormat df = new SimpleDateFormat("yyyyMMddHHmm")
    return df.format(Calendar.getInstance(Locale.CHINA).getTime())
}

android {
    compileSdk rootProject.ext.compileSdkVersion

    defaultConfig {
        applicationId rootProject.ext.applicationId
        minSdk rootProject.ext.minSdkVersion
        targetSdk rootProject.ext.targetSdkVersion
        versionCode rootProject.ext.versionCode
        versionName rootProject.ext.versionName
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
        multiDexEnabled true
        ndk {
            // 设置支持的SO库架构
            abiFilters 'armeabi' //, 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

            resValue("bool","superAdminTest","false")
        }

        debug {
            resValue("string", "PORT_NUMBER", "8081")
            resValue("bool","superAdminTest","true")
        }
    }

    lintOptions {
        abortOnError false
        checkReleaseBuilds false
    }

    compileOptions {
        coreLibraryDesugaringEnabled true
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildToolsVersion rootProject.ext.buildToolsVersion

    sourceSets {
        main {
            res.srcDirs = [
                    'src/main/res/layout/datatab',
                    'src/main/res/layout/item',
                    'src/main/res/layout',
                    'src/main/res'
            ]

        }
    }
    applicationVariants.all { variant ->
        variant.outputs.all {
            outputFileName = "boluo-peiliaobatai-v${defaultConfig.versionCode}-${releaseTime()}"+"-unsigned-${variant.name}.apk"
        }
    }
    buildFeatures {
        viewBinding = true
    }
}

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

    implementation files('libs\\PC_RFID.jar')
    implementation files('libs\\sdkapi.jar')
    compileOnly files('libs/sdkapi.jar')

    //测试相关
    testImplementation 'junit:junit:4.13-beta-2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'

    //支持包
    implementation 'androidx.appcompat:appcompat:1.6.0-alpha01'
    implementation 'com.google.android.material:material:1.6.0-beta01'
//    implementation 'com.google.android.material:material:1.0.0'
//    implementation 'androidx.appcompat:appcompat:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    //implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.vectordrawable:vectordrawable:1.1.0'

    // QMUI框架 link: http://qmuiteam.com/android
    // 本App 搭建的基础框架，基本使用控件功能请看官网的功能列表
//    implementation 'com.qmuiteam:qmui:1.2.0'
//    implementation 'com.qmuiteam:arch:0.3.1'
//    implementation 'com.qmuiteam:qmui:1.2.0'
    implementation 'com.qmuiteam:arch:2.0.0-alpha10'
    implementation 'com.qmuiteam:qmui:2.0.0-alpha10'

    // RecyclerAdapter框架
    implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.46'

    // OKGO网络协议封装框架
    implementation 'com.lzy.net:okgo:3.0.4'
    implementation 'com.google.code.gson:gson:2.8.0'

    // easyPermissions权限管理
    implementation 'pub.devrel:easypermissions:2.0.1'

    // butterKnife黄油刀
    implementation "com.jakewharton:butterknife:$rootProject.butterknife"
    annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.butterknife"

    // SuperTextView 属性控件
    implementation 'com.github.lygttpod:SuperTextView:2.1.8'

    // android-saripaar 基于规则的Android表单验证库
    implementation 'com.mobsandgeeks:android-saripaar:2.0.3'

    // litePal 数据库操作框架
    implementation 'org.litepal.android:java:3.0.0'

    // SmartShow Toast框架，解决不同机型弹出方式缺陷问题
    implementation 'com.github.the-pig-of-jungle.smart-show:toast:2.6.7'

    // debug调试app本地数据库
    debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'

    // log日志框架
    implementation 'com.orhanobut:logger:2.2.0'


    //leak 内存泄漏检测   
//    debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-alpha-3'

    //Modbus
    implementation 'com.github.licheedev:Modbus4Android:2.0.2'

    //下载进度条
    implementation 'com.github.Ccapton:Android-ColorfulProgressBar:1.0.5'

    //表格控件
    implementation 'com.github.huangyanbin:SmartTable:2.2.0'

    //轮播图
    implementation 'com.youth.banner:banner:1.4.10'

    //图片加载
    implementation 'com.github.bumptech.glide:glide:4.11.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'

    implementation 'com.yanzhenjie:permission:2.0.0-rc12'

    //滑动快
    implementation 'io.github.litao0621:nifty-slider:1.4.0'

    //阿里云文件上传
    implementation 'com.aliyun.dpa:oss-android-sdk:2.5.0'

    //轻量级sw
    implementation 'com.github.zcweng:switch-button:0.0.3@aar'

    //阿里云IOT
    implementation ('com.aliyun.alink.linksdk:lp-iot-linkkit:1.7.3.2')
    //MQTT
//    implementation files('libs\\org.eclipse.paho.android.service-1.1.1.jar')
//    implementation files('libs\\org.eclipse.paho.client.mqttv3-1.2.5.jar')

    //基类
    implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4'
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.6'
    implementation 'com.contrarywind:Android-PickerView:3.2.6'

    implementation 'com.github.xingshuangs:iot-communication:1.5.0'

    //日志工具  可定位代码行数
    api 'com.apkfuns.logutils:library:1.7.5'

    //腾讯bugly
    //sdk地址  https://bugly.qq.com/docs/user-guide/instruction-manual-android/?v=1.0.0
    implementation 'com.tencent.bugly:crashreport:latest.release' //其中latest.release指代最新Bugly SDK版本号，也可以指定明确的版本号，例如4.0.3

    api 'org.greenrobot:eventbus:3.1.1'

    api 'com.github.bumptech.glide:glide:4.16.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.16.0'
    api "com.github.bumptech.glide:okhttp3-integration:4.16.0"
    api 'pl.droidsonroids.gif:android-gif-drawable:1.2.19'
}
