Workaround to make addon compatible with both Leia and Matrix
#1
As most of you know by now, team kodi made the decision that addon.xml has to import xbmc.python 3.0.0 in order to be installable on Matrix, which makes it not compatible with Leia or prior versions. This forces most if not all addon maintainers to have to maintain 2 repos, one for Matrix and one for Leia and older, even if the addon itself is fully compatible with all versions (py2 and py3).

I'm on that boat where I maintain dozens of addons in an external repo (before anyone comments about the official kodi repo or banned addons, etc. I'd like to add that they are non piracy related docker addons that work with LibreELEC and thus have no business in the official kodi repo): https://github.com/linuxserver/libreelec-addon-repo

I got a little frustrated when I found out about this new requirement / breaking change. After some testing, I found a workaround.

The workaround:
I removed the following import line for xbmc.python completely from the addon.xml and it works just the same.
xml:
<import addon="xbmc.python" version="2.1.0"/>
Python code is executed properly, and the addon installs on both Leia and Matrix. I have not noticed any side effects (granted my addons use very simple python code). Tested with Milhouse builds (0414/15) on LibreELEC.

Keep in mind that kodi will likely not accept that workaround in PRs to the official repo, however, for any external repo maintainers, this is a huge deal.
Reply
#2
(2020-04-16, 19:20)aptalca Wrote: This forces most if not all addon maintainers to have to maintain 2 repos, one for Matrix and one for Leia and older, even if the addon itself is fully compatible with all versions (py2 and py3).

Only those who are not familiar with the concept of Continuous Integration/Continuous Deployment. All my active addons have the same codebase and are automatically submitted to both Kodi repo branches using CI/CD workflows and this script: https://github.com/romanvm/kodi-addon-submitter

Example with Travis CI: https://github.com/romanvm/service.addic...travis.yml I use Travis CI for most of my projects for historical reasons.
Example with GitHub actions: https://github.com/santah/next-episode-k...-addon.yml

All I need to do to submit my addon both to the main and to matrix branches is to create a Git tag and push it to the repo. Everything else is done automatically.
Reply
#3
(2020-04-16, 20:01)Roman_V_M Wrote: Only those who are not familiar with the concept of Continuous Integration/Continuous Deployment. All my active addons have the same codebase and are automatically submitted to both Kodi repo branches using CI/CD workflows and this script: https://github.com/romanvm/kodi-addon-submitter

Example with Travis CI: https://github.com/romanvm/service.addic...travis.yml I use Travis CI for most of my projects for historical reasons.
Example with GitHub actions: https://github.com/santah/next-episode-k...-addon.yml

All I need to do to submit my addon both to the main and to matrix branches is to create a Git tag and push it to the repo. Everything else is done automatically. 
I execute command on my local PC
Code:
submit-addon -z -m -s script.module.simplemedia
In result it's create two archives with the same addon.xml. Looks like git archive ignore all not commited changes
My addons: Gismeteo
Reply
#4
(2020-04-19, 13:02)vl_maksime Wrote: In result it's create two archives with the same addon.xml. Looks like git archive ignore all not commited changes

Honestly, I haven't tested it locally but it works fine in CI environments for all my addons.
Reply

Logout Mark Read Team Forum Stats Members Help
Workaround to make addon compatible with both Leia and Matrix0