From e1e0244acf5ce168e5db9fcd764f80994e5d4019 Mon Sep 17 00:00:00 2001 From: Dominik Dzienia Date: Thu, 24 Sep 2020 23:27:02 +0200 Subject: [PATCH] Ignore changes to codeStyles and stray files while ensuring build from master has no uncommited changes --- app/build.gradle | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index bdc9462fbe..61dae24ba6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -103,13 +103,15 @@ def allCommited = { -> commandLine 'git', 'status', '-s' standardOutput = stdout } - String commitObject = stdout.toString().trim() - stringBuilder.append(commitObject) + // ignore all changes done in .idea/codeStyles + String cleanedList = stdout.toString().replaceAll(/(?m)^\s*(M|A|D|\?\?)\s*.*?\.idea\/codeStyles\/.*?\s*$/, "") + // ignore all files added to project dir but not staged/known to GIT + cleanedList = cleanedList.replaceAll(/(?m)^\s*(\?\?)\s*.*?\s*$/, "") + stringBuilder.append(cleanedList.trim()) } catch (ignored) { return false // NoGitSystemAvailable } return stringBuilder.toString().isEmpty() - } tasks.matching { it instanceof Test }.all {