Comment out xbmc.python in addon.xml

This commit is contained in:
Michaël Arnauts 2021-02-23 18:29:57 +01:00 committed by michaelarnauts
parent f688036559
commit a05d396897
5 changed files with 48 additions and 37 deletions

View File

@ -1,4 +1,4 @@
name: Kodi
name: Kodi Addon-Check
on:
# Run action when pushed to master, or for commits in a pull request.
push:
@ -19,9 +19,10 @@ jobs:
- name: Check out ${{ github.sha }} from repository ${{ github.repository }}
uses: actions/checkout@v2
- name: Run kodi-addon-checker
uses: xbmc/action-kodi-addon-checker@v1.2
with:
kodi-version: ${{ matrix.kodi-version }}
rewrite-for-matrix: ${{ matrix.kodi-version == 'matrix' }}
addon-id: ${{ github.event.repository.name }}
- name: Install dependencies
run: |
sudo apt-get install libxml2-utils
sudo python -m pip install kodi-addon-checker
- name: Run Addon Check for Kodi ${{matrix.kodi-version}}
run: make check-addon-${{matrix.kodi-version}}

View File

@ -12,11 +12,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt-get install libxml2-utils
- name: Build zip files
id: build
run: |
sudo apt-get install libxml2-utils
make multizip release=1
make build-all release=1
echo ::set-output name=leia-filename::$(cd ..;ls plugin.video.viervijfzes*.zip | grep -v '+matrix.' | head -1)
echo ::set-output name=matrix-filename::$(cd ..;ls plugin.video.viervijfzes*+matrix.*.zip | head -1)

1
.gitignore vendored
View File

@ -18,3 +18,4 @@ tests/home/userdata/addon_data
Pipfile
Pipfile.lock
dist/

View File

@ -1,25 +1,21 @@
export KODI_HOME := $(CURDIR)/tests/home
export KODI_INTERACTIVE := 0
PYTHON := python
KODI_PYTHON_ABIS := 3.0.0 2.26.0
# Collect information to build as sensible package name
name = $(shell xmllint --xpath 'string(/addon/@id)' addon.xml)
version = $(shell xmllint --xpath 'string(/addon/@version)' addon.xml)
git_branch = $(shell git rev-parse --abbrev-ref HEAD)
git_hash = $(shell git rev-parse --short HEAD)
ifdef release
zip_name = $(name)-$(version).zip
else
git_branch = $(shell git rev-parse --abbrev-ref HEAD)
git_hash = $(shell git rev-parse --short HEAD)
zip_name = $(name)-$(version)-$(git_branch)-$(git_hash).zip
endif
zip_dir = $(name)/
languages = $(filter-out en_gb, $(patsubst resources/language/resource.language.%, %, $(wildcard resources/language/*)))
all: check test build
zip: build
multizip: build-all
check: check-pylint check-translations
@ -29,17 +25,20 @@ check-pylint:
check-translations:
@printf ">>> Running translation checks\n"
@$(foreach lang,$(languages), \
@$(foreach lang,$(filter-out en_gb, $(patsubst resources/language/resource.language.%, %, $(wildcard resources/language/*))), \
msgcmp resources/language/resource.language.$(lang)/strings.po resources/language/resource.language.en_gb/strings.po; \
)
@tests/check_for_unused_translations.py
check-addon: clean build
check-addon: check-addon-matrix
check-addon-leia:
@printf ">>> Running addon checks\n"
$(eval TMPDIR := $(shell mktemp -d))
@unzip ../${zip_name} -d ${TMPDIR}
cd ${TMPDIR} && kodi-addon-checker --branch=leia
@rm -rf ${TMPDIR}
@make -s build-leia && cd dist/ && kodi-addon-checker --branch=leia
check-addon-matrix:
@printf ">>> Running addon checks\n"
@make -s build-matrix && cd dist/ && kodi-addon-checker --branch=matrix
codefix:
@isort -l 160 resources/
@ -56,12 +55,29 @@ clean:
@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 package\n"
@rm -f ../$(zip_name)
@git archive --format zip --worktree-attributes -v -o ../$(zip_name) --prefix $(zip_dir) $(or $(shell git stash create), HEAD)
@printf ">>> Successfully wrote package as: ../$(zip_name)\n"
build: build-matrix
build-all: build-leia build-matrix
build-leia: clean
$(eval abi=2.26.0)
@rm -rf dist/ && mkdir dist/
@git archive --format tar --worktree-attributes --prefix $(name)/ $(or $(shell git stash create), HEAD) | (cd dist/ && tar -xf -)
@sed -i -E "s/(<!--)?(\s*<import addon=\"xbmc\.python\" version=\")[0-9\.]*(\"\/>)(\s*-->)?/\2$(abi)\3/" dist/$(name)/addon.xml
@cd dist && zip --quiet -9 -r ../../$(zip_name) $(name)
@printf ">>> Successfully wrote package for Kodi 18 as ../$(zip_name)\n"
build-matrix: clean
$(eval abi=3.0.0)
$(eval version=$(version)+matrix.1)
@rm -rf dist/ && mkdir dist/
@git archive --format tar --worktree-attributes --prefix $(name)/ $(or $(shell git stash create), HEAD) | (cd dist/ && tar -xf -)
@sed -i -E "s/(<!--)?(\s*<import addon=\"xbmc\.python\" version=\")[0-9\.]*(\"\/>)(\s*-->)?/\2$(abi)\3/" dist/$(name)/addon.xml
@printf "cd /addon/@version\nset $(version)\nsave\nbye\n" | xmllint --shell dist/$(name)/addon.xml > /dev/null
@cd dist && zip --quiet -9 -r ../../$(zip_name) $(name)
@printf ">>> Successfully wrote package for Kodi 19 as ../$(zip_name)\n"
# You first need to run sudo gem install github_changelog_generator for this
release:
@ -79,12 +95,3 @@ ifneq ($(release),)
else
@printf "Usage: make release release=1.0.0\n"
endif
multizip: clean
@-$(foreach abi,$(KODI_PYTHON_ABIS), \
printf "cd /addon/requires/import[@addon='xbmc.python']/@version\nset $(abi)\nsave\nbye\n" | xmllint --shell addon.xml; \
matrix=$(findstring $(abi), $(word 1,$(KODI_PYTHON_ABIS))); \
if [ $$matrix ]; then version=$(version)+matrix.1; else version=$(version); fi; \
printf "cd /addon/@version\nset $$version\nsave\nbye\n" | xmllint --shell addon.xml; \
make build; \
)

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.viervijfzes" name="GoPlay" version="0.4.2" provider-name="Michaël Arnauts">
<requires>
<import addon="xbmc.python" version="2.26.0"/>
<!--<import addon="xbmc.python" version="3.0.0"/>-->
<import addon="script.module.dateutil" version="2.6.0"/>
<import addon="script.module.inputstreamhelper" version="0.5.1"/>
<import addon="script.module.pysocks" version="1.6.8" optional="true"/>