apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'

android {
    signingConfigs {
        release {
            storeFile file('../sign/intelhouse.jks')
            storePassword 'intelhousePSW'
            keyAlias = 'intelhousekey'
            keyPassword 'intelhousePSW'
        }
    }
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.mq.handhelddevice"
        minSdkVersion 15
//        targetSdkVersion 22
        targetSdkVersion 28
        versionCode 1

        versionName "3.0"

        ndk {
            abiFilters "armeabi"
        }
        signingConfig signingConfigs.release

    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled false
            // 指定混淆规则，需要压缩优化的混淆要把proguard-android.txt换成proguard-android.txt
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
    // Butterknife requires Java 8.
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }

    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }

    // 配置自定义打包名称
    android.applicationVariants.all { variant ->
        variant.outputs.all { output ->
            def outputFile = output.outputFile
            if (outputFile != null && outputFile.name.endsWith('release.apk')) {
                //打包名称 xxxx_yunnan_2.0_201911011522.apk
                def fileName = "汽车火车-值仓" +// 业务名称
                        "_" +
                        // 渠道
                        "${variant.productFlavors[0].name}" +
                        "_" +
                        // 版本号
                        "${defaultConfig.versionName}" +
                        "_" +
                        // 时间
                        "${new Date().format("yyyyMMddHHmm")}" +
                        // 后缀
                        ".apk"
                outputFileName = fileName
            }
        }
    }

    flavorDimensions "city"
    productFlavors {
        // 云南
        yunnan {
            dimension "city"
            manifestPlaceholders = [CHANNEL_ID_VALUE: "yunnan"]
        }
        // 山西
        shanxi {
            dimension "city"
            manifestPlaceholders = [CHANNEL_ID_VALUE: "shanxi"]
        }
        // 天津
        tianjin {
            dimension "city"
            manifestPlaceholders = [CHANNEL_ID_VALUE: "tianjin"]
        }

//        // 普洱
//        puer {
//            dimension "city"
//            manifestPlaceholders = [CHANNEL_ID_VALUE: "puer"]
//        }
    }

}

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


    implementation 'com.jakewharton:butterknife:9.0.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0'


}
