forked from qt-creator/qt-creator
McuSupport: Move McuBuildStep to .cpp
Not needed publicly. Change-Id: I0e8ddd3e260fb87bedc9ea1478e440e99bd2e203 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -2,18 +2,21 @@
|
|||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
#include "mcubuildstep.h"
|
#include "mcubuildstep.h"
|
||||||
|
|
||||||
#include "mcukitmanager.h"
|
#include "mcukitmanager.h"
|
||||||
#include "mculegacyconstants.h"
|
#include "mculegacyconstants.h"
|
||||||
#include "mcusupportconstants.h"
|
#include "mcusupportconstants.h"
|
||||||
|
|
||||||
#include <cmakeprojectmanager/cmakekitinformation.h>
|
#include <cmakeprojectmanager/cmakekitinformation.h>
|
||||||
|
|
||||||
#include <projectexplorer/buildstep.h>
|
#include <projectexplorer/abstractprocessstep.h>
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
#include <projectexplorer/buildsystem.h>
|
#include <projectexplorer/buildsystem.h>
|
||||||
#include <projectexplorer/deployconfiguration.h>
|
#include <projectexplorer/deployconfiguration.h>
|
||||||
#include <projectexplorer/kit.h>
|
#include <projectexplorer/kit.h>
|
||||||
|
#include <projectexplorer/kit.h>
|
||||||
#include <projectexplorer/kitmanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/task.h>
|
#include <projectexplorer/task.h>
|
||||||
#include <projectexplorer/taskhub.h>
|
#include <projectexplorer/taskhub.h>
|
||||||
@@ -23,12 +26,25 @@
|
|||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <utils/aspects.h>
|
#include <utils/aspects.h>
|
||||||
#include <utils/filepath.h>
|
|
||||||
|
|
||||||
|
#include <QTemporaryDir>
|
||||||
#include <QVersionNumber>
|
#include <QVersionNumber>
|
||||||
|
|
||||||
namespace McuSupport::Internal {
|
namespace McuSupport::Internal {
|
||||||
|
|
||||||
|
class DeployMcuProcessStep : public ProjectExplorer::AbstractProcessStep
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static const Utils::Id id;
|
||||||
|
static void showError(const QString &text);
|
||||||
|
|
||||||
|
DeployMcuProcessStep(ProjectExplorer::BuildStepList *bc, Utils::Id id);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString findKitInformation(ProjectExplorer::Kit *kit, const QString &key);
|
||||||
|
QTemporaryDir m_tmpDir;
|
||||||
|
};
|
||||||
|
|
||||||
const Utils::Id DeployMcuProcessStep::id = "QmlProject.Mcu.DeployStep";
|
const Utils::Id DeployMcuProcessStep::id = "QmlProject.Mcu.DeployStep";
|
||||||
|
|
||||||
void DeployMcuProcessStep::showError(const QString &text)
|
void DeployMcuProcessStep::showError(const QString &text)
|
||||||
@@ -117,13 +133,6 @@ QString DeployMcuProcessStep::findKitInformation(ProjectExplorer::Kit *kit, cons
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
MCUBuildStepFactory::MCUBuildStepFactory()
|
|
||||||
: BuildStepFactory()
|
|
||||||
{
|
|
||||||
setDisplayName(QmlProjectManager::Tr::tr("Qt for MCUs Deploy Step"));
|
|
||||||
registerStep<DeployMcuProcessStep>(DeployMcuProcessStep::id);
|
|
||||||
}
|
|
||||||
|
|
||||||
ProjectExplorer::Kit *MCUBuildStepFactory::findMostRecentQulKit()
|
ProjectExplorer::Kit *MCUBuildStepFactory::findMostRecentQulKit()
|
||||||
{
|
{
|
||||||
ProjectExplorer::Kit *mcuKit = nullptr;
|
ProjectExplorer::Kit *mcuKit = nullptr;
|
||||||
@@ -166,4 +175,11 @@ void MCUBuildStepFactory::updateDeployStep(ProjectExplorer::Target *target, bool
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MCUBuildStepFactory::MCUBuildStepFactory()
|
||||||
|
{
|
||||||
|
setDisplayName(QmlProjectManager::Tr::tr("Qt for MCUs Deploy Step"));
|
||||||
|
registerStep<DeployMcuProcessStep>(DeployMcuProcessStep::id);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace McuSupport::Internal
|
} // namespace McuSupport::Internal
|
||||||
|
|||||||
@@ -1,35 +1,17 @@
|
|||||||
// Copyright (C) 2023 The Qt Company Ltd.
|
// Copyright (C) 2023 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <projectexplorer/abstractprocessstep.h>
|
|
||||||
#include <projectexplorer/buildstep.h>
|
#include <projectexplorer/buildstep.h>
|
||||||
#include <projectexplorer/kit.h>
|
|
||||||
#include <projectexplorer/project.h>
|
|
||||||
|
|
||||||
#include <utils/id.h>
|
|
||||||
|
|
||||||
#include <QTemporaryDir>
|
|
||||||
|
|
||||||
namespace McuSupport::Internal {
|
namespace McuSupport::Internal {
|
||||||
|
|
||||||
class DeployMcuProcessStep : public ProjectExplorer::AbstractProcessStep
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static const Utils::Id id;
|
|
||||||
static void showError(const QString &text);
|
|
||||||
|
|
||||||
DeployMcuProcessStep(ProjectExplorer::BuildStepList *bc, Utils::Id id);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QString findKitInformation(ProjectExplorer::Kit *kit, const QString &key);
|
|
||||||
QTemporaryDir m_tmpDir;
|
|
||||||
};
|
|
||||||
|
|
||||||
class MCUBuildStepFactory : public ProjectExplorer::BuildStepFactory
|
class MCUBuildStepFactory : public ProjectExplorer::BuildStepFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MCUBuildStepFactory();
|
MCUBuildStepFactory();
|
||||||
|
|
||||||
static ProjectExplorer::Kit *findMostRecentQulKit();
|
static ProjectExplorer::Kit *findMostRecentQulKit();
|
||||||
static void updateDeployStep(ProjectExplorer::Target *target, bool enabled);
|
static void updateDeployStep(ProjectExplorer::Target *target, bool enabled);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user