apply plugin: 'com.android.application'

android {
    useLibrary 'org.apache.http.legacy'
    compileSdkVersion 28
    buildToolsVersion "29.0.3"
    defaultConfig {
        applicationId "cn.net.caoyao.cpzshandset"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
//        ndk {
//            abiFilters "armeabi", "armeabi-v7a"
////// 指定要ndk需要兼容的架构(这样其他依赖包里mips,x86,armeabi,arm-v8之类的so会被过滤掉)
//        }
    }
//    splits {
//        abi {
//            enable true
//            reset()
//            include 'x86', 'armeabi-v7a'
//            universalApk true
//        }
//    }
    signingConfigs {
        release {
            storeFile file('./zhongcaoyao.jks')
            // storeFile file('./liquidgas.jks')
            keyAlias "zhongcaoyao"
            keyPassword "zhongcaoyao2024"
            storePassword "zhongcaoyao2024"
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }

        debug {
            signingConfig signingConfigs.release
        }
        android.applicationVariants.all { variant ->
            variant.outputs.all {
                def fileName = "中草药_v${defaultConfig.versionName}_${variant.name}_${releaseTime()}.apk"
                outputFileName = fileName
            }
        }
    }
    lintOptions {
        checkReleaseBuilds false
        abortOnError false

    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
//        exclude 'META-INF/NOTICE'
//        exclude 'META-INF/LICENSE'
//        exclude 'META-INF/LICENSE.txt'
//        exclude 'META-INF/NOTICE.txt'
    }
}

//生成打包时间
static def releaseTime() {
    def date = new Date()
    def formattedDate = date.format('yyyy-MM-dd-HHmmss')
    return formattedDate
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support.constraint:constraint-layout:2.0.4'
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:appcompat-v7:26.0.0'
//    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation files('libs/scan.jar')
    implementation files('libs/core_3.0.1.jar')
    implementation files('libs/commons-jymf-label-4.0.jar')
    implementation files('libs/httpclient-4.5.13.jar')
    implementation files('libs/httpcore-4.4.13.jar')
    implementation 'com.github.ctiao:ndkbitmap-armv5:0.9.21'
    implementation 'com.github.ctiao:ndkbitmap-x86:0.9.21'
    implementation 'com.facebook.stetho:stetho:1.3.1'

    implementation 'com.android.support:design:28.0.0'


    //Retrofit所需要的依赖*****
    implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
    //retrofit2
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
    //rxjava
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.0.7'
    //network
    implementation 'com.google.code.gson:gson:2.7'
    implementation 'com.squareup.okhttp3:okhttp:3.6.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.6.0'
    //XRecyclerView
    implementation 'com.jcodecraeer:xrecyclerview:1.5.9'

//    implementation 'androidx.recyclerview:recyclerview:1.1.0'
}
