McuSupport: Version detection handling for kit requirements

Create appropriate instance of version detector depending on
parsed data from JSON and pass it to McuPackage's ctor. Also tests.

Change-Id: I4f7e5cd6d998745dfe951284c34904526abc216b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Piotr Mućko
2022-07-04 22:30:42 +02:00
parent 866f20e4f9
commit 5be5f7a331
19 changed files with 374 additions and 82 deletions

View File

@@ -48,8 +48,6 @@ class Id;
namespace McuSupport {
namespace Internal {
class McuPackageVersionDetector;
class McuPackage : public McuAbstractPackage
{
Q_OBJECT
@@ -90,6 +88,7 @@ public:
bool writeToSettings() const override;
QWidget *widget() override;
const McuPackageVersionDetector *getVersionDetector() const override;
private:
void updatePath();
@@ -116,9 +115,9 @@ private:
const bool m_addToSystemPath;
Status m_status = Status::InvalidPath;
};
}; // class McuPackage
class McuToolChainPackage : public McuPackage
class McuToolChainPackage final : public McuPackage
{
Q_OBJECT
public:
@@ -132,8 +131,8 @@ public:
ToolChainType toolchainType,
const QStringList &versions,
const QString &cmakeVarName,
const QString &envVarName = {},
const McuPackageVersionDetector *versionDetector = nullptr);
const QString &envVarName,
const McuPackageVersionDetector *versionDetector);
ToolChainType toolchainType() const;
bool isDesktopToolchain() const;