summaryrefslogtreecommitdiff
path: root/app/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'app/build.gradle')
-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!")
+ }
+ }
+ }
+ }
+}