summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJanak Amarasena <janakamarasena@gmail.com>2018-06-18 00:33:53 +0530
committerJanak Amarasena <janakamarasena@gmail.com>2018-06-23 09:33:02 +0530
commit797e3e5c4050d4d9ade13453c966f5132ced9bae (patch)
tree9e2d47ffe57b5e67ac6042a51078195cb70abaf2 /app
parent3964908ff4fc7929da8ca436586280e7f49a98a6 (diff)
Added custom package id validation
Diffstat (limited to 'app')
-rw-r--r--app/build.gradle15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/build.gradle b/app/build.gradle
index d2255f42..52ea901b 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,3 +1,4 @@
+import java.util.concurrent.ExecutionException
import java.util.regex.Matcher
import java.util.regex.Pattern
@@ -366,3 +367,17 @@ def getCurrentFlavorForBetaOrRelease() {
return "";
}
}
+
+task checkApplicationIdForCustomFlavor (type: Exec ) {
+ def currFlavor = getCurrentFlavorForBetaOrRelease()
+ if(currFlavor.contains("custom")) {
+ android.applicationVariants.all { variant ->
+ def mergedFlavor = variant.mergedFlavor
+ if (variant.flavorName.toString().equalsIgnoreCase(currFlavor)) {
+ if (mergedFlavor.getApplicationId().equalsIgnoreCase("org.sample.custom")) {
+ throw new ExecutionException("ERROR: please change the applicationId(org.sample.custom) if you want to build a custom branded app!")
+ }
+ }
+ }
+ }
+}