forked from qt-creator/qt-creator
Qnx: Remove RunControlFactory
Registering the main runWorkers is enough. Change-Id: I0d2d148c6247e403463b548ca05993e18b0d88ee Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -8,7 +8,6 @@ SOURCES += qnxplugin.cpp \
|
|||||||
qnxdevicefactory.cpp \
|
qnxdevicefactory.cpp \
|
||||||
qnxdevicewizard.cpp \
|
qnxdevicewizard.cpp \
|
||||||
qnxrunconfiguration.cpp \
|
qnxrunconfiguration.cpp \
|
||||||
qnxruncontrolfactory.cpp \
|
|
||||||
qnxanalyzesupport.cpp \
|
qnxanalyzesupport.cpp \
|
||||||
qnxdebugsupport.cpp \
|
qnxdebugsupport.cpp \
|
||||||
qnxdeploystepfactory.cpp \
|
qnxdeploystepfactory.cpp \
|
||||||
@@ -41,7 +40,6 @@ HEADERS += qnxplugin.h\
|
|||||||
qnxdevicefactory.h \
|
qnxdevicefactory.h \
|
||||||
qnxdevicewizard.h \
|
qnxdevicewizard.h \
|
||||||
qnxrunconfiguration.h \
|
qnxrunconfiguration.h \
|
||||||
qnxruncontrolfactory.h \
|
|
||||||
qnxanalyzesupport.h \
|
qnxanalyzesupport.h \
|
||||||
qnxdebugsupport.h \
|
qnxdebugsupport.h \
|
||||||
qnxdeploystepfactory.h \
|
qnxdeploystepfactory.h \
|
||||||
|
@@ -76,8 +76,6 @@ QtcPlugin {
|
|||||||
"qnxrunconfiguration.h",
|
"qnxrunconfiguration.h",
|
||||||
"qnxrunconfigurationfactory.cpp",
|
"qnxrunconfigurationfactory.cpp",
|
||||||
"qnxrunconfigurationfactory.h",
|
"qnxrunconfigurationfactory.h",
|
||||||
"qnxruncontrolfactory.cpp",
|
|
||||||
"qnxruncontrolfactory.h",
|
|
||||||
"qnxutils.cpp",
|
"qnxutils.cpp",
|
||||||
"qnxutils.h",
|
"qnxutils.h",
|
||||||
"qnx_export.h",
|
"qnx_export.h",
|
||||||
|
@@ -75,9 +75,11 @@ private:
|
|||||||
|
|
||||||
// QnxDebugSupport
|
// QnxDebugSupport
|
||||||
|
|
||||||
QnxAnalyzeSupport::QnxAnalyzeSupport(RunControl *runControl)
|
QnxQmlProfilerSupport::QnxQmlProfilerSupport(RunControl *runControl)
|
||||||
: RunWorker(runControl)
|
: RunWorker(runControl)
|
||||||
{
|
{
|
||||||
|
runControl->createWorker(runControl->runMode());
|
||||||
|
|
||||||
setDisplayName("QnxAnalyzeSupport");
|
setDisplayName("QnxAnalyzeSupport");
|
||||||
appendMessage(tr("Preparing remote side..."), Utils::LogMessageFormat);
|
appendMessage(tr("Preparing remote side..."), Utils::LogMessageFormat);
|
||||||
|
|
||||||
@@ -99,7 +101,7 @@ QnxAnalyzeSupport::QnxAnalyzeSupport(RunControl *runControl)
|
|||||||
// m_outputParser.processOutput(msg);
|
// m_outputParser.processOutput(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QnxAnalyzeSupport::start()
|
void QnxQmlProfilerSupport::start()
|
||||||
{
|
{
|
||||||
// runControl()->notifyRemoteSetupDone(m_qmlPort);
|
// runControl()->notifyRemoteSetupDone(m_qmlPort);
|
||||||
reportStarted();
|
reportStarted();
|
||||||
|
@@ -30,14 +30,12 @@
|
|||||||
namespace Qnx {
|
namespace Qnx {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class Slog2InfoRunner;
|
class QnxQmlProfilerSupport : public ProjectExplorer::RunWorker
|
||||||
|
|
||||||
class QnxAnalyzeSupport : public ProjectExplorer::RunWorker
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QnxAnalyzeSupport(ProjectExplorer::RunControl *runControl);
|
explicit QnxQmlProfilerSupport(ProjectExplorer::RunControl *runControl);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void start() override;
|
void start() override;
|
||||||
|
@@ -25,38 +25,49 @@
|
|||||||
|
|
||||||
#include "qnxplugin.h"
|
#include "qnxplugin.h"
|
||||||
|
|
||||||
#include "qnxconstants.h"
|
#include "qnxanalyzesupport.h"
|
||||||
#include "qnxattachdebugsupport.h"
|
#include "qnxattachdebugsupport.h"
|
||||||
#include "qnxdevicefactory.h"
|
|
||||||
#include "qnxruncontrolfactory.h"
|
|
||||||
#include "qnxdeploystepfactory.h"
|
|
||||||
#include "qnxdeployconfigurationfactory.h"
|
|
||||||
#include "qnxrunconfigurationfactory.h"
|
|
||||||
#include "qnxqtversionfactory.h"
|
|
||||||
#include "qnxsettingspage.h"
|
|
||||||
#include "qnxconfigurationmanager.h"
|
#include "qnxconfigurationmanager.h"
|
||||||
|
#include "qnxconstants.h"
|
||||||
|
#include "qnxdebugsupport.h"
|
||||||
|
#include "qnxdeployconfigurationfactory.h"
|
||||||
|
#include "qnxdeploystepfactory.h"
|
||||||
|
#include "qnxdevice.h"
|
||||||
|
#include "qnxdevicefactory.h"
|
||||||
|
#include "qnxqtversion.h"
|
||||||
|
#include "qnxqtversionfactory.h"
|
||||||
|
#include "qnxrunconfiguration.h"
|
||||||
|
#include "qnxrunconfigurationfactory.h"
|
||||||
|
#include "qnxsettingspage.h"
|
||||||
#include "qnxtoolchain.h"
|
#include "qnxtoolchain.h"
|
||||||
#include "qnxattachdebugsupport.h"
|
#include "qnxutils.h"
|
||||||
|
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <projectexplorer/kitinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/taskhub.h>
|
#include <projectexplorer/taskhub.h>
|
||||||
#include <projectexplorer/kitmanager.h>
|
#include <projectexplorer/kitmanager.h>
|
||||||
|
#include <projectexplorer/environmentaspect.h>
|
||||||
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
|
#include <projectexplorer/project.h>
|
||||||
|
#include <projectexplorer/target.h>
|
||||||
|
#include <projectexplorer/toolchain.h>
|
||||||
|
|
||||||
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QtPlugin>
|
#include <QtPlugin>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace Qnx::Internal;
|
|
||||||
|
|
||||||
QnxPlugin::QnxPlugin() : m_debugSeparator(0) , m_attachToQnxApplication(0)
|
namespace Qnx {
|
||||||
{ }
|
namespace Internal {
|
||||||
|
|
||||||
bool QnxPlugin::initialize(const QStringList &arguments, QString *errorString)
|
bool QnxPlugin::initialize(const QStringList &arguments, QString *errorString)
|
||||||
{
|
{
|
||||||
@@ -67,13 +78,29 @@ bool QnxPlugin::initialize(const QStringList &arguments, QString *errorString)
|
|||||||
addAutoReleasedObject(new QnxConfigurationManager);
|
addAutoReleasedObject(new QnxConfigurationManager);
|
||||||
addAutoReleasedObject(new QnxQtVersionFactory);
|
addAutoReleasedObject(new QnxQtVersionFactory);
|
||||||
addAutoReleasedObject(new QnxDeviceFactory);
|
addAutoReleasedObject(new QnxDeviceFactory);
|
||||||
addAutoReleasedObject(new QnxRunControlFactory);
|
|
||||||
addAutoReleasedObject(new QnxDeployStepFactory);
|
addAutoReleasedObject(new QnxDeployStepFactory);
|
||||||
addAutoReleasedObject(new QnxDeployConfigurationFactory);
|
addAutoReleasedObject(new QnxDeployConfigurationFactory);
|
||||||
addAutoReleasedObject(new QnxRunConfigurationFactory);
|
addAutoReleasedObject(new QnxRunConfigurationFactory);
|
||||||
addAutoReleasedObject(new QnxSettingsPage);
|
addAutoReleasedObject(new QnxSettingsPage);
|
||||||
|
|
||||||
// Handle Qcc Compiler
|
auto constraint = [](RunConfiguration *runConfig) {
|
||||||
|
if (!runConfig->isEnabled()
|
||||||
|
|| !runConfig->id().name().startsWith(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto dev = DeviceKitInformation::device(runConfig->target()->kit())
|
||||||
|
.dynamicCast<const QnxDevice>();
|
||||||
|
return !dev.isNull();
|
||||||
|
};
|
||||||
|
|
||||||
|
RunControl::registerWorker<SimpleTargetRunner>
|
||||||
|
(ProjectExplorer::Constants::NORMAL_RUN_MODE, constraint);
|
||||||
|
RunControl::registerWorker<QnxDebugSupport>
|
||||||
|
(ProjectExplorer::Constants::DEBUG_RUN_MODE, constraint);
|
||||||
|
RunControl::registerWorker<QnxQmlProfilerSupport>
|
||||||
|
(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE, constraint);
|
||||||
|
|
||||||
addAutoReleasedObject(new QnxToolChainFactory);
|
addAutoReleasedObject(new QnxToolChainFactory);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -118,3 +145,6 @@ void QnxPlugin::updateDebuggerActions()
|
|||||||
m_attachToQnxApplication->setVisible(false && hasValidQnxKit); // FIXME
|
m_attachToQnxApplication->setVisible(false && hasValidQnxKit); // FIXME
|
||||||
m_debugSeparator->setVisible(false && hasValidQnxKit); // FIXME QTCREATORBUG-16608
|
m_debugSeparator->setVisible(false && hasValidQnxKit); // FIXME QTCREATORBUG-16608
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // Internal
|
||||||
|
} // Qnx
|
||||||
|
@@ -40,18 +40,17 @@ class QnxPlugin : public ExtensionSystem::IPlugin
|
|||||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Qnx.json")
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "Qnx.json")
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QnxPlugin();
|
QnxPlugin() {}
|
||||||
|
|
||||||
bool initialize(const QStringList &arguments, QString *errorString);
|
bool initialize(const QStringList &arguments, QString *errorString);
|
||||||
void extensionsInitialized();
|
void extensionsInitialized();
|
||||||
ShutdownFlag aboutToShutdown();
|
ShutdownFlag aboutToShutdown();
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void updateDebuggerActions();
|
void updateDebuggerActions();
|
||||||
|
|
||||||
private:
|
QAction *m_debugSeparator = nullptr;
|
||||||
QAction *m_debugSeparator;
|
QAction *m_attachToQnxApplication = nullptr;
|
||||||
QAction *m_attachToQnxApplication;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -1,109 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 BlackBerry Limited. All rights reserved.
|
|
||||||
** Contact: KDAB (info@kdab.com)
|
|
||||||
**
|
|
||||||
** 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 "qnxruncontrolfactory.h"
|
|
||||||
#include "qnxconstants.h"
|
|
||||||
#include "qnxrunconfiguration.h"
|
|
||||||
#include "qnxdebugsupport.h"
|
|
||||||
#include "qnxdevice.h"
|
|
||||||
#include "qnxanalyzesupport.h"
|
|
||||||
#include "qnxqtversion.h"
|
|
||||||
#include "slog2inforunner.h"
|
|
||||||
#include "qnxutils.h"
|
|
||||||
|
|
||||||
#include <debugger/debuggerruncontrol.h>
|
|
||||||
#include <debugger/debuggerrunconfigurationaspect.h>
|
|
||||||
#include <debugger/debuggerstartparameters.h>
|
|
||||||
#include <debugger/debuggerkitinformation.h>
|
|
||||||
#include <debugger/analyzer/analyzermanager.h>
|
|
||||||
#include <projectexplorer/environmentaspect.h>
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
|
||||||
#include <projectexplorer/project.h>
|
|
||||||
#include <projectexplorer/target.h>
|
|
||||||
#include <projectexplorer/toolchain.h>
|
|
||||||
#include <qtsupport/qtkitinformation.h>
|
|
||||||
#include <utils/portlist.h>
|
|
||||||
|
|
||||||
using namespace Debugger;
|
|
||||||
using namespace ProjectExplorer;
|
|
||||||
|
|
||||||
namespace Qnx {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
QnxRunControlFactory::QnxRunControlFactory(QObject *parent)
|
|
||||||
: IRunControlFactory(parent)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool QnxRunControlFactory::canRun(RunConfiguration *runConfiguration, Core::Id mode) const
|
|
||||||
{
|
|
||||||
if (mode != ProjectExplorer::Constants::NORMAL_RUN_MODE
|
|
||||||
&& mode != ProjectExplorer::Constants::DEBUG_RUN_MODE
|
|
||||||
&& mode != ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!runConfiguration->isEnabled()
|
|
||||||
|| !runConfiguration->id().name().startsWith(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QnxDevice::ConstPtr dev = DeviceKitInformation::device(runConfiguration->target()->kit())
|
|
||||||
.dynamicCast<const QnxDevice>();
|
|
||||||
if (dev.isNull())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
RunControl *QnxRunControlFactory::create(RunConfiguration *runConfig, Core::Id mode, QString *)
|
|
||||||
{
|
|
||||||
QTC_ASSERT(canRun(runConfig, mode), return 0);
|
|
||||||
|
|
||||||
if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE) {
|
|
||||||
auto runControl = new RunControl(runConfig, mode);
|
|
||||||
(void) new SimpleTargetRunner(runControl);
|
|
||||||
return runControl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mode == ProjectExplorer::Constants::DEBUG_RUN_MODE) {
|
|
||||||
auto runControl = new RunControl(runConfig, mode);
|
|
||||||
(void) new QnxDebugSupport(runControl);
|
|
||||||
return runControl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
|
|
||||||
RunControl *runControl = new RunControl(runConfig, mode);
|
|
||||||
runControl->createWorker(mode);
|
|
||||||
(void) new QnxAnalyzeSupport(runControl);
|
|
||||||
return runControl;
|
|
||||||
}
|
|
||||||
|
|
||||||
QTC_CHECK(false);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Qnx
|
|
@@ -1,47 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 BlackBerry Limited. All rights reserved.
|
|
||||||
** Contact: KDAB (info@kdab.com)
|
|
||||||
**
|
|
||||||
** 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 <projectexplorer/runconfiguration.h>
|
|
||||||
|
|
||||||
namespace Qnx {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
class QnxRunControlFactory : public ProjectExplorer::IRunControlFactory
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit QnxRunControlFactory(QObject *parent = 0);
|
|
||||||
|
|
||||||
bool canRun(ProjectExplorer::RunConfiguration *runConfiguration,
|
|
||||||
Core::Id mode) const override;
|
|
||||||
ProjectExplorer::RunControl *create(ProjectExplorer::RunConfiguration *runConfiguration,
|
|
||||||
Core::Id mode, QString *errorMessage) override;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace Qnx
|
|
Reference in New Issue
Block a user