From ef3753622244c55b246fb952868c3ea7aac4869a Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sun, 20 Jul 2014 20:58:29 -0700 Subject: Add XSD/indent checking --- Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..2a66f887 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +# for pipefail +SHELL=/bin/bash +.SECONDARY: +.DELETE_ON_ERROR: + +check: + git diff --exit-code + +XMLS = $(shell find -type f -name '*.xml') +check: check-xml +check-xml: $(patsubst %.xml,%.xml.ok,${XMLS}) + find -name '*.xml.ok' -delete + find -name '*.xml.out' -delete +%.xml.ok: %.xml %.xml.out + diff $^ + touch $@ +%.xml.out: %.xml + set -e -o pipefail; \ + xmllint --format --schema tools/tmw.xsd $< 2>&1 > $@ | grep -v 'Skipping import of schema' + +check: xsd +xsd: + xmllint --format --schema tools/dl/XMLSchema.xsd tools/tmw.xsd > tmw-formatted.xsd + diff tools/tmw.xsd tmw-formatted.xsd + rm tmw-formatted.xsd -- cgit v1.2.3-60-g2f50