This repository has been archived by the owner on Oct 21, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
69 lines (54 loc) · 2.18 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
export KODI_HOME := $(CURDIR)/tests/home
export KODI_INTERACTIVE := 0
PYTHON := python
languages = $(filter-out en_gb, $(patsubst resources/language/resource.language.%, %, $(wildcard resources/language/*)))
all: check test build
zip: build
multizip: build
check: check-pylint check-translations
check-pylint:
@printf ">>> Running pylint checks\n"
@$(PYTHON) -m pylint *.py resources/lib/ tests/
check-translations:
@printf ">>> Running translation checks\n"
@$(foreach lang,$(languages), \
msgcmp --use-untranslated resources/language/resource.language.$(lang)/strings.po resources/language/resource.language.en_gb/strings.po; \
)
@scripts/check_for_unused_translations.py
check-addon: build
@printf ">>> Running addon checks\n"
$(eval TMPDIR := $(shell mktemp -d))
@unzip dist/plugin.video.viervijfzes-*+matrix.1.zip -d ${TMPDIR}
cd ${TMPDIR} && kodi-addon-checker --branch=matrix
@rm -rf ${TMPDIR}
codefix:
@isort -l 160 resources/
test: test-unit
test-unit:
@printf ">>> Running unit tests\n"
@$(PYTHON) -m pytest tests
clean:
@printf ">>> Cleaning up\n"
@find . -name '*.py[cod]' -type f -delete
@find . -name '__pycache__' -type d -delete
@rm -rf .pytest_cache/ tests/cdm tests/userdata/temp
@rm -f *.log .coverage
@rm -rf dist/
build: clean
@printf ">>> Building add-on\n"
@scripts/build.py
@ls -lah dist/*.zip
release:
ifneq ($(release),)
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)
@printf "cd /addon/@version\nset $$release\nsave\nbye\n" | xmllint --shell addon.xml; \
date=$(shell date '+%Y-%m-%d'); \
printf "cd /addon/extension[@point='xbmc.addon.metadata']/news\nset v$$release ($$date)\nsave\nbye\n" | xmllint --shell addon.xml; \
# 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
@printf "Usage: make release release=1.0.0\n"
endif
.PHONY: check codefix test clean build release