Lua: Implement lua pluginspec specific version check

Change-Id: I52c496c177c949056ff5e7a4ff7b903a028620b1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-06-13 07:39:17 +02:00
parent 20a6a5cd78
commit 39c1d82f46
9 changed files with 26 additions and 13 deletions

View File

@@ -9,6 +9,7 @@
#include <extensionsystem/extensionsystemtr.h>
#include <utils/algorithm.h>
#include <utils/appinfo.h>
#include <utils/expected.h>
#include <QJsonDocument>
@@ -76,6 +77,19 @@ ExtensionSystem::IPlugin *LuaPluginSpec::plugin() const
return nullptr;
}
bool LuaPluginSpec::provides(PluginSpec *spec, const PluginDependency &dependency) const
{
if (QString::compare(dependency.name, spec->name(), Qt::CaseInsensitive) != 0)
return false;
// Since we first released the lua support with Qt Creator 14.0.0, but the internal version
// number was still 13.0.82, we needed to special case this version.
if (versionCompare(dependency.version, "14.0.0") <= 0)
return true;
return (versionCompare(spec->version(), dependency.version) >= 0);
}
// LuaPluginSpec::For internal use {}
bool LuaPluginSpec::loadLibrary()
{