From 50e2ba6d8355c58b681c5e8efb8ebf668ad9937c Mon Sep 17 00:00:00 2001 From: nomisto Date: Fri, 5 May 2017 20:56:32 +0200 Subject: [PATCH] Doesn't set up flavours for each custom app if the custom app directory doesnt exist. --- app/build.gradle | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e672c1c38..766744db2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -116,13 +116,15 @@ if (project.hasProperty('customDir')) { } // Set up flavours for each custom app in the directory -custom.eachFile() { file -> +if(custom.listFiles()) { + custom.eachFile() { file -> - def fileName = file.getName() - if (fileName.contains("test") || fileName == "main" || fileName.contains("Test")) { - return + def fileName = file.getName() + if (fileName.contains("test") || fileName == "main" || fileName.contains("Test")) { + return + } + map.put(fileName, file.getAbsolutePath()) } - map.put(fileName, file.getAbsolutePath()) } android {