<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