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') }
as-build.gradle
最新推荐文章于 2022-12-27 13:46:50 发布