博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
gradle打包分编译环境
阅读量:6242 次
发布时间:2019-06-22

本文共 3821 字,大约阅读时间需要 12 分钟。

gradle打包分测试、开发、生产环境

buildTypes {    debug {        signingConfig signingConfigs.myConfig        buildConfigField("boolean", "isDebug", "true")    }    release {        signingConfig signingConfigs.myConfig//不要忘了要在release的时候加入我么的签名配置信息        minifyEnabled true        buildConfigField("boolean", "isDebug", "false")        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'    }}//创建两个维度的 flavorflavorDimensions "channel", "server"productFlavors {    xuehu { dimension "channel" }//        yybao { dimension "channel" }//        wandoujia {}//        baidu {}//        c360 {}//        uc {}//        xiaomi {}//        lenovo {}//        samsung {}//        dev10086 {}//        open189 {}//        wo {}//        huawei {}//        oppo {}//        vivo {}//        flyme {}//        gionee {}    dev {        dimension "server"        buildConfigField("String", "APP_URL", '"https://dev.app.xuehu365.com/"')        buildConfigField("String", "WAP_URL", '"https:/m.dev.app.xuehu365.com/"')        buildConfigField("String", "H5_URL", '"https://dev.s.xuehu365.com/"')        buildConfigField("boolean", "isEncode", "false")        buildConfigField("boolean", "isOpenUmeng", "false")        buildConfigField("String", "APPId", '"test"')        buildConfigField("String", "JPushAlias", '"dev_"')        buildConfigField("String", "JPushTags", '"dev"')        android.applicationVariants.all { variant ->            variant.outputs.each { output ->                def file = output.outputFile                output.outputFile = new File(file.parent, file.name.replace(file.name,                        variant.productFlavors[0].name + "_" +                                variant.versionName                                + "_dev.apk"))            }        }    }    detect {        dimension "server"        buildConfigField("String", "APP_URL", '"https://test-app.xuehu365.com/"')        buildConfigField("String", "WAP_URL", '"https://test-m.xuehu365.com/"')        buildConfigField("String", "H5_URL", '"https://test-s.xuehu365.com/"')        buildConfigField("boolean", "isEncode", "false")        buildConfigField("boolean", "isOpenUmeng", "false")        buildConfigField("String", "APPId", '"test"')        buildConfigField("String", "JPushAlias", '"test_"')        buildConfigField("String", "JPushTags", '"test"')        android.applicationVariants.all { variant ->            variant.outputs.each { output ->                def file = output.outputFile                output.outputFile = new File(file.parent, file.name.replace(file.name,                        variant.productFlavors[0].name + "_" +                                variant.versionName                                + "_test.apk"))            }        }    }    prod {        dimension "server"        buildConfigField("String", "APP_URL", '"https://app.xuehu365.com/"')        buildConfigField("String", "WAP_URL", '"https://m.xuehu365.com/"')        buildConfigField("String", "H5_URL", '"https://s.xuehu365.com/"')        buildConfigField("boolean", "isEncode", "true")        buildConfigField("boolean", "isOpenUmeng", "true")        buildConfigField("String", "APPId", '"xuehu"')        buildConfigField("String", "JPushAlias", '""')        buildConfigField("String", "JPushTags", '"prd"')        android.applicationVariants.all { variant ->            variant.outputs.each { output ->                def file = output.outputFile                output.outputFile = new File(file.parent, file.name.replace(file.name,                        variant.productFlavors[0].name + "_" +                                variant.versionName                                + "_prod.apk"))            }        }    }    productFlavors.all {        flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]    }}

 

转载地址:http://jhsia.baihongyu.com/

你可能感兴趣的文章
Java 内部类种类及使用解析
查看>>
Axure产品原型设计工具
查看>>
spice在桌面虚拟化中的应用系列之三(USB映射实现,SSL加密,密码认证,多客户端支持)...
查看>>
Loading project 91606170 of 1: Project FooBar 问题如何解决?
查看>>
C# yeild使用
查看>>
MapReduce-Hadoop分布式计算模型
查看>>
StrokePlus
查看>>
joisino's travel
查看>>
组合游戏-博弈论中经典模型题目
查看>>
浅谈HTTP的GET和POST
查看>>
点灯笼
查看>>
try{}catch{}
查看>>
[Aaronyang] 写给自己的WPF4.5 笔记11[自定义控件-AyImageButton的过程 1/4]
查看>>
Linux VMware新添加网络适配器找不到配置文件问题
查看>>
Javascript百学不厌 - this
查看>>
机器学习中的数学(1)-回归(regression)、梯度下降(gradient descent)
查看>>
实用算法实现-第 14 篇 启发式搜索
查看>>
c#常用的排序算法
查看>>
论文阅读——Visual inertial odometry using coupled nonlinear optimization
查看>>
Office插件编程[转]
查看>>