forked from qt-creator/qt-creator
McuSupport: Introduce new implementation stub
New/legacy implementation will be chosen based on contents of input json file. Change-Id: I989fa667c43123f831cc77320684413cab7652df Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -12,12 +12,14 @@ add_qtc_plugin(McuSupport
|
|||||||
mcusupportoptionspage.cpp mcusupportoptionspage.h
|
mcusupportoptionspage.cpp mcusupportoptionspage.h
|
||||||
mcupackage.cpp mcupackage.h
|
mcupackage.cpp mcupackage.h
|
||||||
mcutarget.cpp mcutarget.h
|
mcutarget.cpp mcutarget.h
|
||||||
|
mcutargetfactorylegacy.cpp mcutargetfactorylegacy.h
|
||||||
mcutargetfactory.cpp mcutargetfactory.h
|
mcutargetfactory.cpp mcutargetfactory.h
|
||||||
mcusupportplugin.cpp mcusupportplugin.h
|
mcusupportplugin.cpp mcusupportplugin.h
|
||||||
mcusupportsdk.cpp mcusupportsdk.h
|
mcusupportsdk.cpp mcusupportsdk.h
|
||||||
mcusupportrunconfiguration.cpp mcusupportrunconfiguration.h
|
mcusupportrunconfiguration.cpp mcusupportrunconfiguration.h
|
||||||
mcusupportversiondetection.cpp mcusupportversiondetection.h
|
mcusupportversiondetection.cpp mcusupportversiondetection.h
|
||||||
mcutargetdescription.h
|
mcutargetdescription.h
|
||||||
|
mcuhelpers.cpp mcuhelpers.h
|
||||||
)
|
)
|
||||||
|
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
|
55
src/plugins/mcusupport/mcuabstracttargetfactory.h
Normal file
55
src/plugins/mcusupport/mcuabstracttargetfactory.h
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "mcusupport_global.h"
|
||||||
|
|
||||||
|
#include <QHash>
|
||||||
|
#include <QPair>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
namespace McuSupport::Internal {
|
||||||
|
|
||||||
|
class McuAbstractPackage;
|
||||||
|
class McuToolChainPackage;
|
||||||
|
|
||||||
|
namespace Sdk {
|
||||||
|
struct McuTargetDescription;
|
||||||
|
|
||||||
|
class McuAbstractTargetFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using Ptr = std::unique_ptr<McuAbstractTargetFactory>;
|
||||||
|
~McuAbstractTargetFactory() = default;
|
||||||
|
|
||||||
|
virtual QPair<Targets, Packages> createTargets(const McuTargetDescription &) = 0;
|
||||||
|
using AdditionalPackages
|
||||||
|
= QPair<QHash<QString, McuToolChainPackage *>, QHash<QString, McuAbstractPackage *>>;
|
||||||
|
virtual AdditionalPackages getAdditionalPackages() const { return {}; }
|
||||||
|
}; // struct McuAbstractTargetFactory
|
||||||
|
} // namespace Sdk
|
||||||
|
} // namespace McuSupport::Internal
|
42
src/plugins/mcusupport/mcuhelpers.cpp
Normal file
42
src/plugins/mcusupport/mcuhelpers.cpp
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "mcuhelpers.h"
|
||||||
|
#include "mcutargetdescription.h"
|
||||||
|
|
||||||
|
namespace McuSupport {
|
||||||
|
|
||||||
|
Internal::McuTarget::OS deduceOperatingSystem(const Internal::Sdk::McuTargetDescription &desc)
|
||||||
|
{
|
||||||
|
using OS = Internal::McuTarget::OS;
|
||||||
|
using TargetType = Internal::Sdk::McuTargetDescription::TargetType;
|
||||||
|
if (desc.platform.type == TargetType::Desktop)
|
||||||
|
return OS::Desktop;
|
||||||
|
else if (!desc.freeRTOS.envVar.isEmpty())
|
||||||
|
return OS::FreeRTOS;
|
||||||
|
return OS::BareMetal;
|
||||||
|
}
|
||||||
|
|
||||||
|
} //namespace McuSupport
|
40
src/plugins/mcusupport/mcuhelpers.h
Normal file
40
src/plugins/mcusupport/mcuhelpers.h
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "mcutarget.h"
|
||||||
|
|
||||||
|
#include <QRegularExpression>
|
||||||
|
|
||||||
|
namespace McuSupport {
|
||||||
|
|
||||||
|
namespace Internal::Sdk {
|
||||||
|
struct McuTargetDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
Internal::McuTarget::OS deduceOperatingSystem(const Internal::Sdk::McuTargetDescription &);
|
||||||
|
|
||||||
|
}; // namespace McuSupport
|
@@ -29,8 +29,6 @@
|
|||||||
#include <utils/environmentfwd.h>
|
#include <utils/environmentfwd.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QObject>
|
|
||||||
#include <QVector>
|
|
||||||
#include <QVersionNumber>
|
#include <QVersionNumber>
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
@@ -41,7 +39,6 @@ namespace McuSupport {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class McuAbstractPackage;
|
class McuAbstractPackage;
|
||||||
class McuToolChainPackage;
|
|
||||||
class McuTarget;
|
class McuTarget;
|
||||||
|
|
||||||
namespace McuKitManager {
|
namespace McuKitManager {
|
||||||
|
@@ -64,8 +64,6 @@ public:
|
|||||||
const bool addToPath = false,
|
const bool addToPath = false,
|
||||||
const Utils::FilePath &relativePathModifier = Utils::FilePath());
|
const Utils::FilePath &relativePathModifier = Utils::FilePath());
|
||||||
|
|
||||||
~McuPackage() override = default;
|
|
||||||
|
|
||||||
QString label() const override;
|
QString label() const override;
|
||||||
const QString &cmakeVariableName() const override;
|
const QString &cmakeVariableName() const override;
|
||||||
const QString &environmentVariableName() const override;
|
const QString &environmentVariableName() const override;
|
||||||
|
@@ -25,6 +25,10 @@ QtcPlugin {
|
|||||||
"mcutarget.h",
|
"mcutarget.h",
|
||||||
"mcutargetfactory.cpp",
|
"mcutargetfactory.cpp",
|
||||||
"mcutargetfactory.h",
|
"mcutargetfactory.h",
|
||||||
|
"mcutargetfactorylegacy.cpp",
|
||||||
|
"mcutargetfactorylegacy.h",
|
||||||
|
"mcutargetfactory.cpp",
|
||||||
|
"mcutargetfactory.h",
|
||||||
"mcusupport.qrc",
|
"mcusupport.qrc",
|
||||||
"mcusupport_global.h",
|
"mcusupport_global.h",
|
||||||
"mcusupportconstants.h",
|
"mcusupportconstants.h",
|
||||||
@@ -46,7 +50,9 @@ QtcPlugin {
|
|||||||
"mcusupportversiondetection.h",
|
"mcusupportversiondetection.h",
|
||||||
"mcutargetdescription.h",
|
"mcutargetdescription.h",
|
||||||
"mcukitinformation.cpp",
|
"mcukitinformation.cpp",
|
||||||
"mcukitinformation.h"
|
"mcukitinformation.h",
|
||||||
|
"mcuhelpers.h",
|
||||||
|
"mcuhelpers.cpp",
|
||||||
]
|
]
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
|
@@ -26,9 +26,22 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#include <QList>
|
||||||
|
#include <QVersionNumber>
|
||||||
|
|
||||||
#if defined(MCUSUPPORT_LIBRARY)
|
#if defined(MCUSUPPORT_LIBRARY)
|
||||||
#define MCUSUPPORTSHARED_EXPORT Q_DECL_EXPORT
|
#define MCUSUPPORTSHARED_EXPORT Q_DECL_EXPORT
|
||||||
#else
|
#else
|
||||||
#define MCUSUPPORTSHARED_EXPORT Q_DECL_IMPORT
|
#define MCUSUPPORTSHARED_EXPORT Q_DECL_IMPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
namespace McuSupport::Internal {
|
||||||
|
|
||||||
|
class McuTarget;
|
||||||
|
class McuAbstractPackage;
|
||||||
|
|
||||||
|
using Targets = QList<McuTarget*>;
|
||||||
|
using Packages = QList<McuAbstractPackage*>;
|
||||||
|
static const QVersionNumber legacyVersion {2, 0, 0};
|
||||||
|
|
||||||
|
}
|
||||||
|
@@ -25,13 +25,13 @@
|
|||||||
|
|
||||||
#include "mcusupportoptions.h"
|
#include "mcusupportoptions.h"
|
||||||
|
|
||||||
#include "mcupackage.h"
|
|
||||||
#include "mcutarget.h"
|
|
||||||
#include "mcukitmanager.h"
|
|
||||||
#include "mcukitinformation.h"
|
#include "mcukitinformation.h"
|
||||||
|
#include "mcukitmanager.h"
|
||||||
|
#include "mcupackage.h"
|
||||||
#include "mcusupportconstants.h"
|
#include "mcusupportconstants.h"
|
||||||
#include "mcusupportsdk.h"
|
|
||||||
#include "mcusupportplugin.h"
|
#include "mcusupportplugin.h"
|
||||||
|
#include "mcusupportsdk.h"
|
||||||
|
#include "mcutarget.h"
|
||||||
|
|
||||||
#include <cmakeprojectmanager/cmakekitinformation.h>
|
#include <cmakeprojectmanager/cmakekitinformation.h>
|
||||||
#include <cmakeprojectmanager/cmaketoolmanager.h>
|
#include <cmakeprojectmanager/cmaketoolmanager.h>
|
||||||
@@ -57,7 +57,6 @@ void McuSdkRepository::deletePackagesAndTargets()
|
|||||||
{
|
{
|
||||||
qDeleteAll(packages);
|
qDeleteAll(packages);
|
||||||
packages.clear();
|
packages.clear();
|
||||||
qDeleteAll(mcuTargets);
|
|
||||||
mcuTargets.clear();
|
mcuTargets.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,8 +124,7 @@ void McuSupportOptions::registerExamples()
|
|||||||
|
|
||||||
const QVersionNumber &McuSupportOptions::minimalQulVersion()
|
const QVersionNumber &McuSupportOptions::minimalQulVersion()
|
||||||
{
|
{
|
||||||
static const QVersionNumber v({2, 0});
|
return legacyVersion;
|
||||||
return v;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void McuSupportOptions::setQulDir(const FilePath &dir)
|
void McuSupportOptions::setQulDir(const FilePath &dir)
|
||||||
@@ -176,7 +174,7 @@ void McuSupportOptions::deletePackagesAndTargets()
|
|||||||
|
|
||||||
void McuSupportOptions::checkUpgradeableKits()
|
void McuSupportOptions::checkUpgradeableKits()
|
||||||
{
|
{
|
||||||
if (!qtForMCUsSdkPackage->isValidStatus() || sdkRepository.mcuTargets.length() == 0)
|
if (!qtForMCUsSdkPackage->isValidStatus() || sdkRepository.mcuTargets.size() == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Utils::anyOf(sdkRepository.mcuTargets, [this](const McuTarget *target) {
|
if (Utils::anyOf(sdkRepository.mcuTargets, [this](const McuTarget *target) {
|
||||||
|
@@ -25,12 +25,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <utils/environmentfwd.h>
|
|
||||||
#include "mcusupport_global.h"
|
|
||||||
#include "mcukitmanager.h"
|
#include "mcukitmanager.h"
|
||||||
|
#include "mcusupport_global.h"
|
||||||
|
|
||||||
|
#include <utils/environmentfwd.h>
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVector>
|
|
||||||
#include <QVersionNumber>
|
#include <QVersionNumber>
|
||||||
|
|
||||||
QT_FORWARD_DECLARE_CLASS(QWidget)
|
QT_FORWARD_DECLARE_CLASS(QWidget)
|
||||||
@@ -50,15 +50,11 @@ namespace McuSupport {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class McuAbstractPackage;
|
class McuAbstractPackage;
|
||||||
class McuToolChainPackage;
|
|
||||||
class McuTarget;
|
|
||||||
|
|
||||||
class McuSdkRepository
|
struct McuSdkRepository
|
||||||
{
|
{
|
||||||
public:
|
Packages packages;
|
||||||
QVector<McuAbstractPackage *> packages;
|
Targets mcuTargets;
|
||||||
QVector<McuTarget *> mcuTargets;
|
|
||||||
|
|
||||||
void deletePackagesAndTargets();
|
void deletePackagesAndTargets();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -91,6 +87,7 @@ public:
|
|||||||
void setAutomaticKitCreationEnabled(const bool enabled);
|
void setAutomaticKitCreationEnabled(const bool enabled);
|
||||||
void writeGeneralSettings() const;
|
void writeGeneralSettings() const;
|
||||||
static bool automaticKitCreationFromSettings();
|
static bool automaticKitCreationFromSettings();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void deletePackagesAndTargets();
|
void deletePackagesAndTargets();
|
||||||
|
|
||||||
@@ -99,6 +96,5 @@ signals:
|
|||||||
void packagesChanged();
|
void packagesChanged();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace McuSupport
|
} // namespace McuSupport
|
||||||
|
@@ -146,8 +146,7 @@ McuSupportOptionsWidget::McuSupportOptionsWidget()
|
|||||||
m_kitAutomaticCreationCheckBox = new QCheckBox(
|
m_kitAutomaticCreationCheckBox = new QCheckBox(
|
||||||
tr("Automatically create kits for all available targets on start"));
|
tr("Automatically create kits for all available targets on start"));
|
||||||
connect(m_kitAutomaticCreationCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
|
connect(m_kitAutomaticCreationCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
|
||||||
m_options.setAutomaticKitCreationEnabled(
|
m_options.setAutomaticKitCreationEnabled(state == Qt::CheckState::Checked);
|
||||||
state == Qt::CheckState::Checked);
|
|
||||||
});
|
});
|
||||||
mainLayout->addWidget(m_kitAutomaticCreationCheckBox);
|
mainLayout->addWidget(m_kitAutomaticCreationCheckBox);
|
||||||
}
|
}
|
||||||
@@ -171,7 +170,9 @@ McuSupportOptionsWidget::McuSupportOptionsWidget()
|
|||||||
connect(m_kitUpdatePushButton, &QPushButton::clicked, this, [this] {
|
connect(m_kitUpdatePushButton, &QPushButton::clicked, this, [this] {
|
||||||
for (auto kit :
|
for (auto kit :
|
||||||
McuKitManager::upgradeableKits(currentMcuTarget(), m_options.qtForMCUsSdkPackage))
|
McuKitManager::upgradeableKits(currentMcuTarget(), m_options.qtForMCUsSdkPackage))
|
||||||
McuKitManager::upgradeKitInPlace(kit, currentMcuTarget(), m_options.qtForMCUsSdkPackage);
|
McuKitManager::upgradeKitInPlace(kit,
|
||||||
|
currentMcuTarget(),
|
||||||
|
m_options.qtForMCUsSdkPackage);
|
||||||
updateStatus();
|
updateStatus();
|
||||||
});
|
});
|
||||||
vLayout->addWidget(m_kitCreationPushButton);
|
vLayout->addWidget(m_kitCreationPushButton);
|
||||||
@@ -223,9 +224,10 @@ void McuSupportOptionsWidget::updateStatus()
|
|||||||
if (mcuTargetValid) {
|
if (mcuTargetValid) {
|
||||||
const bool hasMatchingKits
|
const bool hasMatchingKits
|
||||||
= !McuKitManager::matchingKits(mcuTarget, m_options.qtForMCUsSdkPackage).isEmpty();
|
= !McuKitManager::matchingKits(mcuTarget, m_options.qtForMCUsSdkPackage).isEmpty();
|
||||||
const bool hasUpgradeableKits = !hasMatchingKits &&
|
const bool hasUpgradeableKits
|
||||||
!McuKitManager::upgradeableKits(
|
= !hasMatchingKits
|
||||||
mcuTarget, m_options.qtForMCUsSdkPackage).isEmpty();
|
&& !McuKitManager::upgradeableKits(mcuTarget, m_options.qtForMCUsSdkPackage)
|
||||||
|
.isEmpty();
|
||||||
|
|
||||||
m_kitCreationPushButton->setEnabled(!hasMatchingKits);
|
m_kitCreationPushButton->setEnabled(!hasMatchingKits);
|
||||||
m_kitUpdatePushButton->setEnabled(hasUpgradeableKits);
|
m_kitUpdatePushButton->setEnabled(hasUpgradeableKits);
|
||||||
@@ -316,8 +318,9 @@ void McuSupportOptionsWidget::populateMcuTargetsComboBox()
|
|||||||
m_options.populatePackagesAndTargets();
|
m_options.populatePackagesAndTargets();
|
||||||
m_mcuTargetsComboBox->clear();
|
m_mcuTargetsComboBox->clear();
|
||||||
m_mcuTargetsComboBox->addItems(
|
m_mcuTargetsComboBox->addItems(
|
||||||
Utils::transform<QStringList>(m_options.sdkRepository.mcuTargets,
|
Utils::transform<QStringList>(m_options.sdkRepository.mcuTargets, [](McuTarget *t) {
|
||||||
[](McuTarget *t) { return McuKitManager::generateKitNameFromTarget(t); }));
|
return McuKitManager::generateKitNameFromTarget(t);
|
||||||
|
}));
|
||||||
updateStatus();
|
updateStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,6 +33,7 @@
|
|||||||
#include "mcutarget.h"
|
#include "mcutarget.h"
|
||||||
#include "mcutargetdescription.h"
|
#include "mcutargetdescription.h"
|
||||||
#include "mcutargetfactory.h"
|
#include "mcutargetfactory.h"
|
||||||
|
#include "mcutargetfactorylegacy.h"
|
||||||
|
|
||||||
#include <baremetal/baremetalconstants.h>
|
#include <baremetal/baremetalconstants.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
@@ -50,12 +51,20 @@
|
|||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
|
#include <ciso646>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace McuSupport {
|
namespace McuSupport {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
namespace Sdk {
|
namespace Sdk {
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
const char CMAKE_ENTRIES[]{"cmakeEntries"};
|
||||||
|
const char ID[]{"id"};
|
||||||
|
} // namespace
|
||||||
|
|
||||||
static FilePath findInProgramFiles(const QString &folder)
|
static FilePath findInProgramFiles(const QString &folder)
|
||||||
{
|
{
|
||||||
for (auto envVar : {"ProgramFiles", "ProgramFiles(x86)", "ProgramW6432"}) {
|
for (auto envVar : {"ProgramFiles", "ProgramFiles(x86)", "ProgramW6432"}) {
|
||||||
@@ -68,7 +77,7 @@ static FilePath findInProgramFiles(const QString &folder)
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
McuPackage *createQtForMCUsPackage()
|
McuAbstractPackage *createQtForMCUsPackage()
|
||||||
{
|
{
|
||||||
return new McuPackage(McuPackage::tr("Qt for MCUs SDK"),
|
return new McuPackage(McuPackage::tr("Qt for MCUs SDK"),
|
||||||
FileUtils::homePath(), // defaultPath
|
FileUtils::homePath(), // defaultPath
|
||||||
@@ -95,11 +104,10 @@ static McuPackageVersionDetector *generatePackageVersionDetector(const QString &
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Create the McuPackage by checking the "boardSdk" property in the JSON file for the board.
|
/// Create the McuPackage by checking the "boardSdk" property in the JSON file for the board.
|
||||||
/// The name of the environment variable pointing to the the SDK for the board will be defined in the "envVar" property
|
/// The name of the environment variable pointing to the the SDK for the board will be defined in the "envVar" property
|
||||||
/// inside the "boardSdk".
|
/// inside the "boardSdk".
|
||||||
McuPackage *createBoardSdkPackage(const McuTargetDescription &desc)
|
McuAbstractPackage *createBoardSdkPackage(const McuTargetDescription &desc)
|
||||||
{
|
{
|
||||||
const auto generateSdkName = [](const QString &envVar) {
|
const auto generateSdkName = [](const QString &envVar) {
|
||||||
qsizetype postfixPos = envVar.indexOf("_SDK_PATH");
|
qsizetype postfixPos = envVar.indexOf("_SDK_PATH");
|
||||||
@@ -137,7 +145,7 @@ McuPackage *createBoardSdkPackage(const McuTargetDescription &desc)
|
|||||||
versionDetector);
|
versionDetector);
|
||||||
}
|
}
|
||||||
|
|
||||||
McuPackage *createFreeRTOSSourcesPackage(const QString &envVar,
|
McuAbstractPackage *createFreeRTOSSourcesPackage(const QString &envVar,
|
||||||
const FilePath &boardSdkDir,
|
const FilePath &boardSdkDir,
|
||||||
const QString &freeRTOSBoardSdkSubDir)
|
const QString &freeRTOSBoardSdkSubDir)
|
||||||
{
|
{
|
||||||
@@ -152,14 +160,13 @@ McuPackage *createFreeRTOSSourcesPackage(const QString &envVar,
|
|||||||
return new McuPackage(QString::fromLatin1("FreeRTOS Sources (%1)").arg(envVarPrefix),
|
return new McuPackage(QString::fromLatin1("FreeRTOS Sources (%1)").arg(envVarPrefix),
|
||||||
defaultPath,
|
defaultPath,
|
||||||
{}, // detection path
|
{}, // detection path
|
||||||
QString::fromLatin1("FreeRTOSSourcePackage_%1").arg(envVarPrefix), // settings key
|
QString::fromLatin1("FreeRTOSSourcePackage_%1")
|
||||||
|
.arg(envVarPrefix), // settings key
|
||||||
"FREERTOS_DIR", // cmake var
|
"FREERTOS_DIR", // cmake var
|
||||||
envVar, // env var
|
envVar, // env var
|
||||||
"https://freertos.org"); // download url
|
"https://freertos.org"); // download url
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
McuToolChainPackage *createUnsupportedToolChainPackage()
|
McuToolChainPackage *createUnsupportedToolChainPackage()
|
||||||
{
|
{
|
||||||
return new McuToolChainPackage({}, {}, {}, {}, McuToolChainPackage::ToolChainType::Unsupported);
|
return new McuToolChainPackage({}, {}, {}, {}, McuToolChainPackage::ToolChainType::Unsupported);
|
||||||
@@ -300,10 +307,8 @@ static McuPackage *createStm32CubeProgrammerPackage()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const FilePath detectionPath = FilePath::fromString(
|
const FilePath detectionPath = FilePath::fromString(
|
||||||
QLatin1String(Utils::HostOsInfo::isWindowsHost()
|
QLatin1String(Utils::HostOsInfo::isWindowsHost() ? "/bin/STM32_Programmer_CLI.exe"
|
||||||
? "/bin/STM32_Programmer_CLI.exe"
|
: "/bin/STM32_Programmer.sh"));
|
||||||
: "/bin/STM32_Programmer.sh")
|
|
||||||
);
|
|
||||||
|
|
||||||
auto result
|
auto result
|
||||||
= new McuPackage(McuPackage::tr("STM32CubeProgrammer"),
|
= new McuPackage(McuPackage::tr("STM32CubeProgrammer"),
|
||||||
@@ -345,7 +350,8 @@ static McuPackage *createMcuXpressoIdePackage()
|
|||||||
|
|
||||||
return new McuPackage("MCUXpresso IDE",
|
return new McuPackage("MCUXpresso IDE",
|
||||||
defaultPath,
|
defaultPath,
|
||||||
FilePath("ide/binaries/crt_emu_cm_redlink").withExecutableSuffix(), // detection path
|
FilePath("ide/binaries/crt_emu_cm_redlink")
|
||||||
|
.withExecutableSuffix(), // detection path
|
||||||
"MCUXpressoIDE", // settings key
|
"MCUXpressoIDE", // settings key
|
||||||
"MCUXPRESSO_IDE_PATH", // cmake var
|
"MCUXPRESSO_IDE_PATH", // cmake var
|
||||||
envVar,
|
envVar,
|
||||||
@@ -406,10 +412,11 @@ static McuPackage *createRenesasProgrammerPackage()
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<McuTarget *> targetsFromDescriptions(const QList<McuTargetDescription> &descriptions,
|
static McuAbstractTargetFactory::Ptr createFactory(bool isLegacy)
|
||||||
QVector<McuAbstractPackage *> *packages)
|
|
||||||
{
|
{
|
||||||
const QHash<QString, McuToolChainPackage *> tcPkgs = {
|
McuAbstractTargetFactory::Ptr result;
|
||||||
|
if (isLegacy) {
|
||||||
|
static const QHash<QString, McuToolChainPackage *> tcPkgs = {
|
||||||
{{"armgcc"}, createArmGccToolchainPackage()},
|
{{"armgcc"}, createArmGccToolchainPackage()},
|
||||||
{{"greenhills"}, createGhsToolchainPackage()},
|
{{"greenhills"}, createGhsToolchainPackage()},
|
||||||
{{"iar"}, createIarToolChainPackage()},
|
{{"iar"}, createIarToolChainPackage()},
|
||||||
@@ -420,31 +427,43 @@ QVector<McuTarget *> targetsFromDescriptions(const QList<McuTargetDescription> &
|
|||||||
|
|
||||||
// Note: the vendor name (the key of the hash) is case-sensitive. It has to match the "platformVendor" key in the
|
// Note: the vendor name (the key of the hash) is case-sensitive. It has to match the "platformVendor" key in the
|
||||||
// json file.
|
// json file.
|
||||||
const QHash<QString, McuPackage *> vendorPkgs = {
|
static const QHash<QString, McuAbstractPackage *> vendorPkgs = {
|
||||||
{{"ST"}, createStm32CubeProgrammerPackage()},
|
{{"ST"}, createStm32CubeProgrammerPackage()},
|
||||||
{{"NXP"}, createMcuXpressoIdePackage()},
|
{{"NXP"}, createMcuXpressoIdePackage()},
|
||||||
{{"CYPRESS"}, createCypressProgrammerPackage()},
|
{{"CYPRESS"}, createCypressProgrammerPackage()},
|
||||||
{{"RENESAS"}, createRenesasProgrammerPackage()},
|
{{"RENESAS"}, createRenesasProgrammerPackage()},
|
||||||
};
|
};
|
||||||
|
|
||||||
McuTargetFactory targetFactory(tcPkgs, vendorPkgs);
|
result = std::make_unique<McuTargetFactoryLegacy>(tcPkgs, vendorPkgs);
|
||||||
QVector<McuTarget *> mcuTargets;
|
} else {
|
||||||
|
result = std::make_unique<McuTargetFactory>();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto &desc : descriptions) {
|
QPair<Targets, Packages> targetsFromDescriptions(const QList<McuTargetDescription> &descriptions,
|
||||||
auto newTargets = targetFactory.createTargets(desc);
|
bool isLegacy)
|
||||||
mcuTargets.append(newTargets);
|
{
|
||||||
|
Targets mcuTargets;
|
||||||
|
Packages mcuPackages;
|
||||||
|
|
||||||
|
McuAbstractTargetFactory::Ptr targetFactory = createFactory(isLegacy);
|
||||||
|
for (const McuTargetDescription &desc : descriptions) {
|
||||||
|
auto [targets, packages] = targetFactory->createTargets(desc);
|
||||||
|
mcuTargets.append(targets);
|
||||||
|
mcuPackages.append(packages);
|
||||||
}
|
}
|
||||||
|
|
||||||
packages->append(
|
if (isLegacy) {
|
||||||
Utils::transform<QVector<McuAbstractPackage *>>(tcPkgs.values(),
|
auto [toolchainPkgs, vendorPkgs]{targetFactory->getAdditionalPackages()};
|
||||||
[&](McuToolChainPackage *tcPkg) {
|
for (McuAbstractPackage *package : toolchainPkgs) {
|
||||||
return tcPkg;
|
mcuPackages.emplace_back(package);
|
||||||
}));
|
}
|
||||||
for (auto *package : vendorPkgs)
|
for (McuAbstractPackage *package : vendorPkgs) {
|
||||||
packages->append(package);
|
mcuPackages.emplace_back(package);
|
||||||
packages->append(targetFactory.getMcuPackages());
|
}
|
||||||
|
}
|
||||||
return mcuTargets;
|
return {mcuTargets, mcuPackages};
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePath kitsPath(const Utils::FilePath &dir)
|
Utils::FilePath kitsPath(const Utils::FilePath &dir)
|
||||||
@@ -458,6 +477,24 @@ static QFileInfoList targetDescriptionFiles(const Utils::FilePath &dir)
|
|||||||
return kitsDir.entryInfoList();
|
return kitsDir.entryInfoList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static QList<PackageDescription> parsePackages(const QJsonArray &cmakeEntries)
|
||||||
|
{
|
||||||
|
QList<PackageDescription> result;
|
||||||
|
for (const auto& cmakeEntryRef : cmakeEntries) {
|
||||||
|
const QJsonObject cmakeEntry{cmakeEntryRef.toObject()};
|
||||||
|
result.push_back({cmakeEntry[ID].toString(),
|
||||||
|
cmakeEntry["envVar"].toString(),
|
||||||
|
cmakeEntry["cmakeVar"].toString(),
|
||||||
|
cmakeEntry["description"].toString(),
|
||||||
|
cmakeEntry["setting"].toString(),
|
||||||
|
FilePath::fromString(cmakeEntry["defaultValue"].toString()),
|
||||||
|
FilePath::fromString(cmakeEntry["validation"].toString()),
|
||||||
|
{},
|
||||||
|
false});
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
McuTargetDescription parseDescriptionJson(const QByteArray &data)
|
McuTargetDescription parseDescriptionJson(const QByteArray &data)
|
||||||
{
|
{
|
||||||
const QJsonDocument document = QJsonDocument::fromJson(data);
|
const QJsonDocument document = QJsonDocument::fromJson(data);
|
||||||
@@ -469,6 +506,11 @@ McuTargetDescription parseDescriptionJson(const QByteArray &data)
|
|||||||
const QJsonObject boardSdk = target.value("boardSdk").toObject();
|
const QJsonObject boardSdk = target.value("boardSdk").toObject();
|
||||||
const QJsonObject freeRTOS = target.value("freeRTOS").toObject();
|
const QJsonObject freeRTOS = target.value("freeRTOS").toObject();
|
||||||
|
|
||||||
|
QJsonArray cmakeEntries = freeRTOS.value(CMAKE_ENTRIES).toArray();
|
||||||
|
cmakeEntries.append(toolchain.value(CMAKE_ENTRIES).toArray());
|
||||||
|
cmakeEntries.append(boardSdk.value(CMAKE_ENTRIES).toArray());
|
||||||
|
const QList<PackageDescription> freeRtosEntries = parsePackages(cmakeEntries);
|
||||||
|
|
||||||
const QVariantList toolchainVersions = toolchain.value("versions").toArray().toVariantList();
|
const QVariantList toolchainVersions = toolchain.value("versions").toArray().toVariantList();
|
||||||
const auto toolchainVersionsList = Utils::transform<QStringList>(toolchainVersions,
|
const auto toolchainVersionsList = Utils::transform<QStringList>(toolchainVersions,
|
||||||
[&](const QVariant &version) {
|
[&](const QVariant &version) {
|
||||||
@@ -497,30 +539,26 @@ McuTargetDescription parseDescriptionJson(const QByteArray &data)
|
|||||||
platformName == "Desktop" ? McuTargetDescription::TargetType::Desktop
|
platformName == "Desktop" ? McuTargetDescription::TargetType::Desktop
|
||||||
: McuTargetDescription::TargetType::MCU,
|
: McuTargetDescription::TargetType::MCU,
|
||||||
},
|
},
|
||||||
{
|
{toolchain.value("id").toString(), toolchainVersionsList, {}},
|
||||||
toolchain.value("id").toString(),
|
|
||||||
toolchainVersionsList,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
boardSdk.value("name").toString(),
|
boardSdk.value("name").toString(),
|
||||||
boardSdk.value("defaultPath").toString(),
|
boardSdk.value("defaultPath").toString(),
|
||||||
boardSdk.value("envVar").toString(),
|
boardSdk.value("envVar").toString(),
|
||||||
boardSdkVersionsList,
|
boardSdkVersionsList,
|
||||||
|
{},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
freeRTOS.value("envVar").toString(),
|
freeRTOS.value("envVar").toString(),
|
||||||
freeRTOS.value("boardSdkSubDir").toString(),
|
freeRTOS.value("boardSdkSubDir").toString(),
|
||||||
|
freeRtosEntries,
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://doc.qt.io/qtcreator/creator-developing-mcu.html#supported-qt-for-mcus-sdks
|
// https://doc.qt.io/qtcreator/creator-developing-mcu.html#supported-qt-for-mcus-sdks
|
||||||
static const QString legacySupportVersionFor(const QString &sdkVersion)
|
static const QString legacySupportVersionFor(const QString &sdkVersion)
|
||||||
{
|
{
|
||||||
static const QHash<QString, QString> oldSdkQtcRequiredVersion = {
|
static const QHash<QString, QString> oldSdkQtcRequiredVersion
|
||||||
{{"1.0"}, {"4.11.x"}},
|
= {{{"1.0"}, {"4.11.x"}}, {{"1.1"}, {"4.12.0 or 4.12.1"}}, {{"1.2"}, {"4.12.2 or 4.12.3"}}};
|
||||||
{{"1.1"}, {"4.12.0 or 4.12.1"}},
|
|
||||||
{{"1.2"}, {"4.12.2 or 4.12.3"}}
|
|
||||||
};
|
|
||||||
if (oldSdkQtcRequiredVersion.contains(sdkVersion))
|
if (oldSdkQtcRequiredVersion.contains(sdkVersion))
|
||||||
return oldSdkQtcRequiredVersion.value(sdkVersion);
|
return oldSdkQtcRequiredVersion.value(sdkVersion);
|
||||||
|
|
||||||
@@ -553,6 +591,8 @@ void targetsAndPackages(const Utils::FilePath &dir, McuSdkRepository *repo)
|
|||||||
{
|
{
|
||||||
QList<McuTargetDescription> descriptions;
|
QList<McuTargetDescription> descriptions;
|
||||||
|
|
||||||
|
bool isLegacy = false;
|
||||||
|
|
||||||
auto descriptionFiles = targetDescriptionFiles(dir);
|
auto descriptionFiles = targetDescriptionFiles(dir);
|
||||||
for (const QFileInfo &fileInfo : descriptionFiles) {
|
for (const QFileInfo &fileInfo : descriptionFiles) {
|
||||||
QFile file(fileInfo.absoluteFilePath());
|
QFile file(fileInfo.absoluteFilePath());
|
||||||
@@ -569,7 +609,12 @@ void targetsAndPackages(const Utils::FilePath &dir, McuSdkRepository *repo)
|
|||||||
false);
|
false);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (QVersionNumber::fromString(desc.qulVersion) < McuSupportOptions::minimalQulVersion()) {
|
|
||||||
|
const auto qulVersion{QVersionNumber::fromString(desc.qulVersion)};
|
||||||
|
if (qulVersion == McuSupportOptions::minimalQulVersion())
|
||||||
|
isLegacy = true;
|
||||||
|
|
||||||
|
if (qulVersion < McuSupportOptions::minimalQulVersion()) {
|
||||||
const QString legacyVersion = legacySupportVersionFor(desc.qulVersion);
|
const QString legacyVersion = legacySupportVersionFor(desc.qulVersion);
|
||||||
const QString qtcSupportText
|
const QString qtcSupportText
|
||||||
= !legacyVersion.isEmpty()
|
= !legacyVersion.isEmpty()
|
||||||
@@ -601,14 +646,14 @@ void targetsAndPackages(const Utils::FilePath &dir, McuSdkRepository *repo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
std::tie(repo->mcuTargets, repo->packages) = targetsFromDescriptions(descriptions, isLegacy);
|
||||||
repo->mcuTargets.append(targetsFromDescriptions(descriptions, &(repo->packages)));
|
|
||||||
|
|
||||||
// Keep targets sorted lexicographically
|
// Keep targets sorted lexicographically
|
||||||
std::sort(repo->mcuTargets.begin(),
|
std::sort(repo->mcuTargets.begin(),
|
||||||
repo->mcuTargets.end(),
|
repo->mcuTargets.end(),
|
||||||
[](const McuTarget *lhs, const McuTarget *rhs) {
|
[](const McuTarget *lhs, const McuTarget *rhs) {
|
||||||
return McuKitManager::generateKitNameFromTarget(lhs) < McuKitManager::generateKitNameFromTarget(rhs);
|
return McuKitManager::generateKitNameFromTarget(lhs)
|
||||||
|
< McuKitManager::generateKitNameFromTarget(rhs);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,19 +25,19 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "mcusupport_global.h"
|
||||||
|
|
||||||
#include <utils/filepath.h>
|
#include <utils/filepath.h>
|
||||||
|
|
||||||
|
#include <QPair>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QVector>
|
|
||||||
|
|
||||||
namespace McuSupport {
|
namespace McuSupport::Internal {
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
constexpr int MAX_COMPATIBILITY_VERSION{1};
|
constexpr int MAX_COMPATIBILITY_VERSION{1};
|
||||||
|
|
||||||
class McuSdkRepository;
|
class McuSdkRepository;
|
||||||
class McuAbstractPackage;
|
class McuAbstractPackage;
|
||||||
class McuPackage;
|
|
||||||
class McuToolChainPackage;
|
class McuToolChainPackage;
|
||||||
class McuTarget;
|
class McuTarget;
|
||||||
|
|
||||||
@@ -45,15 +45,14 @@ namespace Sdk {
|
|||||||
|
|
||||||
struct McuTargetDescription;
|
struct McuTargetDescription;
|
||||||
|
|
||||||
McuPackage *createQtForMCUsPackage();
|
McuAbstractPackage *createQtForMCUsPackage();
|
||||||
|
|
||||||
bool checkDeprecatedSdkError(const Utils::FilePath &qulDir, QString &message);
|
bool checkDeprecatedSdkError(const Utils::FilePath &qulDir, QString &message);
|
||||||
|
|
||||||
void targetsAndPackages(const Utils::FilePath &qulDir, McuSdkRepository *repo);
|
void targetsAndPackages(const Utils::FilePath &qulDir, McuSdkRepository *repo);
|
||||||
|
|
||||||
McuTargetDescription parseDescriptionJson(const QByteArray &);
|
McuTargetDescription parseDescriptionJson(const QByteArray &);
|
||||||
QVector<McuTarget *> targetsFromDescriptions(const QList<McuTargetDescription> &,
|
QPair<Targets, Packages> targetsFromDescriptions(const QList<McuTargetDescription> &, bool isLegacy);
|
||||||
QVector<McuAbstractPackage *> *);
|
|
||||||
|
|
||||||
Utils::FilePath kitsPath(const Utils::FilePath &dir);
|
Utils::FilePath kitsPath(const Utils::FilePath &dir);
|
||||||
|
|
||||||
@@ -62,11 +61,10 @@ Utils::FilePath packagePathFromSettings(const QString &settingsKey,
|
|||||||
const Utils::FilePath &defaultPath);
|
const Utils::FilePath &defaultPath);
|
||||||
|
|
||||||
McuToolChainPackage *createUnsupportedToolChainPackage();
|
McuToolChainPackage *createUnsupportedToolChainPackage();
|
||||||
McuPackage *createBoardSdkPackage(const McuTargetDescription &desc);
|
McuAbstractPackage *createBoardSdkPackage(const McuTargetDescription &desc);
|
||||||
McuPackage *createFreeRTOSSourcesPackage(const QString &envVar,
|
McuAbstractPackage *createFreeRTOSSourcesPackage(const QString &envVar,
|
||||||
const Utils::FilePath &boardSdkDir,
|
const Utils::FilePath &boardSdkDir,
|
||||||
const QString &freeRTOSBoardSdkSubDir);
|
const QString &freeRTOSBoardSdkSubDir);
|
||||||
|
|
||||||
} // namespace Sdk
|
} // namespace Sdk
|
||||||
} // namespace Internal
|
} // namespace McuSupport::Internal
|
||||||
} // namespace McuSupport
|
|
||||||
|
@@ -37,7 +37,7 @@ namespace McuSupport::Internal {
|
|||||||
McuTarget::McuTarget(const QVersionNumber &qulVersion,
|
McuTarget::McuTarget(const QVersionNumber &qulVersion,
|
||||||
const Platform &platform,
|
const Platform &platform,
|
||||||
OS os,
|
OS os,
|
||||||
const QVector<McuAbstractPackage *> &packages,
|
const Packages& packages,
|
||||||
const McuToolChainPackage *toolChainPackage,
|
const McuToolChainPackage *toolChainPackage,
|
||||||
int colorDepth)
|
int colorDepth)
|
||||||
: m_qulVersion(qulVersion)
|
: m_qulVersion(qulVersion)
|
||||||
@@ -48,7 +48,7 @@ McuTarget::McuTarget(const QVersionNumber &qulVersion,
|
|||||||
, m_colorDepth(colorDepth)
|
, m_colorDepth(colorDepth)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
const QVector<McuAbstractPackage *> &McuTarget::packages() const
|
const Packages &McuTarget::packages() const
|
||||||
{
|
{
|
||||||
return m_packages;
|
return m_packages;
|
||||||
}
|
}
|
||||||
|
@@ -25,6 +25,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "mcupackage.h"
|
||||||
|
#include "mcusupport_global.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVersionNumber>
|
#include <QVersionNumber>
|
||||||
|
|
||||||
@@ -39,7 +42,6 @@ class InfoLabel;
|
|||||||
|
|
||||||
namespace McuSupport::Internal {
|
namespace McuSupport::Internal {
|
||||||
|
|
||||||
class McuAbstractPackage;
|
|
||||||
class McuToolChainPackage;
|
class McuToolChainPackage;
|
||||||
|
|
||||||
class McuTarget : public QObject
|
class McuTarget : public QObject
|
||||||
@@ -61,12 +63,12 @@ public:
|
|||||||
McuTarget(const QVersionNumber &qulVersion,
|
McuTarget(const QVersionNumber &qulVersion,
|
||||||
const Platform &platform,
|
const Platform &platform,
|
||||||
OS os,
|
OS os,
|
||||||
const QVector<McuAbstractPackage *> &packages,
|
const Packages& packages,
|
||||||
const McuToolChainPackage *toolChainPackage,
|
const McuToolChainPackage *toolChainPackage,
|
||||||
int colorDepth = UnspecifiedColorDepth);
|
int colorDepth = UnspecifiedColorDepth);
|
||||||
|
|
||||||
const QVersionNumber &qulVersion() const;
|
const QVersionNumber &qulVersion() const;
|
||||||
const QVector<McuAbstractPackage *> &packages() const;
|
const Packages &packages() const;
|
||||||
const McuToolChainPackage *toolChainPackage() const;
|
const McuToolChainPackage *toolChainPackage() const;
|
||||||
const Platform &platform() const;
|
const Platform &platform() const;
|
||||||
OS os() const;
|
OS os() const;
|
||||||
@@ -78,10 +80,9 @@ private:
|
|||||||
const QVersionNumber m_qulVersion;
|
const QVersionNumber m_qulVersion;
|
||||||
const Platform m_platform;
|
const Platform m_platform;
|
||||||
const OS m_os;
|
const OS m_os;
|
||||||
const QVector<McuAbstractPackage *> m_packages;
|
const Packages m_packages;
|
||||||
const McuToolChainPackage *m_toolChainPackage;
|
const McuToolChainPackage* m_toolChainPackage;
|
||||||
const int m_colorDepth;
|
const int m_colorDepth;
|
||||||
}; // class McuTarget
|
}; // class McuTarget
|
||||||
|
|
||||||
|
|
||||||
} // namespace McuSupport::Internal
|
} // namespace McuSupport::Internal
|
||||||
|
@@ -25,12 +25,27 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <utils/filepath.h>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
#include <QVersionNumber>
|
||||||
|
|
||||||
namespace McuSupport::Internal::Sdk {
|
namespace McuSupport::Internal::Sdk {
|
||||||
|
|
||||||
|
struct PackageDescription
|
||||||
|
{
|
||||||
|
QString label;
|
||||||
|
QString envVar;
|
||||||
|
QString cmakeVar;
|
||||||
|
QString description;
|
||||||
|
QString setting;
|
||||||
|
Utils::FilePath defaultPath;
|
||||||
|
Utils::FilePath validationPath;
|
||||||
|
QList<QVersionNumber> versions;
|
||||||
|
bool shouldAddToSystemPath;
|
||||||
|
}; //struct PackageDescription
|
||||||
|
|
||||||
struct McuTargetDescription
|
struct McuTargetDescription
|
||||||
{
|
{
|
||||||
enum class TargetType { MCU, Desktop };
|
enum class TargetType { MCU, Desktop };
|
||||||
@@ -49,6 +64,7 @@ struct McuTargetDescription
|
|||||||
{
|
{
|
||||||
QString id;
|
QString id;
|
||||||
QStringList versions;
|
QStringList versions;
|
||||||
|
QList<PackageDescription> packages;
|
||||||
} toolchain;
|
} toolchain;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
@@ -56,11 +72,13 @@ struct McuTargetDescription
|
|||||||
QString defaultPath;
|
QString defaultPath;
|
||||||
QString envVar;
|
QString envVar;
|
||||||
QStringList versions;
|
QStringList versions;
|
||||||
|
QList<PackageDescription> packages;
|
||||||
} boardSdk;
|
} boardSdk;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
QString envVar;
|
QString envVar;
|
||||||
QString boardSdkSubDir;
|
QString boardSdkSubDir;
|
||||||
|
QList<PackageDescription> packages;
|
||||||
} freeRTOS;
|
} freeRTOS;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -24,91 +24,62 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "mcutargetfactory.h"
|
#include "mcutargetfactory.h"
|
||||||
|
#include "mcuhelpers.h"
|
||||||
#include "mcupackage.h"
|
#include "mcupackage.h"
|
||||||
#include "mcusupportsdk.h"
|
|
||||||
#include "mcusupportversiondetection.h"
|
|
||||||
#include "mcutarget.h"
|
#include "mcutarget.h"
|
||||||
#include "mcutargetdescription.h"
|
#include "mcutargetdescription.h"
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
|
||||||
#include <QVersionNumber>
|
#include <QVersionNumber>
|
||||||
|
|
||||||
namespace McuSupport::Internal::Sdk {
|
namespace McuSupport::Internal::Sdk {
|
||||||
|
|
||||||
using namespace Utils;
|
QPair<Targets, Packages> McuTargetFactory::createTargets(const McuTargetDescription &desc)
|
||||||
|
|
||||||
QVector<McuAbstractPackage *> McuTargetFactory::getMcuPackages() const
|
|
||||||
{
|
{
|
||||||
QVector<McuAbstractPackage *> packages;
|
Targets mcuTargets;
|
||||||
for (auto *package : qAsConst(boardSdkPkgs))
|
Packages packages;
|
||||||
packages.append(package);
|
|
||||||
for (auto *package : qAsConst(freeRTOSPkgs))
|
for (int colorDepth : desc.platform.colorDepths) {
|
||||||
packages.append(package);
|
const McuTarget::Platform platform(
|
||||||
|
{desc.platform.id, desc.platform.name, desc.platform.vendor});
|
||||||
|
|
||||||
|
Packages targetPackages = createPackages(desc);
|
||||||
|
packages.append(targetPackages);
|
||||||
|
mcuTargets.emplace_back(new McuTarget{QVersionNumber::fromString(desc.qulVersion),
|
||||||
|
platform,
|
||||||
|
deduceOperatingSystem(desc),
|
||||||
|
targetPackages,
|
||||||
|
new McuToolChainPackage{{}, {}, {}, {}, {}},
|
||||||
|
colorDepth});
|
||||||
|
}
|
||||||
|
return {mcuTargets, packages};
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<PackageDescription> aggregatePackageEntries(const McuTargetDescription &desc)
|
||||||
|
{
|
||||||
|
QList<PackageDescription> result;
|
||||||
|
result.append(desc.boardSdk.packages);
|
||||||
|
result.append(desc.freeRTOS.packages);
|
||||||
|
result.append(desc.toolchain.packages);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
Packages McuTargetFactory::createPackages(const McuTargetDescription &desc)
|
||||||
|
{
|
||||||
|
Packages packages;
|
||||||
|
QList<PackageDescription> packageDescriptions = aggregatePackageEntries(desc);
|
||||||
|
|
||||||
|
for (const PackageDescription &pkgDesc : packageDescriptions) {
|
||||||
|
packages.emplace_back(new McuPackage{
|
||||||
|
pkgDesc.label,
|
||||||
|
pkgDesc.defaultPath,
|
||||||
|
pkgDesc.validationPath,
|
||||||
|
pkgDesc.setting,
|
||||||
|
pkgDesc.cmakeVar,
|
||||||
|
pkgDesc.envVar,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return packages;
|
return packages;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<McuTarget *> McuTargetFactory::createTargets(const McuTargetDescription &desc)
|
|
||||||
{
|
|
||||||
// OS deduction
|
|
||||||
const auto os = [&] {
|
|
||||||
if (desc.platform.type == McuTargetDescription::TargetType::Desktop)
|
|
||||||
return McuTarget::OS::Desktop;
|
|
||||||
else if (!desc.freeRTOS.envVar.isEmpty())
|
|
||||||
return McuTarget::OS::FreeRTOS;
|
|
||||||
return McuTarget::OS::BareMetal;
|
|
||||||
}();
|
|
||||||
|
|
||||||
QVector<McuTarget *> mcuTargets;
|
|
||||||
McuToolChainPackage *tcPkg = tcPkgs.value(desc.toolchain.id);
|
|
||||||
if (tcPkg)
|
|
||||||
tcPkg->setVersions(desc.toolchain.versions);
|
|
||||||
else
|
|
||||||
tcPkg = createUnsupportedToolChainPackage();
|
|
||||||
for (int colorDepth : desc.platform.colorDepths) {
|
|
||||||
QVector<McuAbstractPackage *> required3rdPartyPkgs;
|
|
||||||
// Desktop toolchains don't need any additional settings
|
|
||||||
if (tcPkg && !tcPkg->isDesktopToolchain()
|
|
||||||
&& tcPkg->toolchainType() != McuToolChainPackage::ToolChainType::Unsupported)
|
|
||||||
required3rdPartyPkgs.append(tcPkg);
|
|
||||||
|
|
||||||
// Add setting specific to platform IDE
|
|
||||||
if (vendorPkgs.contains(desc.platform.vendor))
|
|
||||||
required3rdPartyPkgs.push_back(vendorPkgs.value(desc.platform.vendor));
|
|
||||||
|
|
||||||
// Board SDK specific settings
|
|
||||||
FilePath boardSdkDefaultPath;
|
|
||||||
if (!desc.boardSdk.envVar.isEmpty()) {
|
|
||||||
if (!boardSdkPkgs.contains(desc.boardSdk.envVar)) {
|
|
||||||
auto boardSdkPkg = createBoardSdkPackage(desc);
|
|
||||||
boardSdkPkgs.insert(desc.boardSdk.envVar, boardSdkPkg);
|
|
||||||
}
|
|
||||||
auto boardSdkPkg = boardSdkPkgs.value(desc.boardSdk.envVar);
|
|
||||||
boardSdkPkg->setVersions(desc.boardSdk.versions);
|
|
||||||
boardSdkDefaultPath = boardSdkPkg->defaultPath();
|
|
||||||
required3rdPartyPkgs.append(boardSdkPkg);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Free RTOS specific settings
|
|
||||||
if (!desc.freeRTOS.envVar.isEmpty()) {
|
|
||||||
if (!freeRTOSPkgs.contains(desc.freeRTOS.envVar)) {
|
|
||||||
freeRTOSPkgs.insert(desc.freeRTOS.envVar,
|
|
||||||
createFreeRTOSSourcesPackage(desc.freeRTOS.envVar,
|
|
||||||
boardSdkDefaultPath,
|
|
||||||
desc.freeRTOS.boardSdkSubDir));
|
|
||||||
}
|
|
||||||
required3rdPartyPkgs.append(freeRTOSPkgs.value(desc.freeRTOS.envVar));
|
|
||||||
}
|
|
||||||
|
|
||||||
const McuTarget::Platform platform(
|
|
||||||
{desc.platform.id, desc.platform.name, desc.platform.vendor});
|
|
||||||
auto mcuTarget = new McuTarget(QVersionNumber::fromString(desc.qulVersion),
|
|
||||||
platform,
|
|
||||||
os,
|
|
||||||
required3rdPartyPkgs,
|
|
||||||
tcPkg,
|
|
||||||
colorDepth);
|
|
||||||
mcuTargets.append(mcuTarget);
|
|
||||||
}
|
|
||||||
return mcuTargets;
|
|
||||||
}
|
|
||||||
} // namespace McuSupport::Internal::Sdk
|
} // namespace McuSupport::Internal::Sdk
|
||||||
|
@@ -25,39 +25,15 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QHash>
|
#include "mcuabstracttargetfactory.h"
|
||||||
#include <QVector>
|
|
||||||
|
|
||||||
namespace McuSupport::Internal {
|
namespace McuSupport::Internal::Sdk {
|
||||||
|
|
||||||
class McuAbstractPackage;
|
class McuTargetFactory : public McuAbstractTargetFactory
|
||||||
class McuPackage;
|
|
||||||
class McuTarget;
|
|
||||||
class McuToolChainPackage;
|
|
||||||
|
|
||||||
namespace Sdk {
|
|
||||||
|
|
||||||
struct McuTargetDescription;
|
|
||||||
|
|
||||||
class McuTargetFactory
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
McuTargetFactory(const QHash<QString, McuToolChainPackage *> &tcPkgs,
|
QPair<Targets, Packages> createTargets(const McuTargetDescription &) override;
|
||||||
const QHash<QString, McuPackage *> &vendorPkgs)
|
Packages createPackages(const McuTargetDescription &);
|
||||||
: tcPkgs(tcPkgs)
|
|
||||||
, vendorPkgs(vendorPkgs)
|
|
||||||
{}
|
|
||||||
|
|
||||||
QVector<McuTarget *> createTargets(const McuTargetDescription &description);
|
|
||||||
QVector<McuAbstractPackage *> getMcuPackages() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
const QHash<QString, McuToolChainPackage *> &tcPkgs;
|
|
||||||
const QHash<QString, McuPackage *> &vendorPkgs;
|
|
||||||
|
|
||||||
QHash<QString, McuPackage *> boardSdkPkgs;
|
|
||||||
QHash<QString, McuPackage *> freeRTOSPkgs;
|
|
||||||
}; // struct McuTargetFactory
|
}; // struct McuTargetFactory
|
||||||
|
|
||||||
} // namespace Sdk
|
} // namespace McuSupport::Internal::Sdk
|
||||||
} // namespace McuSupport::Internal
|
|
||||||
|
105
src/plugins/mcusupport/mcutargetfactorylegacy.cpp
Normal file
105
src/plugins/mcusupport/mcutargetfactorylegacy.cpp
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "mcutargetfactorylegacy.h"
|
||||||
|
#include "mcuhelpers.h"
|
||||||
|
#include "mcupackage.h"
|
||||||
|
#include "mcusupportsdk.h"
|
||||||
|
#include "mcusupportversiondetection.h"
|
||||||
|
#include "mcutarget.h"
|
||||||
|
#include "mcutargetdescription.h"
|
||||||
|
|
||||||
|
#include <utils/fileutils.h>
|
||||||
|
#include <QVersionNumber>
|
||||||
|
|
||||||
|
namespace McuSupport::Internal::Sdk {
|
||||||
|
|
||||||
|
QPair<Targets, Packages> McuTargetFactoryLegacy::createTargets(const McuTargetDescription &desc)
|
||||||
|
{
|
||||||
|
QHash<QString, McuAbstractPackage *> boardSdkPkgs;
|
||||||
|
QHash<QString, McuAbstractPackage *> freeRTOSPkgs;
|
||||||
|
Targets mcuTargets;
|
||||||
|
Packages packages;
|
||||||
|
McuToolChainPackage *tcPkg = tcPkgs.value(desc.toolchain.id);
|
||||||
|
if (tcPkg) {
|
||||||
|
tcPkg->setVersions(desc.toolchain.versions);
|
||||||
|
} else {
|
||||||
|
tcPkg = createUnsupportedToolChainPackage();
|
||||||
|
}
|
||||||
|
for (int colorDepth : desc.platform.colorDepths) {
|
||||||
|
Packages required3rdPartyPkgs;
|
||||||
|
// Desktop toolchains don't need any additional settings
|
||||||
|
if (tcPkg && !tcPkg->isDesktopToolchain()
|
||||||
|
&& tcPkg->toolchainType() != McuToolChainPackage::ToolChainType::Unsupported) {
|
||||||
|
required3rdPartyPkgs.emplace_back(tcPkg);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add setting specific to platform IDE.
|
||||||
|
if (vendorPkgs.contains(desc.platform.vendor)) {
|
||||||
|
required3rdPartyPkgs.emplace_back(vendorPkgs.value(desc.platform.vendor));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Board SDK specific settings
|
||||||
|
Utils::FilePath boardSdkDefaultPath;
|
||||||
|
if (!desc.boardSdk.envVar.isEmpty()) {
|
||||||
|
if (!boardSdkPkgs.contains(desc.boardSdk.envVar)) {
|
||||||
|
const McuAbstractPackage *boardSdkPkg = createBoardSdkPackage(desc);
|
||||||
|
boardSdkPkgs.emplace(desc.boardSdk.envVar, boardSdkPkg);
|
||||||
|
}
|
||||||
|
McuAbstractPackage *boardSdkPkg{boardSdkPkgs.value(desc.boardSdk.envVar)};
|
||||||
|
boardSdkPkg->setVersions(desc.boardSdk.versions);
|
||||||
|
boardSdkDefaultPath = boardSdkPkg->defaultPath();
|
||||||
|
required3rdPartyPkgs.emplace_back(boardSdkPkg);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Free RTOS specific settings.
|
||||||
|
if (!desc.freeRTOS.envVar.isEmpty()) {
|
||||||
|
if (!freeRTOSPkgs.contains(desc.freeRTOS.envVar)) {
|
||||||
|
freeRTOSPkgs.emplace(desc.freeRTOS.envVar,
|
||||||
|
createFreeRTOSSourcesPackage(desc.freeRTOS.envVar,
|
||||||
|
boardSdkDefaultPath,
|
||||||
|
desc.freeRTOS.boardSdkSubDir));
|
||||||
|
}
|
||||||
|
required3rdPartyPkgs.emplace_back(freeRTOSPkgs.value(desc.freeRTOS.envVar));
|
||||||
|
}
|
||||||
|
|
||||||
|
packages.append(required3rdPartyPkgs);
|
||||||
|
const McuTarget::Platform platform(
|
||||||
|
{desc.platform.id, desc.platform.name, desc.platform.vendor});
|
||||||
|
mcuTargets.push_back(new McuTarget{QVersionNumber::fromString(desc.qulVersion),
|
||||||
|
platform,
|
||||||
|
deduceOperatingSystem(desc),
|
||||||
|
required3rdPartyPkgs,
|
||||||
|
tcPkg,
|
||||||
|
colorDepth});
|
||||||
|
}
|
||||||
|
return {mcuTargets, packages};
|
||||||
|
}
|
||||||
|
|
||||||
|
McuTargetFactoryLegacy::AdditionalPackages McuTargetFactoryLegacy::getAdditionalPackages() const
|
||||||
|
{
|
||||||
|
return {tcPkgs, vendorPkgs};
|
||||||
|
}
|
||||||
|
} // namespace McuSupport::Internal::Sdk
|
54
src/plugins/mcusupport/mcutargetfactorylegacy.h
Normal file
54
src/plugins/mcusupport/mcutargetfactorylegacy.h
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2022 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator.
|
||||||
|
**
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU
|
||||||
|
** General Public License version 3 as published by the Free Software
|
||||||
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
||||||
|
** included in the packaging of this file. Please review the following
|
||||||
|
** information to ensure the GNU General Public License requirements will
|
||||||
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "mcuabstracttargetfactory.h"
|
||||||
|
|
||||||
|
#include <QHash>
|
||||||
|
#include <QPair>
|
||||||
|
|
||||||
|
namespace McuSupport::Internal::Sdk {
|
||||||
|
|
||||||
|
class McuTargetFactoryLegacy : public McuAbstractTargetFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
McuTargetFactoryLegacy(const QHash<QString, McuToolChainPackage *> &tcPkgs,
|
||||||
|
const QHash<QString, McuAbstractPackage *> &vendorPkgs)
|
||||||
|
: tcPkgs(tcPkgs)
|
||||||
|
, vendorPkgs(vendorPkgs)
|
||||||
|
{}
|
||||||
|
|
||||||
|
QPair<Targets, Packages> createTargets(const McuTargetDescription &) override;
|
||||||
|
using AdditionalPackages
|
||||||
|
= QPair<QHash<QString, McuToolChainPackage *>, QHash<QString, McuAbstractPackage *>>;
|
||||||
|
AdditionalPackages getAdditionalPackages() const override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
const QHash<QString, McuToolChainPackage *> tcPkgs;
|
||||||
|
const QHash<QString, McuAbstractPackage *> vendorPkgs;
|
||||||
|
}; // struct McuTargetFactoryLegacy
|
||||||
|
|
||||||
|
} // namespace McuSupport::Internal::Sdk
|
@@ -36,7 +36,7 @@ constexpr auto armgcc_nxp_1050_json = R"({
|
|||||||
],
|
],
|
||||||
"pathEntries": [],
|
"pathEntries": [],
|
||||||
"environmentEntries": [],
|
"environmentEntries": [],
|
||||||
"cmakeCacheEntries": [
|
"cmakeEntries": [
|
||||||
{
|
{
|
||||||
"id": "Qul_DIR",
|
"id": "Qul_DIR",
|
||||||
"description": "Qt for MCUs SDK",
|
"description": "Qt for MCUs SDK",
|
||||||
@@ -62,7 +62,7 @@ constexpr auto armgcc_nxp_1050_json = R"({
|
|||||||
"versions": [
|
"versions": [
|
||||||
"9.3.1"
|
"9.3.1"
|
||||||
],
|
],
|
||||||
"cmakeCacheEntries": [
|
"cmakeEntries": [
|
||||||
{
|
{
|
||||||
"id": "ARMGCC_DIR",
|
"id": "ARMGCC_DIR",
|
||||||
"description": "GNU Arm Embedded Toolchain",
|
"description": "GNU Arm Embedded Toolchain",
|
||||||
@@ -86,7 +86,7 @@ constexpr auto armgcc_nxp_1050_json = R"({
|
|||||||
"versions": [
|
"versions": [
|
||||||
"2.10.0"
|
"2.10.0"
|
||||||
],
|
],
|
||||||
"cmakeCacheEntries": [
|
"cmakeEntries": [
|
||||||
{
|
{
|
||||||
"id": "NXP_SDK_DIR",
|
"id": "NXP_SDK_DIR",
|
||||||
"description": "Board SDK for MIMXRT1050-EVK",
|
"description": "Board SDK for MIMXRT1050-EVK",
|
||||||
@@ -98,7 +98,7 @@ constexpr auto armgcc_nxp_1050_json = R"({
|
|||||||
},
|
},
|
||||||
"freeRTOS": {
|
"freeRTOS": {
|
||||||
"envVar": "IMXRT1050_FREERTOS_DIR",
|
"envVar": "IMXRT1050_FREERTOS_DIR",
|
||||||
"cmakeCacheEntries": [
|
"cmakeEntries": [
|
||||||
{
|
{
|
||||||
"id": "NXP_FREERTOS_DIR",
|
"id": "NXP_FREERTOS_DIR",
|
||||||
"description": "FreeRTOS SDK for MIMXRT1050-EVK",
|
"description": "FreeRTOS SDK for MIMXRT1050-EVK",
|
||||||
|
@@ -29,13 +29,14 @@ constexpr auto armgcc_nxp_1064_json = R"({
|
|||||||
"compatVersion": "1",
|
"compatVersion": "1",
|
||||||
"qulVersion": "2.0.0",
|
"qulVersion": "2.0.0",
|
||||||
"boardSdk": {
|
"boardSdk": {
|
||||||
"cmakeCacheEntries": [
|
"cmakeEntries": [
|
||||||
{
|
{
|
||||||
"cmakeOptionName": "QUL_BOARD_SDK_DIR",
|
"cmakeOptionName": "QUL_BOARD_SDK_DIR",
|
||||||
"description": "Board SDK for MIMXRT1064-EVK",
|
"description": "Board SDK for MIMXRT1064-EVK",
|
||||||
"id": "NXP_SDK_DIR",
|
"id": "NXP_SDK_DIR",
|
||||||
"optional": false,
|
"optional": false,
|
||||||
"type": "path"
|
"type": "path",
|
||||||
|
"versions": ["2.10.0"]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"envVar": "EVK_MIMXRT1064_SDK_PATH",
|
"envVar": "EVK_MIMXRT1064_SDK_PATH",
|
||||||
@@ -43,10 +44,12 @@ constexpr auto armgcc_nxp_1064_json = R"({
|
|||||||
},
|
},
|
||||||
"compatVersion": "1",
|
"compatVersion": "1",
|
||||||
"freeRTOS": {
|
"freeRTOS": {
|
||||||
"cmakeCacheEntries": [
|
"cmakeEntries": [
|
||||||
{
|
{
|
||||||
"cmakeOptionName": "FREERTOS_DIR",
|
"envVar": "IMXRT1064_FREERTOS_DIR",
|
||||||
|
"cmakeVar": "FREERTOS_DIR",
|
||||||
"defaultValue": "$QUL_BOARD_SDK_DIR/rtos/freertos/freertos_kernel",
|
"defaultValue": "$QUL_BOARD_SDK_DIR/rtos/freertos/freertos_kernel",
|
||||||
|
"label": "FreeRTOS Sources (IMXRT1064) ",
|
||||||
"description": "FreeRTOS SDK for MIMXRT1064-EVK",
|
"description": "FreeRTOS SDK for MIMXRT1064-EVK",
|
||||||
"id": "NXP_FREERTOS_DIR",
|
"id": "NXP_FREERTOS_DIR",
|
||||||
"optional": false,
|
"optional": false,
|
||||||
@@ -56,7 +59,7 @@ constexpr auto armgcc_nxp_1064_json = R"({
|
|||||||
"envVar": "IMXRT1064_FREERTOS_DIR"
|
"envVar": "IMXRT1064_FREERTOS_DIR"
|
||||||
},
|
},
|
||||||
"platform": {
|
"platform": {
|
||||||
"cmakeCacheEntries": [
|
"cmakeEntries": [
|
||||||
{
|
{
|
||||||
"cmakeOptionName": "Qul_ROOT",
|
"cmakeOptionName": "Qul_ROOT",
|
||||||
"description": "Qt for MCUs SDK",
|
"description": "Qt for MCUs SDK",
|
||||||
@@ -80,7 +83,7 @@ constexpr auto armgcc_nxp_1064_json = R"({
|
|||||||
},
|
},
|
||||||
"qulVersion": "2.0.0",
|
"qulVersion": "2.0.0",
|
||||||
"toolchain": {
|
"toolchain": {
|
||||||
"cmakeCacheEntries": [
|
"cmakeEntries": [
|
||||||
{
|
{
|
||||||
"cmakeOptionName": "QUL_TARGET_TOOLCHAIN_DIR",
|
"cmakeOptionName": "QUL_TARGET_TOOLCHAIN_DIR",
|
||||||
"description": "IAR ARM Compiler",
|
"description": "IAR ARM Compiler",
|
||||||
|
@@ -47,7 +47,7 @@ constexpr auto iar_stm32f469i_metal_json = R"({
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"environmentEntries": [],
|
"environmentEntries": [],
|
||||||
"cmakeCacheEntries": [
|
"cmakeEntries": [
|
||||||
{
|
{
|
||||||
"id": "Qul_DIR",
|
"id": "Qul_DIR",
|
||||||
"description": "Qt for MCUs SDK",
|
"description": "Qt for MCUs SDK",
|
||||||
@@ -62,7 +62,7 @@ constexpr auto iar_stm32f469i_metal_json = R"({
|
|||||||
"versions": [
|
"versions": [
|
||||||
"8.50.9"
|
"8.50.9"
|
||||||
],
|
],
|
||||||
"cmakeCacheEntries": [
|
"cmakeEntries": [
|
||||||
{
|
{
|
||||||
"id": "IARToolchain",
|
"id": "IARToolchain",
|
||||||
"envVar": "IAR_ARM_COMPILER_DIR",
|
"envVar": "IAR_ARM_COMPILER_DIR",
|
||||||
@@ -87,7 +87,7 @@ constexpr auto iar_stm32f469i_metal_json = R"({
|
|||||||
"versions": [
|
"versions": [
|
||||||
"1.25.0"
|
"1.25.0"
|
||||||
],
|
],
|
||||||
"cmakeCacheEntries": [
|
"cmakeEntries": [
|
||||||
{
|
{
|
||||||
"id": "ST_SDK_DIR",
|
"id": "ST_SDK_DIR",
|
||||||
"description": "Board SDK for STM32F469I-Discovery",
|
"description": "Board SDK for STM32F469I-Discovery",
|
||||||
|
@@ -29,10 +29,13 @@
|
|||||||
#include "armgcc_stm32f769i_freertos_json.h"
|
#include "armgcc_stm32f769i_freertos_json.h"
|
||||||
#include "armgcc_stm32h750b_metal_json.h"
|
#include "armgcc_stm32h750b_metal_json.h"
|
||||||
#include "iar_stm32f469i_metal_json.h"
|
#include "iar_stm32f469i_metal_json.h"
|
||||||
|
#include "mcuhelpers.h"
|
||||||
#include "mcukitmanager.h"
|
#include "mcukitmanager.h"
|
||||||
#include "mcusupportconstants.h"
|
#include "mcusupportconstants.h"
|
||||||
#include "mcusupportsdk.h"
|
#include "mcusupportsdk.h"
|
||||||
#include "mcutargetdescription.h"
|
#include "mcutargetdescription.h"
|
||||||
|
#include "mcutargetfactory.h"
|
||||||
|
#include "mcutargetfactorylegacy.h"
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/filepath.h>
|
#include <utils/filepath.h>
|
||||||
|
|
||||||
@@ -42,35 +45,35 @@
|
|||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
#include <qtestcase.h>
|
#include <qtestcase.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <ciso646>
|
#include <ciso646>
|
||||||
|
|
||||||
namespace McuSupport::Internal::Test {
|
namespace McuSupport::Internal::Test {
|
||||||
|
|
||||||
|
namespace {
|
||||||
// clazy:excludeall=non-pod-global-static
|
// clazy:excludeall=non-pod-global-static
|
||||||
static const QString nxp1050FreeRtosEnvVar{"IMXRT1050_FREERTOS_DIR"};
|
const QString freeRtosCMakeVar{"FREERTOS_DIR"};
|
||||||
static const QString nxp1064FreeRtosEnvVar{"IMXRT1064_FREERTOS_DIR"};
|
const QString nxp1050FreeRtosEnvVar{"IMXRT1050_FREERTOS_DIR"};
|
||||||
static const QString nxp1170FreeRtosEnvVar{"EVK_MIMXRT1170_FREERTOS_PATH"};
|
const QString nxp1064FreeRtosEnvVar{"IMXRT1064_FREERTOS_DIR"};
|
||||||
static const QString stm32f7FreeRtosEnvVar{"STM32F7_FREERTOS_DIR"};
|
const QString nxp1170FreeRtosEnvVar{"EVK_MIMXRT1170_FREERTOS_PATH"};
|
||||||
static const QString stm32f7{"STM32F7"};
|
const QString stm32f7FreeRtosEnvVar{"STM32F7_FREERTOS_DIR"};
|
||||||
static const QString nxp1170{"EVK_MIMXRT1170"};
|
const QString stm32f7{"STM32F7"};
|
||||||
static const QString nxp1050{"IMXRT1050"};
|
const QString nxp1170{"EVK_MIMXRT1170_"};
|
||||||
static const QString nxp1064{"IMXRT1064"};
|
const QString nxp1050{"IMXRT1050"};
|
||||||
|
const QString nxp1064{"IMXRT1064"};
|
||||||
static const QStringList jsonFiles{QString::fromUtf8(armgcc_nxp_1050_json),
|
const QStringList jsonFiles{armgcc_nxp_1050_json, armgcc_nxp_1064_json};
|
||||||
QString::fromUtf8(armgcc_nxp_1064_json)};
|
constexpr bool RUN_LEGACY{true};
|
||||||
|
constexpr int colorDepth{32};
|
||||||
|
const QString id{"id"};
|
||||||
|
} // namespace
|
||||||
|
|
||||||
using CMakeProjectManager::CMakeConfigItem;
|
using CMakeProjectManager::CMakeConfigItem;
|
||||||
using CMakeProjectManager::CMakeConfigurationKitAspect;
|
using CMakeProjectManager::CMakeConfigurationKitAspect;
|
||||||
using ProjectExplorer::EnvironmentKitAspect;
|
|
||||||
using ProjectExplorer::KitManager;
|
using ProjectExplorer::KitManager;
|
||||||
using testing::Return;
|
|
||||||
using testing::ReturnRef;
|
|
||||||
using Utils::FilePath;
|
using Utils::FilePath;
|
||||||
|
|
||||||
void McuSupportTest::initTestCase()
|
void McuSupportTest::initTestCase() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void McuSupportTest::test_parseBasicInfoFromJson()
|
void McuSupportTest::test_parseBasicInfoFromJson()
|
||||||
{
|
{
|
||||||
@@ -80,6 +83,15 @@ void McuSupportTest::test_parseBasicInfoFromJson()
|
|||||||
QVERIFY(description.freeRTOS.boardSdkSubDir.isEmpty());
|
QVERIFY(description.freeRTOS.boardSdkSubDir.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void McuSupportTest::test_parseCmakeEntries()
|
||||||
|
{
|
||||||
|
const auto description{Sdk::parseDescriptionJson(armgcc_nxp_1064_json)};
|
||||||
|
|
||||||
|
QVERIFY(not description.freeRTOS.packages.isEmpty());
|
||||||
|
auto &freeRtosPackage = description.freeRTOS.packages[0];
|
||||||
|
QCOMPARE(freeRtosPackage.envVar, nxp1064FreeRtosEnvVar);
|
||||||
|
}
|
||||||
|
|
||||||
void McuSupportTest::test_addNewKit()
|
void McuSupportTest::test_addNewKit()
|
||||||
{
|
{
|
||||||
const QString cmakeVar = "CMAKE_SDK";
|
const QString cmakeVar = "CMAKE_SDK";
|
||||||
@@ -89,10 +101,10 @@ void McuSupportTest::test_addNewKit()
|
|||||||
"sdk", // settingsKey
|
"sdk", // settingsKey
|
||||||
cmakeVar, // cmake var
|
cmakeVar, // cmake var
|
||||||
{}}; // env var
|
{}}; // env var
|
||||||
Kit kit;
|
ProjectExplorer::Kit kit;
|
||||||
|
|
||||||
McuToolChainPackage toolchainPackage{
|
McuToolChainPackage
|
||||||
{}, // label
|
toolchainPackage{{}, // label
|
||||||
{}, // defaultPath
|
{}, // defaultPath
|
||||||
{}, // detectionPath
|
{}, // detectionPath
|
||||||
{}, // settingsKey
|
{}, // settingsKey
|
||||||
@@ -115,15 +127,17 @@ void McuSupportTest::test_addNewKit()
|
|||||||
|
|
||||||
QCOMPARE(kitAddedSpy.count(), 1);
|
QCOMPARE(kitAddedSpy.count(), 1);
|
||||||
QList<QVariant> arguments = kitAddedSpy.takeFirst();
|
QList<QVariant> arguments = kitAddedSpy.takeFirst();
|
||||||
auto *createdKit = qvariant_cast<Kit *>(arguments.at(0));
|
auto *createdKit = qvariant_cast<ProjectExplorer::Kit *>(arguments.at(0));
|
||||||
QVERIFY(createdKit != nullptr);
|
QVERIFY(createdKit != nullptr);
|
||||||
QCOMPARE(createdKit, newKit);
|
QCOMPARE(createdKit, newKit);
|
||||||
|
|
||||||
const auto config = CMakeConfigurationKitAspect::configuration(newKit);
|
const auto config = CMakeConfigurationKitAspect::configuration(newKit);
|
||||||
QVERIFY(config.size() > 0);
|
QVERIFY(config.size() > 0);
|
||||||
QVERIFY(Utils::indexOf(config.toVector(), [&cmakeVar](const CMakeConfigItem &item) {
|
QVERIFY(Utils::indexOf(config.toVector(),
|
||||||
|
[&cmakeVar](const CMakeConfigItem &item) {
|
||||||
return item.key == cmakeVar.toUtf8();
|
return item.key == cmakeVar.toUtf8();
|
||||||
}) != -1);
|
})
|
||||||
|
!= -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void McuSupportTest::test_createPackagesWithCorrespondingSettings_data()
|
void McuSupportTest::test_createPackagesWithCorrespondingSettings_data()
|
||||||
@@ -164,9 +178,8 @@ void McuSupportTest::test_createPackagesWithCorrespondingSettings_data()
|
|||||||
void McuSupportTest::test_createPackagesWithCorrespondingSettings()
|
void McuSupportTest::test_createPackagesWithCorrespondingSettings()
|
||||||
{
|
{
|
||||||
QFETCH(QString, json);
|
QFETCH(QString, json);
|
||||||
const auto description = Sdk::parseDescriptionJson(json.toLocal8Bit());
|
const Sdk::McuTargetDescription description = Sdk::parseDescriptionJson(json.toLocal8Bit());
|
||||||
QVector<McuAbstractPackage *> packages;
|
const auto [targets, packages]{Sdk::targetsFromDescriptions({description}, RUN_LEGACY)};
|
||||||
const auto targets = Sdk::targetsFromDescriptions({description}, &packages);
|
|
||||||
Q_UNUSED(targets);
|
Q_UNUSED(targets);
|
||||||
|
|
||||||
QSet<QString> settings = Utils::transform<QSet<QString>>(packages, [](const auto &package) {
|
QSet<QString> settings = Utils::transform<QSet<QString>>(packages, [](const auto &package) {
|
||||||
@@ -176,4 +189,111 @@ void McuSupportTest::test_createPackagesWithCorrespondingSettings()
|
|||||||
QVERIFY(settings.contains(expectedSettings));
|
QVERIFY(settings.contains(expectedSettings));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void McuSupportTest::test_createFreeRtosPackageWithCorrectSetting_data()
|
||||||
|
{
|
||||||
|
QTest::addColumn<QString>("freeRtosEnvVar");
|
||||||
|
QTest::addColumn<QString>("expectedSettingsKey");
|
||||||
|
|
||||||
|
QTest::newRow("nxp1050") << nxp1050FreeRtosEnvVar
|
||||||
|
<< QString{Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append(nxp1050);
|
||||||
|
QTest::newRow("nxp1064") << nxp1064FreeRtosEnvVar
|
||||||
|
<< QString{Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append(nxp1064);
|
||||||
|
QTest::newRow("nxp1170") << nxp1170FreeRtosEnvVar
|
||||||
|
<< QString{Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append(nxp1170);
|
||||||
|
QTest::newRow("stm32f7") << stm32f7FreeRtosEnvVar
|
||||||
|
<< QString{Constants::SETTINGS_KEY_FREERTOS_PREFIX}.append(stm32f7);
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO(piotr.mucko): Enable when mcutargetfactory is delivered.
|
||||||
|
void McuSupportTest::test_createFreeRtosPackageWithCorrectSetting()
|
||||||
|
{
|
||||||
|
// Sdk::targetsAndPackages(jsonFile, &mcuSdkRepo);
|
||||||
|
//
|
||||||
|
// QVector<Package *> mcuPackages;
|
||||||
|
// auto mcuTargets = Sdk::targetsFromDescriptions({description}, &mcuPackages);
|
||||||
|
// QVERIFY(mcuPackages contains freertos package)
|
||||||
|
// QVERIFY(freertos package is not empty & has proper value)
|
||||||
|
|
||||||
|
// McuSupportOptions mcuSuportOptions{};
|
||||||
|
// mcuSuportOptions.createAutomaticKits();
|
||||||
|
|
||||||
|
QFETCH(QString, freeRtosEnvVar);
|
||||||
|
QFETCH(QString, expectedSettingsKey);
|
||||||
|
|
||||||
|
auto *package{Sdk::createFreeRTOSSourcesPackage(freeRtosEnvVar, FilePath{}, QString{})};
|
||||||
|
QVERIFY(package != nullptr);
|
||||||
|
|
||||||
|
QCOMPARE(package->settingsKey(), expectedSettingsKey);
|
||||||
|
|
||||||
|
// QVERIFY(freertos package is not empty & has proper value)
|
||||||
|
// static McuPackage *createFreeRTOSSourcesPackage(const QString &envVar,
|
||||||
|
// const FilePath &boardSdkDir,
|
||||||
|
// const QString &freeRTOSBoardSdkSubDir)
|
||||||
|
// createFreeRtosPackage
|
||||||
|
// verify that package's setting is Package_FreeRTOSSourcePackage_IMXRT1064.
|
||||||
|
//TODO(me): write settings
|
||||||
|
// auto *freeRtosPackage
|
||||||
|
// = new McuPackage;
|
||||||
|
// freeRtosPackage->writeToSettings();
|
||||||
|
//TODO(me): verify that setting is the same as in 2.0.0
|
||||||
|
}
|
||||||
|
|
||||||
|
void McuSupportTest::test_createTargetsTheNewWay_data() {}
|
||||||
|
|
||||||
|
void McuSupportTest::test_createTargetsTheNewWay()
|
||||||
|
{
|
||||||
|
Sdk::PackageDescription packageDescription{id,
|
||||||
|
nxp1064FreeRtosEnvVar,
|
||||||
|
freeRtosCMakeVar,
|
||||||
|
"setting",
|
||||||
|
"Freertos directory",
|
||||||
|
"/opt/freertos/1064",
|
||||||
|
"",
|
||||||
|
{},
|
||||||
|
true};
|
||||||
|
|
||||||
|
Sdk::McuTargetDescription description{
|
||||||
|
"2.0.1",
|
||||||
|
"2",
|
||||||
|
{id, "", "", {colorDepth}, Sdk::McuTargetDescription::TargetType::MCU},
|
||||||
|
{}, // toolchain
|
||||||
|
{}, // boardSDK
|
||||||
|
{"", "", {packageDescription}}, //freertos
|
||||||
|
};
|
||||||
|
|
||||||
|
Sdk::McuTargetFactory targetFactory{};
|
||||||
|
const auto [targets, packages]{targetFactory.createTargets(description)};
|
||||||
|
QVERIFY(not targets.empty());
|
||||||
|
QCOMPARE(targets.at(0)->colorDepth(), colorDepth);
|
||||||
|
const auto &tgtPackages{targets.at(0)->packages()};
|
||||||
|
QVERIFY(not tgtPackages.empty());
|
||||||
|
const auto rtosPackage{tgtPackages.first()};
|
||||||
|
QCOMPARE(rtosPackage->environmentVariableName(), nxp1064FreeRtosEnvVar);
|
||||||
|
}
|
||||||
|
|
||||||
|
void McuSupportTest::test_createPackages()
|
||||||
|
{
|
||||||
|
Sdk::PackageDescription packageDescription{id,
|
||||||
|
nxp1064FreeRtosEnvVar,
|
||||||
|
freeRtosCMakeVar,
|
||||||
|
"Freertos directory",
|
||||||
|
"setting",
|
||||||
|
"/opt/freertos/1064",
|
||||||
|
"",
|
||||||
|
{},
|
||||||
|
true};
|
||||||
|
Sdk::McuTargetDescription targetDescription{
|
||||||
|
"2.0.1",
|
||||||
|
"2",
|
||||||
|
{id, id, id, {colorDepth}, Sdk::McuTargetDescription::TargetType::MCU},
|
||||||
|
{}, // toolchain
|
||||||
|
{}, // boardSDK
|
||||||
|
{"", "", {packageDescription}}, //freertos
|
||||||
|
};
|
||||||
|
|
||||||
|
Sdk::McuTargetFactory targetFactory;
|
||||||
|
const auto packages{targetFactory.createPackages(targetDescription)};
|
||||||
|
QVERIFY(not packages.empty());
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace McuSupport::Internal::Test
|
} // namespace McuSupport::Internal::Test
|
||||||
|
@@ -43,8 +43,6 @@
|
|||||||
|
|
||||||
namespace McuSupport::Internal::Test {
|
namespace McuSupport::Internal::Test {
|
||||||
|
|
||||||
using ProjectExplorer::Kit;
|
|
||||||
|
|
||||||
class McuSupportTest : public QObject
|
class McuSupportTest : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -56,6 +54,12 @@ private slots:
|
|||||||
void test_parseBasicInfoFromJson();
|
void test_parseBasicInfoFromJson();
|
||||||
void test_createPackagesWithCorrespondingSettings();
|
void test_createPackagesWithCorrespondingSettings();
|
||||||
void test_createPackagesWithCorrespondingSettings_data();
|
void test_createPackagesWithCorrespondingSettings_data();
|
||||||
|
void test_createFreeRtosPackageWithCorrectSetting_data();
|
||||||
|
void test_createFreeRtosPackageWithCorrectSetting();
|
||||||
|
void test_createTargetsTheNewWay_data();
|
||||||
|
void test_createTargetsTheNewWay();
|
||||||
|
void test_createPackages();
|
||||||
|
void test_parseCmakeEntries();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVersionNumber currentQulVersion{2, 0};
|
QVersionNumber currentQulVersion{2, 0};
|
||||||
@@ -67,7 +71,6 @@ private:
|
|||||||
const QString freeRtosEnvVar{"EVK_MIMXRT1170_FREERTOS_PATH"};
|
const QString freeRtosEnvVar{"EVK_MIMXRT1170_FREERTOS_PATH"};
|
||||||
const QString freeRtosCmakeVar{"FREERTOS_DIR"};
|
const QString freeRtosCmakeVar{"FREERTOS_DIR"};
|
||||||
const QString defaultfreeRtosPath{"/opt/freertos/default"};
|
const QString defaultfreeRtosPath{"/opt/freertos/default"};
|
||||||
|
|
||||||
}; // class McuSupportTest
|
}; // class McuSupportTest
|
||||||
|
|
||||||
} // namespace McuSupport::Internal::Test
|
} // namespace McuSupport::Internal::Test
|
||||||
|
Reference in New Issue
Block a user