Created
September 4, 2013 03:35
-
-
Save aelam/6432515 to your computer and use it in GitHub Desktop.
build.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.5.+' | |
} | |
} | |
apply plugin: 'android' | |
//设置文件编码 | |
tasks.withType(Compile) { | |
options.encoding = 'UTF-8' | |
} | |
dependencies { | |
compile "com.android.support:support-v4:18.0.+" | |
compile fileTree(dir: 'libs', include: '*.jar') | |
compile project(":Vendor:NineOldAndroids:Library") | |
compile project(":Vendor:Unionpay:upomp_Res_v1_1") | |
compile project(":Vendor:ViewPagerIndicator:Library") | |
compile project(":Vendor:SlidingMenu-library") | |
} | |
android { | |
compileSdkVersion 17 | |
buildToolsVersion "17" | |
sourceSets { | |
main { | |
manifest.srcFile 'AndroidManifest.xml' | |
java.srcDirs = ['src'] | |
resources.srcDirs = ['src'] | |
renderscript.srcDirs = ['src'] | |
res.srcDirs = ['res'] | |
assets.srcDirs = ['assets'] | |
} | |
} | |
signingConfigs { | |
OfficialSigningConfig { | |
storeFile file("hotelvp.keystore") | |
storePassword "mango123" | |
keyAlias "hotelvpandroidkey" | |
keyPassword "hotelvp" | |
} | |
} | |
buildTypes{ | |
release { | |
signingConfig signingConfigs.OfficialSigningConfig | |
runProguard true | |
proguardFile 'proguard-project.txt' | |
} | |
} | |
productFlavors { | |
def packName = "com.hotelvp.caoniu.app" | |
A42_91pay { packageName packName } | |
ABCD { packageName packName } | |
} | |
} | |
android.applicationVariants.all{ variant -> | |
variant.processManifest.doLast{ | |
copy{ | |
from("${buildDir}/manifests"){ | |
include "${variant.dirName}/AndroidManifest.xml" | |
} | |
into("${buildDir}/manifests/$variant.name") | |
def flavorName = "${variant.productFlavors.name}".substring(1, "${variant.productFlavors.name}".length() -1) | |
filter{ | |
//String line -> line.replaceAll("_channel_id_", "$variant.name") | |
// ${variant.productFlavors.name} = [91xx] | |
String line -> line.replaceAll("_channel_id_", flavorName) | |
} | |
variant.processResources.manifestFile = file("${buildDir}/manifests/${variant.name}/${variant.dirName}/AndroidManifest.xml") | |
println "${buildDir}/manifests/${variant.name}/${variant.dirName}/AndroidManifest.xml" | |
println "buildDir = ${buildDir}" | |
println "variant.name = ${variant.name}" | |
println "variant.dirName = ${variant.dirName}" | |
println "variant = $variant" | |
println "variant.packageApplication = ${variant.packageApplication}" | |
println "variant.productFlavors = ${variant.productFlavors}" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment