diff options
author | Janak Amarasena <janakamarasena@gmail.com> | 2018-06-18 01:16:47 +0530 |
---|---|---|
committer | Janak Amarasena <janakamarasena@gmail.com> | 2018-06-23 09:33:02 +0530 |
commit | 308ae33ab3298ae7cbe5837a6bf15ccd63e3be2c (patch) | |
tree | cb0b7052aa91ad884d390b6b0f479c5d38b584ae /app/build.gradle | |
parent | b28c9a884a0e0fd0af36e10c74d6554479b9b20b (diff) |
Added custom app name validation
Diffstat (limited to 'app/build.gradle')
-rw-r--r-- | app/build.gradle | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app/build.gradle b/app/build.gradle index 52ea901b..3eb948bb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,6 +3,7 @@ import java.util.regex.Matcher import java.util.regex.Pattern apply plugin: 'com.android.application' +def appName = '' android { compileSdkVersion 27 @@ -57,9 +58,10 @@ android { custom { dimension "mode" //Change the package name as needed - applicationId "org.sample.custom" + applicationId "org.sample.customs" //Set app name here - resValue "string", "app_name", "Bitmask Custom" + appName = "Custom" + resValue "string", "app_name", appName //Change the versionCode as needed versionCode 1 //Change the versionName as needed @@ -381,3 +383,12 @@ task checkApplicationIdForCustomFlavor (type: Exec ) { } } } + +task checkAppNameForCustomFlavor (type: Exec ) { + def currFlavor = getCurrentFlavorForBetaOrRelease() + if(currFlavor.contains("custom")) { + if (appName.equalsIgnoreCase("custom")) { + throw new ExecutionException("ERROR: please change the appName(Custom) if you want to build a custom branded app!") + } + } +}
\ No newline at end of file |