apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'org.greenrobot.greendao'

android {
    compileSdkVersion 31
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.casic.br"
        minSdkVersion 23
        targetSdkVersion 31
        versionCode 1
        versionName "1.0.0"

        ndk { abiFilters "armeabi", "armeabi-v7a", "arm64-v8" }
    }

    buildTypes {
        release {
            minifyEnabled 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'
    }

    kotlin {
        experimental {
            coroutines 'enable'
        }
    }

    applicationVariants.all { variant ->
        variant.outputs.all {
            outputFileName = defaultConfig.versionName + ".apk"
        }
    }

    greendao {
        schemaVersion 1//数据库版本号
        targetGenDir 'src/main/java'//设置DaoMaster、DaoSession、Dao目录
        daoPackage 'com.casic.br.greendao'//设置DaoMaster、DaoSession、Dao包名
    }

    packagingOptions {
        pickFirst 'lib/*/libc++_shared.so' // 多个 AAR（Android Library）文件中存在此 .so 文件，请选择第一个
    }
}

dependencies {
    //基础依赖库
    implementation files('libs/lite-release.aar')
    implementation 'androidx.core:core-ktx:1.8.0'
    implementation 'androidx.appcompat:appcompat:1.4.2'
    implementation 'com.google.android.material:material:1.6.1'
    //Google官方授权框架
    implementation 'pub.devrel:easypermissions:3.0.0'
    //沉浸式状态栏。基础依赖包，必须要依赖
    implementation 'com.geyifeng.immersionbar:immersionbar:3.2.2'
    //空白页
    implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
    implementation 'com.qmuiteam:arch:0.3.1'
    //MVVM+LiveData
    implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.1"
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.0"
    implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
    //Kotlin协程
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1'
    //图片加载框架
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    //图片选择框架
    implementation 'io.github.lucksiege:pictureselector:v3.0.4'
    //图片压缩
    implementation 'top.zibin:Luban:1.1.8'
    //返回值转换器
    implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'
    implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
    //okhttp3日志拦截器
    implementation 'com.squareup.okhttp3:logging-interceptor:4.6.0'
    //网络请求和接口封装
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.okhttp3:okhttp:4.9.0'
    //官方Json解析库
    implementation 'com.google.code.gson:gson:2.9.0'
    //上拉加载下拉刷新
    implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0'
    //ZBar(综合Java和C++扫码)，生成二维码
    implementation 'cn.bertsir.zbarLibary:zbarlibary:1.4.2'
    //数据库框架
    implementation 'org.greenrobot:greendao:3.3.0'
    //桌面角标
    implementation "me.leolin:ShortcutBadger:1.1.22@aar"
    //轮播图
    implementation 'io.github.youth5201314:banner:2.2.2'
    //SegmentTabLayout
    implementation 'io.github.h07000223:flycoTabLayout:3.0.0'
    // App SDK 最新稳定安卓版：
    implementation 'com.alibaba:fastjson:1.1.67.android'
    implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.14.9'
    implementation 'com.tuya.smart:tuyasmart:4.0.0'
}