Android Gradle multi-channel packaging

Source: Internet
Author: User

Buildscript {repositories {mavencentral ()} dependencies {classpath ' Com.android.tools.build:gra dle:0.7.+ '}}apply plugin: ' Android ' repositories {mavencentral ()} dependencies {compile Filetree (dir: ' Libs ', Include: ' *.jar ')} android {compilesdkversion buildtoolsversion ' 19.0.0 ' defaultconfig {Minsdkversio            N 9 Targetsdkversion} sourcesets {main {manifest.srcfile ' androidmanifest.xml ' Java.srcdirs = [' src '] resources.srcdirs = [' src '] aidl.srcdirs = [' src '] renderscr Ipt.srcdirs = [' src '] res.srcdirs = [' res '] assets.srcdirs = [' Assets ']} THREESIXO.S        Etroot (' 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/Play Store ') 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" Ke        Ypassword "******"}} buildtypes{release {Signingconfig signingconfigs.myconfig }} productflavors {threesixo {} Anzhi {} baidu {} hiapk {} jifeng{} pl Aystore {} tencent{} wandoujia{} xiaomi{ }}}

For example: Build-types\360\androidmanifest.xml

<?XML version= "1.0" encoding= "Utf-8"?><Manifestxmlns:android= "Http://schemas.android.com/apk/res/android" Package= "Com.mypackage">     <Application>        <Meta-dataAndroid:name= "Umeng_channel"Android:value= "GooglePlay" />    </Application></Manifest>

Android Gradle multi-channel packaging

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.