2020-07-09 10:16:45 +02:00
|
|
|
export KODI_HOME := $(CURDIR)/tests/home
|
|
|
|
export KODI_INTERACTIVE := 0
|
2020-03-25 08:08:15 +01:00
|
|
|
PYTHON := python
|
2020-03-19 16:45:31 +01:00
|
|
|
|
2020-03-25 08:08:15 +01:00
|
|
|
languages = $(filter-out en_gb, $(patsubst resources/language/resource.language.%, %, $(wildcard resources/language/*)))
|
|
|
|
|
2020-03-19 16:45:31 +01:00
|
|
|
all: check test build
|
|
|
|
zip: build
|
2022-02-02 17:49:48 +01:00
|
|
|
multizip: build
|
2020-03-19 16:45:31 +01:00
|
|
|
|
2021-02-08 22:23:35 +01:00
|
|
|
check: check-pylint check-translations
|
2020-03-19 16:45:31 +01:00
|
|
|
|
|
|
|
check-pylint:
|
2021-02-01 08:54:07 +01:00
|
|
|
@printf ">>> Running pylint checks\n"
|
2020-04-01 12:42:04 +02:00
|
|
|
@$(PYTHON) -m pylint *.py resources/lib/ tests/
|
2020-03-19 16:45:31 +01:00
|
|
|
|
|
|
|
check-translations:
|
2021-02-01 08:54:07 +01:00
|
|
|
@printf ">>> Running translation checks\n"
|
2020-03-25 08:08:15 +01:00
|
|
|
@$(foreach lang,$(languages), \
|
2022-02-02 17:49:48 +01:00
|
|
|
msgcmp --use-untranslated resources/language/resource.language.$(lang)/strings.po resources/language/resource.language.en_gb/strings.po; \
|
2020-03-25 08:08:15 +01:00
|
|
|
)
|
2022-02-02 17:49:48 +01:00
|
|
|
@scripts/check_for_unused_translations.py
|
2020-03-19 16:45:31 +01:00
|
|
|
|
2022-02-02 17:49:48 +01:00
|
|
|
check-addon: build
|
2021-02-01 08:54:07 +01:00
|
|
|
@printf ">>> Running addon checks\n"
|
2020-03-19 16:45:31 +01:00
|
|
|
$(eval TMPDIR := $(shell mktemp -d))
|
2022-02-02 17:49:48 +01:00
|
|
|
@unzip dist/plugin.video.viervijfzes-*+matrix.1.zip -d ${TMPDIR}
|
|
|
|
cd ${TMPDIR} && kodi-addon-checker --branch=matrix
|
2020-03-19 16:45:31 +01:00
|
|
|
@rm -rf ${TMPDIR}
|
|
|
|
|
2020-10-26 10:25:57 +01:00
|
|
|
codefix:
|
|
|
|
@isort -l 160 resources/
|
|
|
|
|
2020-03-19 16:45:31 +01:00
|
|
|
test: test-unit
|
|
|
|
|
|
|
|
test-unit:
|
2021-02-01 08:54:07 +01:00
|
|
|
@printf ">>> Running unit tests\n"
|
2020-11-28 17:13:21 +01:00
|
|
|
@$(PYTHON) -m pytest tests
|
2020-03-19 16:45:31 +01:00
|
|
|
|
|
|
|
clean:
|
2021-02-01 08:54:07 +01:00
|
|
|
@printf ">>> Cleaning up\n"
|
2020-04-01 12:42:04 +02:00
|
|
|
@find . -name '*.py[cod]' -type f -delete
|
2020-03-19 16:45:31 +01:00
|
|
|
@find . -name '__pycache__' -type d -delete
|
2021-02-08 22:23:35 +01:00
|
|
|
@rm -rf .pytest_cache/ tests/cdm tests/userdata/temp
|
2020-03-19 16:45:31 +01:00
|
|
|
@rm -f *.log .coverage
|
2022-02-02 17:49:48 +01:00
|
|
|
@rm -rf dist/
|
2020-03-19 16:45:31 +01:00
|
|
|
|
|
|
|
build: clean
|
2022-02-02 17:49:48 +01:00
|
|
|
@printf ">>> Building add-on\n"
|
|
|
|
@scripts/build.py
|
|
|
|
@ls -lah dist/*.zip
|
2020-03-19 16:45:31 +01:00
|
|
|
|
2020-11-12 14:38:10 +01:00
|
|
|
release:
|
|
|
|
ifneq ($(release),)
|
2022-02-02 17:49:48 +01:00
|
|
|
docker run -it --rm --env CHANGELOG_GITHUB_TOKEN=$(GH_TOKEN) -v "$(shell pwd)":/usr/local/src/your-app githubchangeloggenerator/github-changelog-generator -u add-ons -p plugin.video.viervijfzes --no-issues --exclude-labels duplicate,question,invalid,wontfix,release,testing --future-release v$(release)
|
2020-11-12 14:38:10 +01:00
|
|
|
|
2021-02-01 08:54:07 +01:00
|
|
|
@printf "cd /addon/@version\nset $$release\nsave\nbye\n" | xmllint --shell addon.xml; \
|
2020-11-12 14:38:10 +01:00
|
|
|
date=$(shell date '+%Y-%m-%d'); \
|
2021-02-01 08:54:07 +01:00
|
|
|
printf "cd /addon/extension[@point='xbmc.addon.metadata']/news\nset v$$release ($$date)\nsave\nbye\n" | xmllint --shell addon.xml; \
|
2020-11-12 14:38:10 +01:00
|
|
|
|
|
|
|
# Next steps to release:
|
|
|
|
# - Modify the news-section of addons.xml
|
|
|
|
# - git add . && git commit -m "Prepare for v$(release)" && git push
|
|
|
|
# - git tag v$(release) && git push --tags
|
|
|
|
else
|
2021-02-01 08:54:07 +01:00
|
|
|
@printf "Usage: make release release=1.0.0\n"
|
2020-11-12 14:38:10 +01:00
|
|
|
endif
|
|
|
|
|
2022-02-02 17:49:48 +01:00
|
|
|
.PHONY: check codefix test clean build release
|