Skip to content
Snippets Groups Projects
Commit 308ae33a authored by Janak Amarasena's avatar Janak Amarasena
Browse files

Added custom app name validation

parent b28c9a88
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment