apply plugin: 'com.android.application'

android {
    signingConfigs{
        config{
            keyAlias 'barcodescan'
            keyPassword 'liping123'
            storeFile file('D:/2018/BarCodeScan/barcodescan.jks')
            storePassword 'liping123'
        }
    }
    compileSdkVersion 26
    buildToolsVersion "27.0.3"
    defaultConfig {
        applicationId "cn.edu.xjau.barcodescan"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled true
            useProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

            signingConfig signingConfigs.config
            applicationVariants.all { variant ->
                variant.outputs.each { output ->
                    def date = new Date();
                    def formattedDate = date.format('yyyy-MM-dd')
                    output.outputFile = new File(output.outputFile.parent,
                            output.outputFile.name.replace("-release", "-" + formattedDate)
                    )
                }
            }

        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
    compile 'me.dm7.barcodescanner:zxing:1.9.2'
    testCompile 'junit:junit:4.12'
}
