forked from qt-creator/qt-creator
Boot2Qt: Inline QdbDeployConfigurationFactory
Change-Id: I8257126a2ed53adca5b04e04a2182381afa7390c Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -6,7 +6,6 @@ add_qtc_plugin(Boot2Qt
|
|||||||
qdb.qrc
|
qdb.qrc
|
||||||
qdb_global.h
|
qdb_global.h
|
||||||
qdbconstants.h
|
qdbconstants.h
|
||||||
qdbdeployconfigurationfactory.cpp qdbdeployconfigurationfactory.h
|
|
||||||
qdbdevice.cpp qdbdevice.h
|
qdbdevice.cpp qdbdevice.h
|
||||||
qdbdevicedebugsupport.cpp qdbdevicedebugsupport.h
|
qdbdevicedebugsupport.cpp qdbdevicedebugsupport.h
|
||||||
qdbmakedefaultappstep.cpp qdbmakedefaultappstep.h
|
qdbmakedefaultappstep.cpp qdbmakedefaultappstep.h
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ QtcPlugin {
|
|||||||
"qdbutils.h",
|
"qdbutils.h",
|
||||||
"qdbconstants.h",
|
"qdbconstants.h",
|
||||||
"qdb_global.h",
|
"qdb_global.h",
|
||||||
"qdbdeployconfigurationfactory.cpp",
|
|
||||||
"qdbdeployconfigurationfactory.h",
|
|
||||||
"qdbdevice.cpp",
|
"qdbdevice.cpp",
|
||||||
"qdbdevice.h",
|
"qdbdevice.h",
|
||||||
"qdbdevicedebugsupport.cpp",
|
"qdbdevicedebugsupport.cpp",
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
// Copyright (C) 2019 The Qt Company Ltd.
|
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
||||||
|
|
||||||
#include "qdbdeployconfigurationfactory.h"
|
|
||||||
|
|
||||||
#include "qdbconstants.h"
|
|
||||||
#include "qdbtr.h"
|
|
||||||
|
|
||||||
#include <projectexplorer/deploymentdataview.h>
|
|
||||||
#include <projectexplorer/devicesupport/idevice.h>
|
|
||||||
#include <projectexplorer/kitaspects.h>
|
|
||||||
#include <projectexplorer/project.h>
|
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
|
||||||
#include <projectexplorer/target.h>
|
|
||||||
|
|
||||||
#include <remotelinux/remotelinux_constants.h>
|
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
|
||||||
|
|
||||||
namespace Qdb::Internal {
|
|
||||||
|
|
||||||
QdbDeployConfigurationFactory::QdbDeployConfigurationFactory()
|
|
||||||
{
|
|
||||||
setConfigBaseId(Constants::QdbDeployConfigurationId);
|
|
||||||
addSupportedTargetDeviceType(Constants::QdbLinuxOsType);
|
|
||||||
setDefaultDisplayName(Tr::tr("Deploy to Boot2Qt target"));
|
|
||||||
setUseDeploymentDataView();
|
|
||||||
|
|
||||||
addInitialStep(RemoteLinux::Constants::MakeInstallStepId, [](Target *target) {
|
|
||||||
const Project * const prj = target->project();
|
|
||||||
return prj->deploymentKnowledge() == DeploymentKnowledge::Bad
|
|
||||||
&& prj->hasMakeInstallEquivalent();
|
|
||||||
});
|
|
||||||
addInitialStep(Qdb::Constants::QdbStopApplicationStepId);
|
|
||||||
addInitialStep(RemoteLinux::Constants::RsyncDeployStepId, [](Target *target) {
|
|
||||||
auto device = DeviceKitAspect::device(target->kit());
|
|
||||||
auto buildDevice = BuildDeviceKitAspect::device(target->kit());
|
|
||||||
if (buildDevice && buildDevice->rootPath().needsDevice())
|
|
||||||
return false;
|
|
||||||
return !device
|
|
||||||
|| (device && device->extraData(ProjectExplorer::Constants::SUPPORTS_RSYNC).toBool());
|
|
||||||
});
|
|
||||||
addInitialStep(RemoteLinux::Constants::DirectUploadStepId, [](Target *target) {
|
|
||||||
auto device = DeviceKitAspect::device(target->kit());
|
|
||||||
auto buildDevice = BuildDeviceKitAspect::device(target->kit());
|
|
||||||
if (buildDevice && buildDevice->rootPath().needsDevice())
|
|
||||||
return false;
|
|
||||||
return device && !device->extraData(ProjectExplorer::Constants::SUPPORTS_RSYNC).toBool();
|
|
||||||
});
|
|
||||||
// This step is for:
|
|
||||||
// a) A remote build device, as they do not support real rsync yet.
|
|
||||||
// b) If there is no target device setup yet.
|
|
||||||
addInitialStep(RemoteLinux::Constants::DirectUploadStepId, [](Target *target) {
|
|
||||||
auto device = DeviceKitAspect::device(target->kit());
|
|
||||||
auto buildDevice = BuildDeviceKitAspect::device(target->kit());
|
|
||||||
if (buildDevice && buildDevice->rootPath().needsDevice())
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
} // Qdb::Internal
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
// Copyright (C) 2019 The Qt Company Ltd.
|
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <projectexplorer/deployconfiguration.h>
|
|
||||||
|
|
||||||
namespace Qdb::Internal {
|
|
||||||
|
|
||||||
class QdbDeployConfigurationFactory final : public ProjectExplorer::DeployConfigurationFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
QdbDeployConfigurationFactory();
|
|
||||||
};
|
|
||||||
|
|
||||||
} // Qdb::Internal
|
|
||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include "device-detection/devicedetector.h"
|
#include "device-detection/devicedetector.h"
|
||||||
#include "qdbconstants.h"
|
#include "qdbconstants.h"
|
||||||
#include "qdbdeployconfigurationfactory.h"
|
|
||||||
#include "qdbdevice.h"
|
#include "qdbdevice.h"
|
||||||
#include "qdbstopapplicationstep.h"
|
#include "qdbstopapplicationstep.h"
|
||||||
#include "qdbmakedefaultappstep.h"
|
#include "qdbmakedefaultappstep.h"
|
||||||
@@ -19,9 +18,11 @@
|
|||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <projectexplorer/deployconfiguration.h>
|
||||||
#include <projectexplorer/devicesupport/devicemanager.h>
|
#include <projectexplorer/devicesupport/devicemanager.h>
|
||||||
#include <projectexplorer/kitaspects.h>
|
#include <projectexplorer/kitaspects.h>
|
||||||
#include <projectexplorer/kitmanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
@@ -107,6 +108,50 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class QdbDeployConfigurationFactory final : public DeployConfigurationFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QdbDeployConfigurationFactory()
|
||||||
|
{
|
||||||
|
setConfigBaseId(Constants::QdbDeployConfigurationId);
|
||||||
|
addSupportedTargetDeviceType(Constants::QdbLinuxOsType);
|
||||||
|
setDefaultDisplayName(Tr::tr("Deploy to Boot2Qt target"));
|
||||||
|
setUseDeploymentDataView();
|
||||||
|
|
||||||
|
addInitialStep(RemoteLinux::Constants::MakeInstallStepId, [](Target *target) {
|
||||||
|
const Project * const prj = target->project();
|
||||||
|
return prj->deploymentKnowledge() == DeploymentKnowledge::Bad
|
||||||
|
&& prj->hasMakeInstallEquivalent();
|
||||||
|
});
|
||||||
|
addInitialStep(Qdb::Constants::QdbStopApplicationStepId);
|
||||||
|
addInitialStep(RemoteLinux::Constants::RsyncDeployStepId, [](Target *target) {
|
||||||
|
auto device = DeviceKitAspect::device(target->kit());
|
||||||
|
auto buildDevice = BuildDeviceKitAspect::device(target->kit());
|
||||||
|
if (buildDevice && buildDevice->rootPath().needsDevice())
|
||||||
|
return false;
|
||||||
|
return !device || (device
|
||||||
|
&& device->extraData(ProjectExplorer::Constants::SUPPORTS_RSYNC).toBool());
|
||||||
|
});
|
||||||
|
addInitialStep(RemoteLinux::Constants::DirectUploadStepId, [](Target *target) {
|
||||||
|
auto device = DeviceKitAspect::device(target->kit());
|
||||||
|
auto buildDevice = BuildDeviceKitAspect::device(target->kit());
|
||||||
|
if (buildDevice && buildDevice->rootPath().needsDevice())
|
||||||
|
return false;
|
||||||
|
return device && !device->extraData(ProjectExplorer::Constants::SUPPORTS_RSYNC).toBool();
|
||||||
|
});
|
||||||
|
// This step is for:
|
||||||
|
// a) A remote build device, as they do not support real rsync yet.
|
||||||
|
// b) If there is no target device setup yet.
|
||||||
|
addInitialStep(RemoteLinux::Constants::DirectUploadStepId, [](Target *target) {
|
||||||
|
auto device = DeviceKitAspect::device(target->kit());
|
||||||
|
auto buildDevice = BuildDeviceKitAspect::device(target->kit());
|
||||||
|
if (buildDevice && buildDevice->rootPath().needsDevice())
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class QdbPluginPrivate : public QObject
|
class QdbPluginPrivate : public QObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user