android gradle 多渠道打包

來源:互聯網
上載者:User

標籤:android   style   blog   http   color   io   os   ar   java   

buildscript {    repositories {        mavenCentral()    }    dependencies {        classpath ‘com.android.tools.build:gradle:0.7.+‘    }}apply plugin: ‘android‘ repositories {    mavenCentral()} dependencies {    compile fileTree(dir: ‘libs‘, include: ‘*.jar‘)} android {    compileSdkVersion 19    buildToolsVersion ‘19.0.0‘     defaultConfig {        minSdkVersion 9        targetSdkVersion 19    }     sourceSets {        main {            manifest.srcFile ‘AndroidManifest.xml‘            java.srcDirs = [‘src‘]            resources.srcDirs = [‘src‘]            aidl.srcDirs = [‘src‘]            renderscript.srcDirs = [‘src‘]            res.srcDirs = [‘res‘]            assets.srcDirs = [‘assets‘]        }         threesixo.setRoot(‘build-types/360‘)        anzhi.setRoot(‘build-types/AnzhiMarket‘)        baidu.setRoot(‘build-types/Baidu‘)        hiapk.setRoot(‘build-types/HiApk‘)        jifeng.setRoot(‘build-types/JiFeng‘)        playstore.setRoot(‘build-types/PlayStore‘)        tencent.setRoot(‘build-types/Tencent‘)        wandoujia.setRoot(‘build-types/WanDouJia‘)        xiaomi.setRoot(‘build-types/XiaoMi‘)         // Move the tests to tests/java, tests/res, etc...        instrumentTest.setRoot(‘tests‘)         // Move the build types to build-types/<type>        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...        // This moves them out of them default location under src/<type>/... which would        // conflict with src/ being used by the main source set.        // Adding new build types or product flavors should be accompanied        // by a similar customization.        debug.setRoot(‘build-types/debug‘)        release.setRoot(‘build-types/release‘)    }     signingConfigs {        MyConfig{            storeFile file("E:\\my.keystore")            storePassword "******"            keyAlias "myapp"            keyPassword "******"        }    }     buildTypes{        release {            signingConfig  signingConfigs.MyConfig        }    }     productFlavors {        threesixo {}        anzhi {}        baidu {}        hiapk {}        jifeng{}        playstore {}        tencent{}        wandoujia{}        xiaomi{}    }}

比如:build-types\360\AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"    package="com.mypackage">     <application >        <meta-data android:name="UMENG_CHANNEL" android:value="GooglePlay" />    </application></manifest>

 

android gradle 多渠道打包

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.