-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmakefile
105 lines (92 loc) · 3.44 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
.PHONY: all test clean docs clean-pyc clean-report clean-docs clean-coverage tag commit
.DEFAULT_GOAL := all
SPHINXBUILD = sphinx-build
SPHINXPROJ = pluginvideotelekomsport
BUILDDIR = ./_build
SOURCEDIR = ./resources/lib
TEST_DIR = ./resources/test
COVERAGE_FILE = ./.coverage
COVERAGE_DIR = ./coverage
REPORT_DIR = ./report
DOCS_DIR = ./docs
FLAKE_FILES = ./addon.py,./setup.py,./resources/lib/Constants.py,./resources/lib/Utils.py,./resources/lib/Settings.py,./resources/lib/Cache.py,./resources/lib/Session.py,./resources/lib/ItemHelper.py,./resources/lib/ContentLoader.py
RADON_FILES = resources/lib/*.py ./addon.py ./setup.py
LINT_REPORT_FILE = ./report/lint.html
TEST_OPTIONS = -s --cover-package=resources.lib.Cache --cover-package=resources.lib.Constants --cover-package=resources.lib.ContentLoader --cover-package=resources.lib.Dialogs --cover-package=resources.lib.ItemHelper --cover-package=resources.lib.Session --cover-package=resources.lib.Settings --cover-package=resources.lib.Utils --cover-erase --with-coverage --cover-branches
I18N_FILES = resources/language/**/*.po
JSON_FILES = package.json .kodi-release
all: clean lint test
clean: clean-pyc clean-report clean-docs clean-coverage
clean-pyc:
find . -name '*.pyc' -exec rm {} +
find . -name '*.pyo' -exec rm {} +
clean-report:
rm -rf $(REPORT_DIR)
mkdir $(REPORT_DIR)
clean-docs:
rm -rf $(BUILDDIR)
clean-coverage:
rm $(COVERAGE_FILE) || exit 0
rm -rf $(COVERAGE_DIR)
mkdir $(COVERAGE_DIR)
lint:
flake8 --filename=$(FLAKE_FILES)
pylint addon setup resources --ignore=test --output-format=html > $(LINT_REPORT_FILE)
radon cc $(RADON_FILES)
dennis-cmd lint $(I18N_FILES)
jsonlint $(JSON_FILES)
rst-lint docs/index.rst --level=severe
yamllint .travis.yml .codeclimate.yml
test:
nosetests $(TEST_DIR) $(TEST_OPTIONS) --cover-html --cover-html-dir=$(COVERAGE_DIR)
docs:
@$(SPHINXBUILD) $(DOCS_DIR) $(BUILDDIR) -T -c ./docs
commit:
npm run gcz
tag:
git config user.name "travis-ci"
git config user.email "[email protected]"
git remote rm origin
git remote add origin https://asciidisco:${GITHUB_TOKEN}@github.com/asciidisco/plugin.video.telekom-sport.git
git checkout master
git fetch --all --tags --prune --progress
git pull origin master
echo "Current version: ${CURRENT_VERSION}"
echo "Next version: ${NEXT_VERSION}"
echo "Latest changes:"
kodi-release -l
kodi-release -a -o ./Authors.md
kodi-release -c -o ./Changelog.md
kodi-release -u
git add -f ./Changelog.md
git add -f ./Authors.md
git add package.json
git add addon.xml
make docs
touch ./_build/.nojekyll
git commit -m "chore(version): Version bump [ci skip]"
git tag ${NEXT_VERSION}
git push origin master
git push --tags
git fetch --all --tags --prune --progress
help:
@echo " clean-pyc"
@echo " Remove python artifacts."
@echo " clean-report"
@echo " Remove coverage/lint report artifacts."
@echo " clean-docs"
@echo " Remove sphinx artifacts."
@echo " clean-coverage"
@echo " Remove code coverage artifacts."
@echo " clean"
@echo " Calls all clean tasks."
@echo " lint"
@echo " Check style with flake8, pylint & radon"
@echo " test"
@echo " Run unit tests"
@echo " docs"
@echo " Generate sphinx docs"
@echo " commit"
@echo " Commit stage changes using commitizen (needs Node)"
@echo " tag"
@echo " Builds an publishes a new release (Travis only)"