summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-07-13 17:54:31 +0200
committercyBerta <cyberta@riseup.net>2019-07-13 17:54:31 +0200
commitdb2af80d1a08781e77c4c700e8540d349bc6a65a (patch)
tree10af89ae8a5f473f4fee3d400e7452a376c48ec9
parent73dd90352ea1e2f0a1aebcfd343a8db75a221fe9 (diff)
fix gradle build script for Beta releases regarding the app name
-rw-r--r--app/build.gradle21
1 files changed, 17 insertions, 4 deletions
diff --git a/app/build.gradle b/app/build.gradle
index e2a8d926..b76c426f 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -3,7 +3,6 @@ import java.util.regex.Matcher
import java.util.regex.Pattern
apply plugin: 'com.android.application'
-def appName = 'Bitmask'
android {
compileSdkVersion 28
@@ -20,7 +19,6 @@ android {
versionName "1.0.0RC1"
minSdkVersion 16
targetSdkVersion 27
- resValue "string", "app_name", appName
vectorDrawables.useSupportLibrary = true
buildConfigField 'boolean', 'openvpn3', 'false'
@@ -61,6 +59,9 @@ android {
flavorDimensions "branding", "implementation"
productFlavors {
+ productFlavors.all {
+ ext.appName = null;
+ }
production {
dimension "implementation"
}
@@ -69,6 +70,7 @@ android {
}
normal {
dimension "branding"
+ appName = "Bitmask"
}
@@ -83,7 +85,6 @@ android {
applicationId "se.leap.riseupvpn"
//Set app name here
appName = "Riseup VPN"
- resValue "string", "app_name", appName
//Provider base url, e.g. '"https://example.com"'
def customProviderUrl = '"https://riseup.net"'
buildConfigField "String", "customProviderUrl", customProviderUrl
@@ -113,6 +114,9 @@ android {
}
buildTypes {
+ buildTypes.all {
+ ext.appSuffix = ""
+ }
release {
//runProguard true
if(signingConfigs.contains(release))
@@ -121,7 +125,7 @@ android {
beta {
initWith release
applicationIdSuffix ".beta"
- resValue "string", "app_name", appName + " Beta"
+ appSuffix = " Beta"
}
debug {
testCoverageEnabled = true
@@ -195,6 +199,15 @@ dependencies {
implementation 'com.android.support:cardview-v7:28.0.0'
}
+android.applicationVariants.all { variant ->
+ def flavors = variant.productFlavors
+ // flavorDimensions "branding" -> 0, "implementation" -> 1
+ def branding = flavors[0]
+ def buildType = variant.buildType
+ variant.resValue "string", "app_name", "\"${branding.appName}${buildType.appSuffix}\""
+}
+
+
// Ensure the no-op dependency is always used in JVM tests.
configurations.all { config ->
if (config.name.contains('UnitTest')) {