Android多渠道打包
来源:互联网 发布:软件开发需求调研 编辑:程序博客网 时间:2024/06/14 05:36
apply plugin: 'com.android.application'repositories { jcenter()}android { compileSdkVersion 19 buildToolsVersion "21.1.1" defaultConfig { minSdkVersion 9 targetSdkVersion 19 versionCode 1 versionName "1.0" // 修改dex 65536的限制 multiDexEnabled true // AndroidManifest.xml文件中UMENG_CHANNEL的value为${UMENG_CHANNEL_VALUE} manifestPlaceholders = [UMENG_CHANNEL_VALUE: "channel_name"] } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } // 签名文件 signingConfigs { debug { // debug签名 storeFile file("/path/xx-debug.jks") storePassword "密码" keyAlias "别名" keyPassword "签名密钥的密码" } release { // relase签名 storeFile file("/path/xx-release.jks") storePassword "密码" keyAlias "别名" keyPassword "签名密钥的密码" } } // 构建类型 buildTypes { debug { // debug模式下,显示log buildConfigField("boolean", "LOG_DEBUG", "true") // 版本名前缀 versionNameSuffix "-debug" // 不开启混淆 minifyEnabled false // 不开启ZipAlign优化 zipAlignEnabled false // 不移除无用的resource文件 shrinkResources false // 使用debug签名 signingConfig signingConfigs.debug } release { // release模式下,不显示log buildConfigField("boolean", "LOG_DEBUG", "false") // 版本名前缀 versionNameSuffix "-relase" // 开启混淆 minifyEnabled true // 开启ZipAlign优化 zipAlignEnabled true // 移除无用的resource文件 shrinkResources true // 使用release签名 signingConfig signingConfigs.release // 混淆文件位置 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } // 渠道Flavors,配置不同的渠道 productFlavors { GooglePaly {} xiaomi {} umeng {} _360 {} wandoujia {} yingyongbao {} whatever {} } // 批量配置渠道 productFlavors.all { flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name] } applicationVariants.all { variant -> variant.outputs.each { output -> def outputFile = output.outputFile if (outputFile != null && outputFile.name.endsWith('.apk')) { def fileName = outputFile.name.replace(".apk", "-${defaultConfig.versionName}.apk") output.outputFile = new File(outputFile.parent, fileName) } } }}dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:19.+'}
0 0
- Android多渠道打包(一):基础多渠道打包
- Android多渠道打包(四):360多渠道打包
- Android多渠道打包(五):360多渠道打包+
- android 多渠道自动打包
- android apk多渠道打包
- Android多渠道打包APK
- android 多渠道打包
- Android 多渠道自动打包
- android应用多渠道打包
- Android Ant 多渠道打包
- Android多渠道Ant打包
- android多渠道打包
- Android多渠道打包工具
- android ant 多渠道打包
- Android studio 多渠道打包
- Android Studio多渠道打包
- Android studio 多渠道打包
- android Gradle多渠道打包
- hibernate中主键的类型笔记
- 十大编程算法助程序员走上高手之路
- c++ deque 双向队列学习
- redis相关
- 两个人的生活
- Android多渠道打包
- 蓝懿ios技术交流和心得分享12.15
- JSON 中JsonConfig的使用
- 客户端服务端url中文乱码解决
- android-OpenGL ES
- 第一次写博客
- 重新开始写博客
- GPU---并行计算利器
- 打怪路线专用