Skip to content

Commit

Permalink
[addons][tools] add helper as ADDON_GLOBAL_TOOLS to versions.h
Browse files Browse the repository at this point in the history
This to allow versions check about, before was them not included in
check where makes it dangerous by changes.
  • Loading branch information
AlwinEsch committed May 20, 2020
1 parent aa80d4e commit b525f09
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ cmake_install.cmake
/addons/kodi.binary.global.gui/addon.xml
/addons/kodi.binary.global.main/addon.xml
/addons/kodi.binary.global.network/addon.xml
/addons/kodi.binary.global.tools/addon.xml
/addons/kodi.binary.instance.audiodecoder/addon.xml
/addons/kodi.binary.instance.audioencoder/addon.xml
/addons/kodi.binary.instance.game/addon.xml
Expand Down
7 changes: 7 additions & 0 deletions addons/kodi.binary.global.tools/addon.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<addon id="kodi.binary.global.tools" version="@ADDON_GLOBAL_VERSION_TOOLS@" provider-name="Team Kodi">
<backwards-compatibility abi="@ADDON_GLOBAL_VERSION_TOOLS_MIN@"/>
<requires>
<import addon="xbmc.core" version="0.1.0"/>
</requires>
</addon>
1 change: 1 addition & 0 deletions system/addon-manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<addon>kodi.binary.global.network</addon>
<addon>kodi.binary.global.gui</addon>
<addon>kodi.binary.global.filesystem</addon>
<addon>kodi.binary.global.tools</addon>
<addon>kodi.binary.instance.audiodecoder</addon>
<addon>kodi.binary.instance.audioencoder</addon>
<addon>kodi.binary.instance.game</addon>
Expand Down
23 changes: 21 additions & 2 deletions xbmc/addons/kodi-addon-dev-kit/include/kodi/versions.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,20 @@
#define ADDON_GLOBAL_VERSION_FILESYSTEM_XML_ID "kodi.binary.global.filesystem"
#define ADDON_GLOBAL_VERSION_FILESYSTEM_DEPENDS "Filesystem.h" \
"c-api/filesystem.h" \
"gui/gl/Shader.h"
"gui/gl/Shader.h" \
"tools/DllHelper.h"

#define ADDON_GLOBAL_VERSION_NETWORK "1.0.2"
#define ADDON_GLOBAL_VERSION_NETWORK_MIN "1.0.0"
#define ADDON_GLOBAL_VERSION_NETWORK_XML_ID "kodi.binary.global.network"
#define ADDON_GLOBAL_VERSION_NETWORK_DEPENDS "Network.h" \
"c-api/network.h"

#define ADDON_GLOBAL_VERSION_TOOLS "1.0.0"
#define ADDON_GLOBAL_VERSION_TOOLS_MIN "1.0.0"
#define ADDON_GLOBAL_VERSION_TOOLS_XML_ID "kodi.binary.global.tools"
#define ADDON_GLOBAL_VERSION_TOOLS_DEPENDS "tools/DllHelper.h"

#define ADDON_INSTANCE_VERSION_AUDIODECODER "2.0.1"
#define ADDON_INSTANCE_VERSION_AUDIODECODER_MIN "2.0.1"
#define ADDON_INSTANCE_VERSION_AUDIODECODER_XML_ID "kodi.binary.instance.audiodecoder"
Expand Down Expand Up @@ -153,7 +159,10 @@ typedef enum ADDON_TYPE
ADDON_GLOBAL_GENERAL = 3,
ADDON_GLOBAL_NETWORK = 4,
ADDON_GLOBAL_FILESYSTEM = 5,
ADDON_GLOBAL_MAX = 5, // Last used global id, used in loops to check versions. Need to change if new global type becomes added.
ADDON_GLOBAL_TOOLS = 6,
// Last used global id, used in loops to check versions.
// Need to change if new global type becomes added!
ADDON_GLOBAL_MAX = 6,

/* addon type instances */

Expand Down Expand Up @@ -236,6 +245,10 @@ inline const char* GetTypeVersion(int type)
case ADDON_GLOBAL_NETWORK:
return ADDON_GLOBAL_VERSION_NETWORK;
#endif
#if !defined(BUILD_KODI_ADDON) || defined(ADDON_GLOBAL_VERSION_TOOLS_USED)
case ADDON_GLOBAL_TOOLS:
return ADDON_GLOBAL_VERSION_TOOLS;
#endif

/* addon type instances */
#if !defined(BUILD_KODI_ADDON) || defined(ADDON_INSTANCE_VERSION_AUDIODECODER_USED)
Expand Down Expand Up @@ -311,6 +324,8 @@ inline const char* GetTypeMinVersion(int type)
return ADDON_GLOBAL_VERSION_FILESYSTEM_MIN;
case ADDON_GLOBAL_NETWORK:
return ADDON_GLOBAL_VERSION_NETWORK_MIN;
case ADDON_GLOBAL_TOOLS:
return ADDON_GLOBAL_VERSION_TOOLS_MIN;

/* addon type instances */
case ADDON_INSTANCE_AUDIODECODER:
Expand Down Expand Up @@ -363,6 +378,8 @@ inline const char* GetTypeName(int type)
return "Filesystem";
case ADDON_GLOBAL_NETWORK:
return "Network";
case ADDON_GLOBAL_TOOLS:
return "Tools";

/* addon type instances */
case ADDON_INSTANCE_AUDIODECODER:
Expand Down Expand Up @@ -414,6 +431,8 @@ inline int GetTypeId(const char* name)
return ADDON_GLOBAL_FILESYSTEM;
else if (strcmp(name, "network") == 0)
return ADDON_GLOBAL_NETWORK;
else if (strcmp(name, "tools") == 0)
return ADDON_GLOBAL_TOOLS;
else if (strcmp(name, "audiodecoder") == 0)
return ADDON_INSTANCE_AUDIODECODER;
else if (strcmp(name, "audioencoder") == 0)
Expand Down

0 comments on commit b525f09

Please sign in to comment.