Commit 0d017e5a authored by Benjamin Zeller's avatar Benjamin Zeller

remotelinux: Add generic Runconfiguration interface

Adds a generic interface (AbstractRemoteLinuxRunConfiguration), so plugins
can ship a custom remote runconfig.

Change-Id: I4ef8e39c4c69224d4e55224c782f3d544f10c945
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@digia.com>
parent d33e66c8
/****************************************************************************
**
** Copyright (C) 2014 Canonical Ltd.
** Contact: http://www.qt-project.org/legal
**
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "abstractremotelinuxrunconfiguration.h"
namespace RemoteLinux {
AbstractRemoteLinuxRunConfiguration::AbstractRemoteLinuxRunConfiguration(ProjectExplorer::Target *parent,
Core::Id id): RunConfiguration(parent, id)
{
}
AbstractRemoteLinuxRunConfiguration::~AbstractRemoteLinuxRunConfiguration()
{
}
AbstractRemoteLinuxRunConfiguration::AbstractRemoteLinuxRunConfiguration(ProjectExplorer::Target *parent,
AbstractRemoteLinuxRunConfiguration *source): RunConfiguration(parent, source)
{
}
} // namespace RemoteLinux
/****************************************************************************
**
** Copyright (C) 2014 Canonical Ltd.
** Contact: http://www.qt-project.org/legal
**
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef REMOTELINUX_ABSTRACTREMOTELINUXRUNCONFIGURATION_H
#define REMOTELINUX_ABSTRACTREMOTELINUXRUNCONFIGURATION_H
#include "remotelinux_export.h"
#include <projectexplorer/runconfiguration.h>
QT_FORWARD_DECLARE_CLASS(QStringList)
namespace Utils { class Environment; }
namespace RemoteLinux {
class REMOTELINUX_EXPORT AbstractRemoteLinuxRunConfiguration :
public ProjectExplorer::RunConfiguration
{
Q_OBJECT
Q_DISABLE_COPY(AbstractRemoteLinuxRunConfiguration)
public:
AbstractRemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, Core::Id id);
~AbstractRemoteLinuxRunConfiguration();
virtual QString localExecutableFilePath() const = 0;
virtual QString remoteExecutableFilePath() const = 0;
virtual QStringList arguments() const = 0;
virtual QString workingDirectory() const = 0;
virtual Utils::Environment environment() const = 0;
protected:
AbstractRemoteLinuxRunConfiguration(ProjectExplorer::Target *parent,
AbstractRemoteLinuxRunConfiguration *source);
};
} // namespace RemoteLinux
#endif // REMOTELINUX_ABSTRACTREMOTELINUXRUNCONFIGURATION_H
......@@ -28,7 +28,7 @@
****************************************************************************/
#include "abstractremotelinuxrunsupport.h"
#include "remotelinuxrunconfiguration.h"
#include "abstractremotelinuxrunconfiguration.h"
#include <projectexplorer/target.h>
#include <projectexplorer/kitinformation.h>
......@@ -45,7 +45,7 @@ namespace Internal {
class AbstractRemoteLinuxRunSupportPrivate
{
public:
AbstractRemoteLinuxRunSupportPrivate(const RemoteLinuxRunConfiguration *runConfig)
AbstractRemoteLinuxRunSupportPrivate(const AbstractRemoteLinuxRunConfiguration *runConfig)
: state(AbstractRemoteLinuxRunSupport::Inactive),
device(DeviceKitInformation::device(runConfig->target()->kit())),
remoteFilePath(runConfig->remoteExecutableFilePath()),
......@@ -70,7 +70,7 @@ public:
using namespace Internal;
AbstractRemoteLinuxRunSupport::AbstractRemoteLinuxRunSupport(RemoteLinuxRunConfiguration *runConfig, QObject *parent)
AbstractRemoteLinuxRunSupport::AbstractRemoteLinuxRunSupport(AbstractRemoteLinuxRunConfiguration *runConfig, QObject *parent)
: QObject(parent),
d(new AbstractRemoteLinuxRunSupportPrivate(runConfig))
{
......
......@@ -42,7 +42,7 @@ namespace Utils { class Environment; }
namespace RemoteLinux {
class RemoteLinuxRunConfiguration;
class AbstractRemoteLinuxRunConfiguration;
namespace Internal { class AbstractRemoteLinuxRunSupportPrivate; }
......@@ -58,7 +58,7 @@ protected:
Running
};
public:
AbstractRemoteLinuxRunSupport(RemoteLinuxRunConfiguration *runConfig,
AbstractRemoteLinuxRunSupport(AbstractRemoteLinuxRunConfiguration *runConfig,
QObject *parent = 0);
~AbstractRemoteLinuxRunSupport();
......
......@@ -10,6 +10,7 @@ HEADERS += \
remotelinuxplugin.h \
remotelinux_export.h \
linuxdevice.h \
abstractremotelinuxrunconfiguration.h \
remotelinuxrunconfiguration.h \
publickeydeploymentdialog.h \
genericlinuxdeviceconfigurationwizard.h \
......@@ -56,6 +57,7 @@ SOURCES += \
remotelinuxenvironmentaspectwidget.cpp \
remotelinuxplugin.cpp \
linuxdevice.cpp \
abstractremotelinuxrunconfiguration.cpp \
remotelinuxrunconfiguration.cpp \
publickeydeploymentdialog.cpp \
genericlinuxdeviceconfigurationwizard.cpp \
......
......@@ -25,6 +25,8 @@ QtcPlugin {
"abstractremotelinuxdeploystep.h",
"abstractremotelinuxrunsupport.cpp",
"abstractremotelinuxrunsupport.h",
"abstractremotelinuxrunconfiguration.h",
"abstractremotelinuxrunconfiguration.cpp",
"abstractuploadandinstallpackageservice.cpp",
"abstractuploadandinstallpackageservice.h",
"embeddedlinuxqtversion.cpp",
......@@ -109,7 +111,7 @@ QtcPlugin {
"typespecificdeviceconfigurationlistmodel.h",
"uploadandinstalltarpackagestep.cpp",
"uploadandinstalltarpackagestep.h",
"images/embeddedtarget.png",
"images/embeddedtarget.png"
]
Export {
......
......@@ -73,7 +73,7 @@ public:
using namespace Internal;
AnalyzerStartParameters RemoteLinuxAnalyzeSupport::startParameters(const RemoteLinuxRunConfiguration *runConfig,
AnalyzerStartParameters RemoteLinuxAnalyzeSupport::startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig,
RunMode runMode)
{
AnalyzerStartParameters params;
......@@ -88,7 +88,7 @@ AnalyzerStartParameters RemoteLinuxAnalyzeSupport::startParameters(const RemoteL
return params;
}
RemoteLinuxAnalyzeSupport::RemoteLinuxAnalyzeSupport(RemoteLinuxRunConfiguration *runConfig,
RemoteLinuxAnalyzeSupport::RemoteLinuxAnalyzeSupport(AbstractRemoteLinuxRunConfiguration *runConfig,
AnalyzerRunControl *engine, RunMode runMode)
: AbstractRemoteLinuxRunSupport(runConfig, engine),
d(new RemoteLinuxAnalyzeSupportPrivate(engine, runMode))
......
......@@ -41,7 +41,7 @@ class AnalyzerRunControl;
}
namespace RemoteLinux {
class RemoteLinuxRunConfiguration;
class AbstractRemoteLinuxRunConfiguration;
namespace Internal { class RemoteLinuxAnalyzeSupportPrivate; }
......@@ -49,10 +49,10 @@ class REMOTELINUX_EXPORT RemoteLinuxAnalyzeSupport : public AbstractRemoteLinuxR
{
Q_OBJECT
public:
static Analyzer::AnalyzerStartParameters startParameters(const RemoteLinuxRunConfiguration *runConfig,
static Analyzer::AnalyzerStartParameters startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig,
ProjectExplorer::RunMode runMode);
RemoteLinuxAnalyzeSupport(RemoteLinuxRunConfiguration *runConfig,
RemoteLinuxAnalyzeSupport(AbstractRemoteLinuxRunConfiguration *runConfig,
Analyzer::AnalyzerRunControl *engine, ProjectExplorer::RunMode runMode);
~RemoteLinuxAnalyzeSupport();
......
......@@ -55,7 +55,7 @@ namespace Internal {
class LinuxDeviceDebugSupportPrivate
{
public:
LinuxDeviceDebugSupportPrivate(const RemoteLinuxRunConfiguration *runConfig,
LinuxDeviceDebugSupportPrivate(const AbstractRemoteLinuxRunConfiguration *runConfig,
DebuggerEngine *engine)
: engine(engine),
qmlDebugging(runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>()->useQmlDebugger()),
......@@ -76,7 +76,7 @@ public:
using namespace Internal;
DebuggerStartParameters LinuxDeviceDebugSupport::startParameters(const RemoteLinuxRunConfiguration *runConfig)
DebuggerStartParameters LinuxDeviceDebugSupport::startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig)
{
DebuggerStartParameters params;
Target *target = runConfig->target();
......@@ -118,10 +118,10 @@ DebuggerStartParameters LinuxDeviceDebugSupport::startParameters(const RemoteLin
return params;
}
LinuxDeviceDebugSupport::LinuxDeviceDebugSupport(RemoteLinuxRunConfiguration *runConfig,
LinuxDeviceDebugSupport::LinuxDeviceDebugSupport(AbstractRemoteLinuxRunConfiguration *runConfig,
DebuggerEngine *engine)
: AbstractRemoteLinuxRunSupport(runConfig, engine),
d(new LinuxDeviceDebugSupportPrivate(static_cast<RemoteLinuxRunConfiguration *>(runConfig), engine))
d(new LinuxDeviceDebugSupportPrivate(static_cast<AbstractRemoteLinuxRunConfiguration *>(runConfig), engine))
{
connect(d->engine, SIGNAL(requestRemoteSetup()), this, SLOT(handleRemoteSetupRequested()));
}
......
......@@ -38,7 +38,7 @@ class DebuggerStartParameters;
}
namespace RemoteLinux {
class RemoteLinuxRunConfiguration;
class AbstractRemoteLinuxRunConfiguration;
namespace Internal { class LinuxDeviceDebugSupportPrivate; }
......@@ -46,9 +46,9 @@ class REMOTELINUX_EXPORT LinuxDeviceDebugSupport : public AbstractRemoteLinuxRun
{
Q_OBJECT
public:
static Debugger::DebuggerStartParameters startParameters(const RemoteLinuxRunConfiguration *runConfig);
static Debugger::DebuggerStartParameters startParameters(const AbstractRemoteLinuxRunConfiguration *runConfig);
LinuxDeviceDebugSupport(RemoteLinuxRunConfiguration *runConfig,
LinuxDeviceDebugSupport(AbstractRemoteLinuxRunConfiguration *runConfig,
Debugger::DebuggerEngine *engine);
~LinuxDeviceDebugSupport();
......
......@@ -73,9 +73,9 @@ Utils::Environment RemoteLinuxEnvironmentAspect::baseEnvironment() const
return Utils::Environment();
}
RemoteLinuxRunConfiguration *RemoteLinuxEnvironmentAspect::runConfiguration() const
AbstractRemoteLinuxRunConfiguration *RemoteLinuxEnvironmentAspect::runConfiguration() const
{
return qobject_cast<RemoteLinuxRunConfiguration *>(EnvironmentAspect::runConfiguration());
return qobject_cast<AbstractRemoteLinuxRunConfiguration *>(EnvironmentAspect::runConfiguration());
}
Utils::Environment RemoteLinuxEnvironmentAspect::remoteEnvironment() const
......
......@@ -30,7 +30,7 @@
#ifndef REMOTELINUXENVIRONMENTASPECT_H
#define REMOTELINUXENVIRONMENTASPECT_H
#include "remotelinuxrunconfiguration.h"
#include "abstractremotelinuxrunconfiguration.h"
#include "remotelinux_export.h"
......@@ -38,7 +38,7 @@
namespace RemoteLinux {
class RemoteLinuxEnvironmentAspectWidget;
class RemoteLinuxRunConfiguration;
class AbstractRemoteLinuxRunConfiguration;
class REMOTELINUX_EXPORT RemoteLinuxEnvironmentAspect : public ProjectExplorer::EnvironmentAspect
{
......@@ -53,7 +53,7 @@ public:
QString baseEnvironmentDisplayName(int base) const;
Utils::Environment baseEnvironment() const;
RemoteLinuxRunConfiguration *runConfiguration() const;
AbstractRemoteLinuxRunConfiguration *runConfiguration() const;
Utils::Environment remoteEnvironment() const;
void setRemoteEnvironment(const Utils::Environment &env);
......
......@@ -84,7 +84,7 @@ using namespace Internal;
RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *parent, const Core::Id id,
const QString &proFilePath)
: RunConfiguration(parent, id),
: AbstractRemoteLinuxRunConfiguration(parent, id),
d(new RemoteLinuxRunConfigurationPrivate(proFilePath))
{
init();
......@@ -92,7 +92,7 @@ RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *parent, const C
RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(ProjectExplorer::Target *parent,
RemoteLinuxRunConfiguration *source)
: RunConfiguration(parent, source),
: AbstractRemoteLinuxRunConfiguration(parent, source),
d(new RemoteLinuxRunConfigurationPrivate(source->d))
{
init();
......
......@@ -31,6 +31,7 @@
#define REMOTELINUXRUNCONFIGURATION_H
#include "remotelinux_export.h"
#include "abstractremotelinuxrunconfiguration.h"
#include <projectexplorer/runconfiguration.h>
......@@ -50,7 +51,7 @@ class RemoteLinuxRunConfigurationPrivate;
class RemoteLinuxRunConfigurationFactory;
} // namespace Internal
class REMOTELINUX_EXPORT RemoteLinuxRunConfiguration : public ProjectExplorer::RunConfiguration
class REMOTELINUX_EXPORT RemoteLinuxRunConfiguration : public AbstractRemoteLinuxRunConfiguration
{
Q_OBJECT
Q_DISABLE_COPY(RemoteLinuxRunConfiguration)
......
......@@ -29,7 +29,7 @@
#include "remotelinuxruncontrol.h"
#include "remotelinuxrunconfiguration.h"
#include "abstractremotelinuxrunconfiguration.h"
#include <projectexplorer/devicesupport/deviceapplicationrunner.h>
#include <projectexplorer/kitinformation.h>
......@@ -60,7 +60,7 @@ RemoteLinuxRunControl::RemoteLinuxRunControl(RunConfiguration *rc)
{
d->running = false;
d->device = DeviceKitInformation::device(rc->target()->kit());
const RemoteLinuxRunConfiguration * const lrc = qobject_cast<RemoteLinuxRunConfiguration *>(rc);
const AbstractRemoteLinuxRunConfiguration * const lrc = qobject_cast<AbstractRemoteLinuxRunConfiguration *>(rc);
d->remoteExecutable = lrc->remoteExecutableFilePath();
d->arguments = lrc->arguments();
d->environment = lrc->environment();
......
......@@ -37,7 +37,7 @@
#include <analyzerbase/analyzerruncontrol.h>
#include <analyzerbase/analyzerrunconfigwidget.h>
#include <remotelinux/remotelinuxrunconfiguration.h>
#include <remotelinux/abstractremotelinuxrunconfiguration.h>
#include <debugger/debuggerrunconfigurationaspect.h>
#include <projectexplorer/environmentaspect.h>
......@@ -94,8 +94,8 @@ RunControl *ValgrindRunControlFactory::create(RunConfiguration *runConfiguration
sp.connParams.host = server.serverAddress().toString();
sp.connParams.port = server.serverPort();
sp.startMode = StartLocal;
} else if (RemoteLinux::RemoteLinuxRunConfiguration *rc2 =
qobject_cast<RemoteLinux::RemoteLinuxRunConfiguration *>(runConfiguration)) {
} else if (RemoteLinux::AbstractRemoteLinuxRunConfiguration *rc2 =
qobject_cast<RemoteLinux::AbstractRemoteLinuxRunConfiguration *>(runConfiguration)) {
sp.startMode = StartRemote;
sp.debuggee = rc2->remoteExecutableFilePath();
sp.connParams = DeviceKitInformation::device(rc2->target()->kit())->sshParameters();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment