Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
build: obtain xbmc addon versions dynamically (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher authored Dec 30, 2023
1 parent 599626b commit c2f64c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ addon:
requires:
import:
- addon: "xbmc.python"
version: "3.0.1"
- addon: "script.module.kodi-six" # this is a dependency of youtube-dl, but we need to put it here for CI tests
- addon: "script.module.requests"
- addon: "script.module.youtube.dl"
9 changes: 4 additions & 5 deletions scripts/addon_yaml_to_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
import os

# lib imports
from kodi_addon_checker.check_dependencies import VERSION_ATTRB as xbmc_versions
from lxml import etree
import yaml

# constants
xbmc_python_version = '3.0.1' # todo: obtain this dynamically


def handle_asset_elements(
parent: etree.ElementBase,
Expand Down Expand Up @@ -37,8 +35,9 @@ def yaml_to_xml_lxml(yaml_file: str) -> str:
# if the version is specified in yaml, don't look it up
# this allows pinning a requirement to a specific version
continue
if requirement['addon'] == 'xbmc.python':
requirement['version'] = xbmc_python_version
if requirement['addon'].startswith('xbmc.'):
requirement['version'] = xbmc_versions[requirement['addon']][os.getenv(
'KODI_BRANCH', 'Nexus').lower()]['advised']
elif requirement['addon'].startswith('script.module.'):
requirement_xml = os.path.join(
os.getcwd(), 'third-party', 'repo-scripts', requirement['addon'], 'addon.xml')
Expand Down

0 comments on commit c2f64c7

Please sign in to comment.