test:: #check-keys
	xmllint editor.xml --xinclude --noout --schema categories.xsd
	./testxsl.sh

#TANKER_BRANCH = master
#KEYSET_PREFIX = blocks:mp:common:mp-i18n_keyset_
TANKER_BRANCH = master
KEYSET_PREFIX =

check-keys:
	@echo Retriving label-keys from xmls
	@grep -n -o -P '(?<=\<label\>).*(?=</label\>)' *xml > genfiles/tanker-keys.lst
	@grep -n -o -P '(?<=label=").[^"]+(?=")' *xml >> genfiles/tanker-keys.lst
	@echo Found `wc -l genfiles/tanker-keys.lst | awk '{print $$1;}'` keys
	@echo Downloading keysets from tanker branch [${TANKER_BRANCH}]
	@curl -s "http://tanker-api.tools.yandex.net:3000/projects/export/xml/?project-id=mpro&branch-id="${TANKER_BRANCH} > genfiles/tanker.xml
	@echo Cheking with keyset prefix [${KEYSET_PREFIX}]
	@./check_keys.py genfiles/tanker-keys.lst genfiles/tanker.xml ${KEYSET_PREFIX}

