141 lines
4.2 KiB
Groovy
141 lines
4.2 KiB
Groovy
apply plugin: 'com.android.application'
|
|
|
|
android {
|
|
compileSdkVersion 25
|
|
buildToolsVersion '26.0.2'
|
|
flavorDimensions "HubOne"
|
|
|
|
String VERSION
|
|
|
|
lintOptions {
|
|
disable 'MissingTranslation'
|
|
abortOnError false
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId "com.voixtreme.voicepickingdemo"
|
|
minSdkVersion 19
|
|
targetSdkVersion 25
|
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
|
|
|
VERSION = "1.2"
|
|
}
|
|
|
|
def props = new Properties()
|
|
file("../../.keystore/hubone.properties").withInputStream {
|
|
stream -> props.load(stream)
|
|
}
|
|
|
|
signingConfigs {
|
|
dbg {
|
|
storeFile file(props['voixtreme.debug.keystore'])
|
|
storePassword props['voixtreme.debug.keystore.password']
|
|
keyAlias props['voixtreme.debug.alias']
|
|
keyPassword props['voixtreme.debug.alias.password']
|
|
}
|
|
|
|
full {
|
|
storeFile file(props['voixtreme.release.keystore'])
|
|
storePassword props['voixtreme.release.keystore.password']
|
|
keyAlias props['voixtreme.release.alias']
|
|
keyPassword props['voixtreme.release.alias.password']
|
|
}
|
|
}
|
|
|
|
productFlavors {
|
|
dbg {
|
|
dimension "HubOne"
|
|
signingConfig signingConfigs.dbg
|
|
versionCode 1
|
|
versionName VERSION + " (dbg)"
|
|
proguardFile 'proguard-dont-obfuscate.pro'
|
|
}
|
|
|
|
full {
|
|
dimension "HubOne"
|
|
signingConfig signingConfigs.full
|
|
versionCode 1
|
|
versionName VERSION
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt') \
|
|
, 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
debuggable true
|
|
minifyEnabled false
|
|
shrinkResources false
|
|
}
|
|
|
|
release {
|
|
debuggable false
|
|
minifyEnabled true
|
|
shrinkResources true
|
|
}
|
|
}
|
|
|
|
applicationVariants.all { variant ->
|
|
variant.outputs.all { output ->
|
|
def project = project.name
|
|
def SEP = "-"
|
|
def values = variant.versionName.split(" ");
|
|
def version = values[0]
|
|
|
|
def flavor = ""
|
|
if (variant.productFlavors[0] != null) {
|
|
flavor = SEP + variant.productFlavors[0].name
|
|
}
|
|
|
|
def date = new Date();
|
|
def formattedDate = SEP + date.format('yyyyMMdd')
|
|
|
|
def buildType = variant.variantData.variantConfiguration.buildType.name
|
|
if (buildType == "release") {
|
|
if (flavor == SEP + "dbg") {
|
|
buildType = ""
|
|
} else {
|
|
buildType = SEP + "rel"
|
|
}
|
|
} else {
|
|
buildType = SEP + "debug"
|
|
formattedDate = ""
|
|
}
|
|
|
|
def newApkName;
|
|
if (flavor == SEP + "full") {
|
|
if (formattedDate == "") {
|
|
newApkName = project + SEP + "full" + SEP + "debug" + SEP + "v" \
|
|
+ version + ".apk"
|
|
} else {
|
|
newApkName = project + SEP + "rel" + SEP + "v" + version + formattedDate \
|
|
+ ".apk"
|
|
}
|
|
} else {
|
|
if (flavor == SEP + "working") {
|
|
newApkName = project + SEP + "jima" + buildType + SEP + "v" \
|
|
+ version + formattedDate + ".apk"
|
|
} else {
|
|
newApkName = project + flavor + buildType + SEP \
|
|
+ "v" + version + formattedDate + ".apk"
|
|
}
|
|
}
|
|
|
|
output.outputFileName = new File(newApkName)
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
|
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
|
exclude group: 'com.android.support', module: 'support-annotations'
|
|
})
|
|
|
|
compile project(':library')
|
|
compile 'com.android.support:appcompat-v7:25.4.0'
|
|
compile 'com.android.support.constraint:constraint-layout:1.0.2'
|
|
compile 'com.google.code.gson:gson:2.8.0'
|
|
|
|
testCompile 'junit:junit:4.12'
|
|
}
|