From caed317a12928855f3fe8f9fb4380a6d4d947dc7 Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Mon, 2 Jan 2017 09:34:17 +0100
Subject: [PATCH] add xml formatting script

---
 makefile  | 2 ++
 xmlFormat | 8 ++++++++
 2 files changed, 10 insertions(+)
 create mode 100755 xmlFormat

diff --git a/makefile b/makefile
index 7076fe8582..4fef7f1c75 100644
--- a/makefile
+++ b/makefile
@@ -113,6 +113,7 @@ debug build-debug:
 	    cp $$dir/bin-debug/* $(addsuffix -debug, $(BINFOLDER)); \
 	done
 	cp translateAddresses $(addsuffix -debug, $(BINFOLDER)); \
+	cp xmlFormat $(addsuffix -debug, $(BINFOLDER)); \
 	if [ "$@" == "debug" ] && [ $(RUN_TESTS) -eq 1 ]; then for test in $(wildcard tests.*.sh); do \
 		./$$test debug $(JOBS); \
 	done; fi
@@ -140,6 +141,7 @@ release build-release:
 	    cp $$dir/bin-release/* $(addsuffix -release, $(BINFOLDER)); \
 	done
 	cp translateAddresses $(addsuffix -release, $(BINFOLDER)); \
+	cp xmlFormat $(addsuffix -release, $(BINFOLDER)); \
 	if [ "$@" == "release" ] && [ $(RUN_TESTS) -eq 1 ]; then for test in $(wildcard tests.*.sh); do \
 		./$$test release $(JOBS); \
 	done; fi
diff --git a/xmlFormat b/xmlFormat
new file mode 100755
index 0000000000..7c506e6fa3
--- /dev/null
+++ b/xmlFormat
@@ -0,0 +1,8 @@
+#! /bin/bash
+
+TMPFILE=$(mktemp)
+for i in "$@"
+do
+	cp "$i" "$TMPFILE"
+	xmllint --format "$TMPFILE" > "$i"
+done
-- 
GitLab