RemoteLinux: Generalize QML tooling support

The only thing about RemoteLinuxAnalyzeSupport that's actually specific
to the QML profiler is the debug services preset.

Change-Id: I1360f9555b18b74d9a86799900b58ce69e3bc205
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Ulf Hermann
2017-10-19 16:39:44 +02:00
parent 8e4b35b0b1
commit 03c184c607
5 changed files with 32 additions and 20 deletions

View File

@@ -42,7 +42,7 @@ HEADERS += \
genericlinuxdeviceconfigurationwidget.h \ genericlinuxdeviceconfigurationwidget.h \
remotelinuxcheckforfreediskspaceservice.h \ remotelinuxcheckforfreediskspaceservice.h \
remotelinuxcheckforfreediskspacestep.h \ remotelinuxcheckforfreediskspacestep.h \
remotelinuxanalyzesupport.h \ remotelinuxqmltoolingsupport.h \
linuxdeviceprocess.h \ linuxdeviceprocess.h \
remotelinuxcustomrunconfiguration.h \ remotelinuxcustomrunconfiguration.h \
remotelinuxsignaloperation.h \ remotelinuxsignaloperation.h \
@@ -86,7 +86,7 @@ SOURCES += \
genericlinuxdeviceconfigurationwidget.cpp \ genericlinuxdeviceconfigurationwidget.cpp \
remotelinuxcheckforfreediskspaceservice.cpp \ remotelinuxcheckforfreediskspaceservice.cpp \
remotelinuxcheckforfreediskspacestep.cpp \ remotelinuxcheckforfreediskspacestep.cpp \
remotelinuxanalyzesupport.cpp \ remotelinuxqmltoolingsupport.cpp \
linuxdeviceprocess.cpp \ linuxdeviceprocess.cpp \
remotelinuxcustomrunconfiguration.cpp \ remotelinuxcustomrunconfiguration.cpp \
remotelinuxsignaloperation.cpp \ remotelinuxsignaloperation.cpp \

View File

