Hypatia/app/build.gradle

75 lines
2.7 KiB
Groovy
Raw Normal View History

2017-12-13 22:44:56 -05:00
apply plugin: 'com.android.application'
android {
compileSdkVersion 33
2017-12-13 22:44:56 -05:00
defaultConfig {
applicationId "org.maintainteam.hypatia"
resValue "string", "app_name", "Hypatia"
minSdkVersion 16
targetSdkVersion 32
versionCode 314
versionName "3.14"
resConfigs 'en', 'ar', 'bg', 'cs', 'de', 'es', 'et', 'fi', 'fr', 'gl', 'hr', 'in', 'it', 'ja', 'pt', 'pt-rBR', 'ro', 'ru', 'sk', 'ta', 'tr', 'uk', 'zh-rCN', 'zh-rTW'
// currently disabled locales due to insufficient translation: af, pl, el
2017-12-16 15:02:10 -05:00
}
2017-12-13 22:44:56 -05:00
buildTypes {
2017-12-16 15:09:34 -05:00
debug {
debuggable true
// suffix the app id and the app name with git branch name
def workingBranch = getGitWorkingBranch()
def normalizedWorkingBranch = workingBranch.replaceFirst("^[^A-Za-z]+", "").replaceAll("[^0-9A-Za-z]+", "")
if (normalizedWorkingBranch.isEmpty() || workingBranch == "master" || workingBranch == "dev" || workingBranch == "stable") {
// default values when branch name could not be determined or is master, dev or stable
applicationIdSuffix ".debug"
resValue "string", "app_name", "Hypatia Debug"
} else {
applicationIdSuffix ".debug." + normalizedWorkingBranch
resValue "string", "app_name", "Hypatia " + workingBranch
}
2017-12-16 15:09:34 -05:00
minifyEnabled true
2017-12-16 15:54:12 -05:00
zipAlignEnabled true
2017-12-16 15:09:34 -05:00
}
2017-12-13 22:44:56 -05:00
release {
2017-12-16 15:09:34 -05:00
shrinkResources true
minifyEnabled true
2017-12-16 15:54:12 -05:00
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2017-12-13 22:44:56 -05:00
}
}
lint {
abortOnError false
}
packagingOptions {
exclude 'org/bouncycastle/pqc/crypto/picnic/lowmcL1.bin.properties'
exclude 'org/bouncycastle/pqc/crypto/picnic/lowmcL3.bin.properties'
exclude 'org/bouncycastle/pqc/crypto/picnic/lowmcL5.bin.properties'
exclude 'org/bouncycastle/x509/CertPathReviewerMessages.properties'
exclude 'org/bouncycastle/x509/CertPathReviewerMessages_de.properties'
}
2017-12-13 22:44:56 -05:00
}
dependencies {
implementation 'commons-io:commons-io:2.5'
implementation 'org.bouncycastle:bcpg-jdk15to18:1.77'
implementation 'com.google.guava:guava:33.0.0-jre'
2018-06-03 13:49:37 -04:00
}
static String getGitWorkingBranch() {
try {
def gitProcess = "git rev-parse --abbrev-ref HEAD".execute()
gitProcess.waitFor()
if (gitProcess.exitValue() == 0) {
return gitProcess.text.trim()
} else {
// not a git repository
return ""
}
} catch (IOException ignored) {
// git was not found
return ""
}
}