• gradle打包分编译环境


    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'
        }
    }
    
    //创建两个维度的 flavor
    flavorDimensions "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]
        }
    }
  • 相关阅读:
    C#循环页面form中控件
    鼠标放到按钮上页面样式发生变化
    access INSERT INTO 语句的语法错误
    更改水晶报表数据源
    C# byte[]与string互转
    禁用右键
    showModalDialog IE9 报错
    ListBox 循环删除当前项
    showModalDialog 刷新本页面,不重新发送信息,则无法刷新网页,Page_PreRender
    敏捷模式开发(转)
  • 原文地址:https://www.cnblogs.com/anni-qianqian/p/7159330.html
Copyright © 2020-2023  润新知