@@ -60,8 +60,6 @@ Project {
"remotelinux.qrc", "remotelinux.qrc",
"remotelinux_constants.h", "remotelinux_constants.h",
"remotelinux_export.h", "remotelinux_export.h",
"remotelinuxanalyzesupport.cpp",
"remotelinuxanalyzesupport.h",
"remotelinuxcheckforfreediskspaceservice.cpp", "remotelinuxcheckforfreediskspaceservice.cpp",
"remotelinuxcheckforfreediskspaceservice.h", "remotelinuxcheckforfreediskspaceservice.h",
"remotelinuxcheckforfreediskspacestep.cpp", "remotelinuxcheckforfreediskspacestep.cpp",
@@ -90,6 +88,8 @@ Project {
"remotelinuxpackageinstaller.h", "remotelinuxpackageinstaller.h",
"remotelinuxplugin.cpp", "remotelinuxplugin.cpp",
"remotelinuxplugin.h", "remotelinuxplugin.h",
"remotelinuxqmltoolingsupport.cpp",
"remotelinuxqmltoolingsupport.h",
"remotelinuxrunconfiguration.cpp", "remotelinuxrunconfiguration.cpp",
"remotelinuxrunconfiguration.h", "remotelinuxrunconfiguration.h",
"remotelinuxrunconfigurationfactory.cpp", "remotelinuxrunconfigurationfactory.cpp",

View File

@@ -28,7 +28,7 @@
#include "embeddedlinuxqtversionfactory.h" #include "embeddedlinuxqtversionfactory.h"
#include "genericlinuxdeviceconfigurationfactory.h" #include "genericlinuxdeviceconfigurationfactory.h"
#include "genericremotelinuxdeploystepfactory.h" #include "genericremotelinuxdeploystepfactory.h"
#include "remotelinuxanalyzesupport.h" #include "remotelinuxqmltoolingsupport.h"
#include "remotelinuxcustomrunconfiguration.h" #include "remotelinuxcustomrunconfiguration.h"
#include "remotelinuxdebugsupport.h" #include "remotelinuxdebugsupport.h"
#include "remotelinuxdeployconfigurationfactory.h" #include "remotelinuxdeployconfigurationfactory.h"

View File

@@ -23,13 +23,12 @@
** **
****************************************************************************/ ****************************************************************************/
#include "remotelinuxanalyzesupport.h" #include "remotelinuxqmltoolingsupport.h"
#include <projectexplorer/runnables.h> #include <projectexplorer/runnables.h>
#include <ssh/sshconnection.h> #include <ssh/sshconnection.h>
#include <utils/url.h>
#include <qmldebug/qmldebugcommandlinearguments.h>
using namespace ProjectExplorer; using namespace ProjectExplorer;
using namespace Utils; using namespace Utils;
@@ -39,10 +38,11 @@ namespace Internal {
// RemoteLinuxQmlProfilerSupport // RemoteLinuxQmlProfilerSupport
RemoteLinuxQmlProfilerSupport::RemoteLinuxQmlProfilerSupport(RunControl *runControl) RemoteLinuxQmlToolingSupport::RemoteLinuxQmlToolingSupport(
: SimpleTargetRunner(runControl) RunControl *runControl, QmlDebug::QmlDebugServicesPreset services)
: SimpleTargetRunner(runControl), m_services(services)
{ {
setDisplayName("RemoteLinuxQmlProfilerSupport"); setDisplayName("RemoteLinuxQmlToolingSupport");
m_portsGatherer = new PortsGatherer(runControl); m_portsGatherer = new PortsGatherer(runControl);
addStartDependency(m_portsGatherer); addStartDependency(m_portsGatherer);
@@ -51,21 +51,22 @@ RemoteLinuxQmlProfilerSupport::RemoteLinuxQmlProfilerSupport(RunControl *runCont
// be started before. // be started before.
addStopDependency(m_portsGatherer); addStopDependency(m_portsGatherer);
m_profiler = runControl->createWorker(runControl->runMode()); m_runworker = runControl->createWorker(runControl->runMode());
m_profiler->addStartDependency(this); m_runworker->addStartDependency(this);
addStopDependency(m_profiler); addStopDependency(m_runworker);
} }
void RemoteLinuxQmlProfilerSupport::start() void RemoteLinuxQmlToolingSupport::start()
{ {
Port qmlPort = m_portsGatherer->findPort(); Port qmlPort = m_portsGatherer->findPort();
QUrl serverUrl; QUrl serverUrl;
serverUrl.setScheme(urlTcpScheme());
serverUrl.setHost(device()->sshParameters().host); serverUrl.setHost(device()->sshParameters().host);
serverUrl.setPort(qmlPort.number()); serverUrl.setPort(qmlPort.number());
m_profiler->recordData("QmlServerUrl", serverUrl); m_runworker->recordData("QmlServerUrl", serverUrl);
QString args = QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlProfilerServices, qmlPort); QString args = QmlDebug::qmlDebugTcpArguments(m_services, qmlPort);
auto r = runnable().as<StandardRunnable>(); auto r = runnable().as<StandardRunnable>();
if (!r.commandLineArguments.isEmpty()) if (!r.commandLineArguments.isEmpty())
r.commandLineArguments.append(' '); r.commandLineArguments.append(' ');

View File

@@ -27,20 +27,31 @@
#include <projectexplorer/devicesupport/deviceusedportsgatherer.h> #include <projectexplorer/devicesupport/deviceusedportsgatherer.h>
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
#include <qmldebug/qmldebugcommandlinearguments.h>
namespace RemoteLinux { namespace RemoteLinux {
namespace Internal { namespace Internal {
class RemoteLinuxQmlProfilerSupport : public ProjectExplorer::SimpleTargetRunner class RemoteLinuxQmlToolingSupport : public ProjectExplorer::SimpleTargetRunner
{ {
public: public:
RemoteLinuxQmlProfilerSupport(ProjectExplorer::RunControl *runControl); RemoteLinuxQmlToolingSupport(ProjectExplorer::RunControl *runControl,
QmlDebug::QmlDebugServicesPreset services);
private: private:
void start() override; void start() override;
ProjectExplorer::PortsGatherer *m_portsGatherer; ProjectExplorer::PortsGatherer *m_portsGatherer;
ProjectExplorer::RunWorker *m_profiler; ProjectExplorer::RunWorker *m_runworker;
QmlDebug::QmlDebugServicesPreset m_services;
};
class RemoteLinuxQmlProfilerSupport : public RemoteLinuxQmlToolingSupport
{
public:
RemoteLinuxQmlProfilerSupport(ProjectExplorer::RunControl *runControl) :
RemoteLinuxQmlToolingSupport(runControl, QmlDebug::QmlProfilerServices)
{}
}; };
} // namespace Internal } // namespace Internal