aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2023-01-06 17:52:03 +0100
committerhjk <hjk@qt.io>2023-01-18 16:15:33 +0000
commit1db9135d6d730a770560b3bb44f6a0b2bb61e463 (patch)
treecf1ac102666cbcfb0aa3ee4cf7cbd5f338a35886 /src/plugins/remotelinux/remotelinuxdebugsupport.cpp
parentfa7dd2fd3bdb1fd427635c9d23d0a40b47fe0c9a (diff)
RemoteLinux: Merge tooling runworker related files
... and move definition of supported runconfig to worker factories This might not be final, but is closer to the other device setups. Change-Id: If68d4e9d1bfb281879ff8cd46ed6ed6356da8d57 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/remotelinux/remotelinuxdebugsupport.cpp')
-rw-r--r--src/plugins/remotelinux/remotelinuxdebugsupport.cpp65
1 files changed, 59 insertions, 6 deletions
diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
index 2f706c6e94..af476d48b9 100644
--- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
+++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
@@ -10,15 +10,18 @@
#include <debugger/debuggerruncontrol.h>
+#include <qmldebug/qmldebugcommandlinearguments.h>
+
using namespace Debugger;
using namespace ProjectExplorer;
+using namespace Utils;
namespace RemoteLinux::Internal {
class RemoteLinuxDebugWorker final : public DebuggerRunTool
{
public:
- RemoteLinuxDebugWorker(RunControl *runControl)
+ explicit RemoteLinuxDebugWorker(RunControl *runControl)
: DebuggerRunTool(runControl, DoNotAllowTerminal)
{
setId("RemoteLinuxDebugWorker");
@@ -38,22 +41,72 @@ public:
}
};
+class RemoteLinuxQmlToolingSupport final : public SimpleTargetRunner
+{
+public:
+ explicit RemoteLinuxQmlToolingSupport(RunControl *runControl)
+ : SimpleTargetRunner(runControl)
+ {
+ setId("RemoteLinuxQmlToolingSupport");
+
+ auto portsGatherer = new PortsGatherer(runControl);
+ addStartDependency(portsGatherer);
+
+ // The ports gatherer can safely be stopped once the process is running, even though it has to
+ // be started before.
+ addStopDependency(portsGatherer);
+
+ auto runworker = runControl->createWorker(QmlDebug::runnerIdForRunMode(runControl->runMode()));
+ runworker->addStartDependency(this);
+ addStopDependency(runworker);
+
+ setStartModifier([this, runControl, portsGatherer, runworker] {
+ const QUrl serverUrl = portsGatherer->findEndPoint();
+ runworker->recordData("QmlServerUrl", serverUrl);
+
+ QmlDebug::QmlDebugServicesPreset services = QmlDebug::servicesForRunMode(runControl->runMode());
+
+ CommandLine cmd = commandLine();
+ cmd.addArg(QmlDebug::qmlDebugTcpArguments(services, serverUrl));
+ setCommandLine(cmd);
+ });
+ }
+};
+
// Factories
-RemoteLinuxRunWorkerFactory::RemoteLinuxRunWorkerFactory(const QList<Utils::Id> &runConfigs)
+static const QList<Id> supportedRunConfigs()
+{
+ return {
+ Constants::RunConfigId,
+ Constants::CustomRunConfigId,
+ "QmlProjectManager.QmlRunConfiguration"
+ };
+}
+
+RemoteLinuxRunWorkerFactory::RemoteLinuxRunWorkerFactory()
{
setProduct<SimpleTargetRunner>();
addSupportedRunMode(ProjectExplorer::Constants::NORMAL_RUN_MODE);
- setSupportedRunConfigs(runConfigs);
addSupportedDeviceType(Constants::GenericLinuxOsType);
+ setSupportedRunConfigs(supportedRunConfigs());
}
-RemoteLinuxDebugWorkerFactory::RemoteLinuxDebugWorkerFactory(const QList<Utils::Id> &runConfigs)
+RemoteLinuxDebugWorkerFactory::RemoteLinuxDebugWorkerFactory()
{
setProduct<RemoteLinuxDebugWorker>();
addSupportedRunMode(ProjectExplorer::Constants::DEBUG_RUN_MODE);
- setSupportedRunConfigs(runConfigs);
addSupportedDeviceType(Constants::GenericLinuxOsType);
+ setSupportedRunConfigs(supportedRunConfigs());
+}
+
+RemoteLinuxQmlToolingWorkerFactory::RemoteLinuxQmlToolingWorkerFactory()
+{
+ setProduct<RemoteLinuxQmlToolingSupport>();
+ addSupportedRunMode(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
+ addSupportedRunMode(ProjectExplorer::Constants::QML_PREVIEW_RUN_MODE);
+ addSupportedDeviceType(Constants::GenericLinuxOsType);
+ setSupportedRunConfigs(supportedRunConfigs());
}
-} // Internal::Internal
+} // RemoteLinux::Internal