Basic Script of Rabbit--gradle

Source: Internet
Author: User

<span style= "Font-size:18px;color: #ff0000;" > implemented: APK signature, multi-channel packaging, jar package dependencies, exchange of resources. </span>
<span style= "FONT-SIZE:18PX;" ></span>
<span style= "FONT-SIZE:18PX;" > </span><pre name= "code" class= "Java" >buildscript {repositories {maven {URL ' Http://repo1.mav En.org/maven2 '}} dependencies {classpath ' com.android.tools.build:gradle:0.4 '}}apply plugin: ' Android ' dependencies {//Single file dependent, cannot depend on single file at the same time, has dependent folder//compile files (' Libs/android-support-v4.jar ')//Dependent folder under. Jar Compil  E Filetree (dir: ' Libs ', include: ' *.jar ')}android {compilesdkversion buildtoolsversion "17.0.0" Defaultconfig {minsdkversion targetsdkversion 16}//apk signature Signingconfigs {release {Storefi        Le file ("Src/key.keystore") Storepassword "123456" Keyalias "Wang" Keypassword "123456"     } buildtypes {release {Signingconfig signingconfigs.release}} }//code obfuscation Buildtypes {//release {//debuggable false//JnidebugBuild true//signingconfig signingconfigs.myconfig//} release {Runproguard t Rue Proguardfile getdefaultproguardfile (' Proguard-android.txt ')}}//; Tasks.withtype (Compil E) {options.encoding = "UTF-8"}//multi-channel packaging, sometimes with Chinese comments will be error//manifest need to add the following code://<meta-data Andro Id:name= "channel" Android:value= "${channelname}"/> Productflavors {yingyongbao {packagename "        Com.example.flavor1 "Versioncode manifestplaceholders = [channelname:" Yingyongbao "]}  Umeng {manifestplaceholders = [channelname: "Umeng"]} Pea pod {manifestplaceholders = [ChannelName: "Pea pod"]}}/** * Configure multi-Channel version information */sourcesets {umeng {Java.srcdir s = [' Src/main/java ', ' src/umeng/java '] res.srcdirs = [' Src/mainn/res ', ' src/umeng/res '] assets.srcd IRS = [' Src/main/assets ', ' Src/umeng/assets '}}} 

Basic Script of Rabbit--gradle

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.