plugins {
    id 'com.android.application'
    id 'kotlin-android'
}

android {
    compileSdkVersion env.compileSdkVersion
    buildToolsVersion env.buildToolsVersion

    defaultConfig {
        applicationId env.applicationId
        minSdkVersion env.minSdkVersion
        targetSdkVersion env.targetSdkVersion
        versionCode env.versionCode
        versionName env.versionName

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        ndk {
            abiFilters "armeabi-v7a"/*, "arm64-v8a", "x86"*/
        }
    }
//    sourceSets {
//        main {
//            jniLibs.srcDirs = ['libs']
//        }
//    }
    signingConfigs {
        signing {
            keyAlias 'winds'
            keyPassword '039468'
            storeFile file('../config/winds.jks')
            storePassword '039468'
        }
    }

    buildTypes {
        debug {
            minifyEnabled false
            multiDexEnabled true
            signingConfig signingConfigs.signing
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        release {
            minifyEnabled false
            multiDexEnabled true
            signingConfig signingConfigs.signing
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility env.jdk_version
        targetCompatibility env.jdk_version
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    kotlin {
        experimental {
            coroutines 'enable'
        }
    }
    viewBinding {
        enabled = true
    }
    repositories {
        flatDir {
            dirs 'libs'
        }
    }
    applicationVariants.all { variant ->
//        variant.getPackageApplication().outputDirectory = new File("${rootDir.absolutePath}/Apk")
        variant.outputs.all {
            def buildType = variant.buildType.name
//            def buildTime = new Date().format("yyyyMMddHHmm", TimeZone.getDefault())
            outputFileName = "Chemical_Xibei.apk"
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation dep.kotlinStdlib
    implementation dep.androidxCoreKtx
    implementation dep.androidxAppCompat
    implementation dep.androidxConstraintlayout
    implementation dep.androidMaterial
    implementation dep.androidxLocalbroadcastmanager
    implementation dep.rxpermissions
    implementation dep.androidxSwipeRefreshLayout
    implementation dep.RecyclerViewAdapterHelper
    implementation dep.glide

    implementation dep.kotlinxCoroutinesCore
    implementation dep.kotlinxCoroutinesAndroid

    implementation dep.androidMultidex
    implementation dep.buglySDK
    implementation dep.buglyNDK
    implementation dep.mqttv3
    implementation dep.eventbus
    implementation dep.bgaZxing
    implementation dep.runtimektx
    implementation dep.livedataktx
    implementation files('libs\\sdkapi.jar')
    implementation project(':HttpCoreLibrary')
    implementation project(':RcCore')
    implementation project(':serialport')


    implementation 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'

    implementation 'com.github.mik3y:usb-serial-for-android:3.4.3'

    implementation 'cn.jzvd:jiaozivideoplayer:7.7.0'
//    implementation 'com.squareup.leakcanary:leakcanary-android:1.5.1'

    implementation(name: 'facedetector-1.0.0', ext: 'aar')
    implementation 'io.fotoapparat:fotoapparat:2.7.0'

    implementation(name: 'flowlayout-1.0.0', ext: 'aar')
    implementation 'com.vise.xiaoyaoyou:baseble:2.0.6'
//    implementation project(path: ':basiclibrary')
//    implementation project(path: ':bluetoothlibrary')
//    implementation files('libs\\whotherlib1.2.jar')
    implementation files('libs\\commons-codec-1.4.jar')
    implementation files('libs\\whdrawlabel1.1.jar')
    implementation(name: 'autoreplyprint', ext: 'aar')
    implementation 'com.github.Tobeyr1:DialogLoading:1.0.4'
    //AndroidX 版本
    implementation 'com.king.zxing:zxing-lite:1.1.7-androidx'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'

    implementation 'com.github.codbking:PickTime:v1.0.1'


}