add ability to build a second variant. Works, but they can't both be

installed because of duplicate permissions.
This commit is contained in:
Eric House 2016-02-03 20:44:40 -08:00
parent 2cb989022c
commit 0684139183

View file

@ -4,6 +4,9 @@ def CHAT_ENABLED = true
def THUMBNAIL_ENABLED = true
def LIBS_DEBUG = 'libs-debug'
def LIBS_RELEASE = 'libs-release'
def VERSION_CODE_BASE = 1
def VARIANTS = [ "Xw4", "Xw4dbg" ]
def BUILDS = [ "Debug", "Release" ]
apply plugin: 'com.android.application'
@ -15,7 +18,6 @@ android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "org.eehouse.android.xw4"
minSdkVersion 7
targetSdkVersion 14
}
@ -23,29 +25,40 @@ android {
// Rename all output artifacts to include version information
// applicationVariants.all { variant ->
// renameArtifact(variant)
// variant.buildConfigField "String", "FIELD_NAME", "\"my String\""
// }
// flavorDimensions "variant", "abi"
// productFlavors {
// xw4 {
// dimension "variant"
// }
// xw4dbg {
// dimension "variant"
// }
// armeabiv7a {
// dimension "abi"
// }
flavorDimensions "variant"//, "abi"
productFlavors {
xw4 {
dimension "variant"
applicationId "org.eehouse.android.xw4"
}
xw4dbg {
dimension "variant"
applicationId "org.eehouse.android.xw4dbg"
}
// armeabi {
// dimension "abi"
// }
// x86 {
// dimension "abi"
// }
// WARNING: "all" breaks things. Seems to be a keyword. Need
// to figure out how to express include-all-abis
// all {
// dimension "abi"
// versionCode 0 + VERSION_CODE_BASE
// }
// armeabi {
// dimension "abi"
// versionCode 1 + VERSION_CODE_BASE
// }
// x86 {
// dimension "abi"
// versionCode 2 + VERSION_CODE_BASE
// }
// armeabiv7a {
// dimension "abi"
// versionCode 3 + VERSION_CODE_BASE
// }
// }
}
signingConfigs {
release {
@ -154,8 +167,12 @@ task mkXml(type: Exec) {
}
afterEvaluate {
compileReleaseNdk.dependsOn ndkBuildRelease
compileDebugNdk.dependsOn ndkBuildDebug
VARIANTS.each { VARIANT ->
String compileTask = "compile${VARIANT}ReleaseNdk"
tasks.getByName(compileTask).dependsOn ndkBuildRelease
compileTask = "compile${VARIANT}DebugNdk"
tasks.getByName(compileTask).dependsOn ndkBuildDebug
}
}
task askForPassword << {