apply plugin: 'com.android.application'
repositories {
jcenter()
}
android {
compileSdkVersion 19
buildToolsVersion "21.1.1"
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
multiDexEnabled true
manifestPlaceholders = [UMENG_CHANNEL_VALUE: "channel_name"]
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
signingConfigs {
debug {
storeFile file("/path/xx-debug.jks")
storePassword "密码"
keyAlias "别名"
keyPassword "签名密钥的密码"
}
release {
storeFile file("/path/xx-release.jks")
storePassword "密码"
keyAlias "别名"
keyPassword "签名密钥的密码"
}
}
buildTypes {
debug {
buildConfigField("boolean", "LOG_DEBUG", "true")
versionNameSuffix "-debug"
minifyEnabled false
zipAlignEnabled false
shrinkResources false
signingConfig signingConfigs.debug
}
release {
buildConfigField("boolean", "LOG_DEBUG", "false")
versionNameSuffix "-relase"
minifyEnabled true
zipAlignEnabled true
shrinkResources true
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
GooglePaly {}
xiaomi {}
umeng {}
_360 {}
wandoujia {}
yingyongbao {}
whatever {}
}
productFlavors.all {
flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
}
applicationVariants.all {
variant ->
variant.outputs.each {
output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
def fileName = outputFile.name.replace(".apk", "-${defaultConfig.versionName}.apk")
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
}