2017-06-14 11:13:16 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
|
**
|
|
|
|
|
** 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.
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
2017-10-19 16:39:44 +02:00
|
|
|
#include "remotelinuxqmltoolingsupport.h"
|
2017-06-14 11:13:16 +02:00
|
|
|
|
|
|
|
|
#include <ssh/sshconnection.h>
|
2018-04-16 13:42:43 +02:00
|
|
|
#include <utils/qtcprocess.h>
|
2017-10-19 16:39:44 +02:00
|
|
|
#include <utils/url.h>
|
2017-06-14 11:13:16 +02:00
|
|
|
|
|
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
using namespace Utils;
|
|
|
|
|
|
|
|
|
|
namespace RemoteLinux {
|
2017-09-07 09:51:46 +02:00
|
|
|
namespace Internal {
|
2017-06-14 11:13:16 +02:00
|
|
|
|
|
|
|
|
// RemoteLinuxQmlProfilerSupport
|
|
|
|
|
|
2017-10-19 16:39:44 +02:00
|
|
|
RemoteLinuxQmlToolingSupport::RemoteLinuxQmlToolingSupport(
|
|
|
|
|
RunControl *runControl, QmlDebug::QmlDebugServicesPreset services)
|
|
|
|
|
: SimpleTargetRunner(runControl), m_services(services)
|
2017-06-14 11:13:16 +02:00
|
|
|
{
|
2018-08-21 08:28:27 +02:00
|
|
|
setId("RemoteLinuxQmlToolingSupport");
|
2017-06-14 11:13:16 +02:00
|
|
|
|
|
|
|
|
m_portsGatherer = new PortsGatherer(runControl);
|
2017-08-08 14:09:50 +02:00
|
|
|
addStartDependency(m_portsGatherer);
|
2017-06-14 11:13:16 +02:00
|
|
|
|
2017-08-08 15:56:18 +02:00
|
|
|
// The ports gatherer can safely be stopped once the process is running, even though it has to
|
|
|
|
|
// be started before.
|
|
|
|
|
addStopDependency(m_portsGatherer);
|
|
|
|
|
|
2017-10-19 16:39:44 +02:00
|
|
|
m_runworker = runControl->createWorker(runControl->runMode());
|
|
|
|
|
m_runworker->addStartDependency(this);
|
|
|
|
|
addStopDependency(m_runworker);
|
2017-06-14 11:13:16 +02:00
|
|
|
}
|
|
|
|
|
|
2017-10-19 16:39:44 +02:00
|
|
|
void RemoteLinuxQmlToolingSupport::start()
|
2017-06-14 11:13:16 +02:00
|
|
|
{
|
|
|
|
|
Port qmlPort = m_portsGatherer->findPort();
|
|
|
|
|
|
|
|
|
|
QUrl serverUrl;
|
2017-10-19 16:39:44 +02:00
|
|
|
serverUrl.setScheme(urlTcpScheme());
|
2017-12-19 12:45:46 +01:00
|
|
|
serverUrl.setHost(device()->sshParameters().host());
|
2017-06-14 11:13:16 +02:00
|
|
|
serverUrl.setPort(qmlPort.number());
|
2017-10-19 16:39:44 +02:00
|
|
|
m_runworker->recordData("QmlServerUrl", serverUrl);
|
2017-06-14 11:13:16 +02:00
|
|
|
|
2018-05-16 15:42:03 +02:00
|
|
|
Runnable r = runnable();
|
2018-04-16 13:42:43 +02:00
|
|
|
QtcProcess::addArg(&r.commandLineArguments, QmlDebug::qmlDebugTcpArguments(m_services, qmlPort),
|
|
|
|
|
device()->osType());
|
2017-06-14 11:13:16 +02:00
|
|
|
|
|
|
|
|
setRunnable(r);
|
|
|
|
|
|
|
|
|
|
SimpleTargetRunner::start();
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-07 09:51:46 +02:00
|
|
|
} // namespace Internal
|
2017-06-14 11:13:16 +02:00
|
|
|
} // namespace RemoteLinux
|