summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.circleci/config.yml12
1 files changed, 12 insertions, 0 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index b67f9677a..7fcbcaf2c 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -96,3 +96,15 @@ workflows:
- run:
name: SpotBugs
command: ./gradlew spotbugsPlayDebug spotbugsDebug 2>&1 | grep -i "spotbugs"
+ - build:
+ name: XML
+ build-steps:
+ - run:
+ name: XML of changed files
+ command: |
+ git fetch origin develop
+ branchBaseCommit=`git merge-base origin/develop HEAD`
+ echo "Comparing to $branchBaseCommit"
+ curl -s -L https://github.com/ByteHamster/android-xml-formatter/releases/download/1.1.0/android-xml-formatter.jar > android-xml-formatter.jar
+ git diff --name-only $branchBaseCommit | { grep "res/layout/" || true; } | xargs java -jar android-xml-formatter.jar
+ test $(git diff | wc -l) -eq 0 || (echo -e "\n\n===== Found XML code style violations! See output below how to fix them. =====\n\n" && git --no-pager diff --color=always && false)