as-build.gradle

来源:互联网 发布:淘宝店铺账小号 编辑:程序博客网 时间:2024/05/17 17:44
apply plugin: 'com.android.application'//apply plugin: 'bugly'android {    compileSdkVersion 22    buildToolsVersion "23.0.1"    defaultConfig {        applicationId "com.tencent.avsdk"        minSdkVersion 8        targetSdkVersion 22        versionCode = 1        versionName = "v1.0"    }    signingConfigs {        release {            storeFile file("../build/target/product/security/testAndroidKey")            storePassword "1234"            keyAlias "aaa"            keyPassword "1234"        }    }    buildTypes {        release {            minifyEnabled true            //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'            proguardFiles 'proguard-rules.txt'            signingConfig signingConfigs.release        }    }    lintOptions {        abortOnError false    }    productFlavors {        dev {            manifestPlaceholders = [UMENG_CHANNEL_VALUE: "dev"]        }        wandoujia {            manifestPlaceholders = [UMENG_CHANNEL_VALUE: "wandoujia"]        }        xiaomi {            manifestPlaceholders = [UMENG_CHANNEL_VALUE: "xiaomi"]        }        "360" {            manifestPlaceholders = [UMENG_CHANNEL_VALUE: "360"]        }        /**         * //manifest:<meta-data android:name="UMENG_CHANNEL" android:value="${UMENG_CHANNEL_VALUE}" />         * 更简洁方案         productFlavors {             wandoujia {}             baidu {}             c360 {}             uc {}             productFlavors.all { flavor ->             flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]             }         }         * */    }    // rename the apk with the version name    // add output file sub folder by build type    applicationVariants.all { variant ->        variant.outputs.each { output ->            output.outputFile = new File(                    output.outputFile.parent + "/${variant.buildType.name}",                    "rx-${variant.buildType.name}-${variant.versionName}-${variant.productFlavors[0].name}.apk".toLowerCase())        }    }}dependencies {    //compile fileTree(dir: 'libs', include: ['*.jar'])    compile 'com.android.support:support-v4:22.1.1'    compile 'com.nineoldandroids:library:2.4.0'    compile files('libs/httpmime-4.1.1.jar')}
0 0