Ant Bulk pack Android Umeng multichannel version

Source: Internet
Author: User

Prerequisite:
    1. Apache Ant
    2. Antcontrib
Specific steps:
  1. In? Add Meta-data tags in androidmanifest.xml:
    Android : Name  android: Value>
    </meta-data>
  2. Build Ant Build.xml

    Android update project?-p? [Project_path]

  3. Add the following configuration in the Ant.properties file

    Application.package=Com.sage.jiecai
    Ant.project.name=Jiecai
    java.encoding=Utf-8
    Proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
    Key.store=Sign/android.keystore
    Key.store.password=Storepassword
    Key.alias=Jiecai
    Key.alias.password=aliaspassword
    version=1.0
    Market_channels=51jiecai,360,qq,hiapk,baidu,91,wandoujia,xiaomi,10086


  4. Add the following code in the Build.xml

    file =" ant.properties " />

    <taskdefResource= "Net/sf/antcontrib/antcontrib.properties">

    <classpath>

    <pathelement Location= "/library/ant/lib/ant-contrib-1.0b3.jar"/>
    </classpath>
    </taskdef>

    <importfile= "${sdk.dir}/tools/ant/build.xml"/>
    <targetname= "Deploy">
    <foreachTarget= "Modify_manifest"List= "${market_channels}"param= "Channel"delimiter=",">
    </foreach>
    </target>

    <targetname= "Modify_manifest">
    <echomessage= "===========================${channel}========================="/>
    <replaceregexpFlags= "G"byline= "false">
    ?<!--matches is android:value= "* * * * *" android:name= "Umeng_channel"-
    ?<regexppattern= ' android:name= ' Umeng_channel "android:value=" (. *) "'/>
    ?<!--match and replace it with android:value= "channel name" Android:name= "Umeng_channel"-
    ?<substitutionexpression= ' android:name= ' Umeng_channel "android:value=" ${channel} "'/>
    ?<!--regular expressions require matching files of Androidmanifest.xml--
    ?<filesetdir="" includes= "Androidmanifest.xml"/>
    </replaceregexp>
    <echomessage= "===========================${channel}========================="/>
    <propertyname= "Out.release.file" Location= "${out.absolute.dir}/${ant.project.name}_${channel}.apk"/>
    ?<!--Pack--
    ?<antcallTarget= "Release"/>
    ?<!--output channel package to bin/out directory--
    ?<copyToFile= "${out.absolute.dir}/out/${ant.project.name}_v${version}-${channel}.apk"
    ?file= "bin/${ant.project.name}-release.apk"/>

    <echomessage= "===========================end============================="/>
    </target>
?

Ant Bulk pack Android Umeng multichannel version

Related Article

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.