2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-07-07 10:43:59 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-07-07 10:43:59 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-07-07 10:43:59 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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
|
2016-01-15 14:57:40 +01:00
|
|
|
** 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.
|
2011-07-07 10:43:59 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** 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.
|
2011-07-07 10:43:59 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2016-01-15 14:57:40 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2011-07-07 10:43:59 +02:00
|
|
|
|
|
|
|
|
#include "remotelinux_export.h"
|
|
|
|
|
|
2019-04-24 14:38:01 +02:00
|
|
|
#include "abstractremotelinuxdeployservice.h"
|
2011-07-07 10:43:59 +02:00
|
|
|
|
2019-04-24 14:38:01 +02:00
|
|
|
#include <projectexplorer/buildstep.h>
|
2011-07-07 10:43:59 +02:00
|
|
|
|
|
|
|
|
namespace RemoteLinux {
|
2011-07-14 15:38:16 +02:00
|
|
|
|
2014-02-11 21:55:42 +02:00
|
|
|
namespace Internal { class AbstractRemoteLinuxDeployStepPrivate; }
|
2011-07-07 10:43:59 +02:00
|
|
|
|
|
|
|
|
class REMOTELINUX_EXPORT AbstractRemoteLinuxDeployStep : public ProjectExplorer::BuildStep
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2011-07-13 18:02:35 +02:00
|
|
|
|
2011-07-07 10:43:59 +02:00
|
|
|
public:
|
2015-11-13 11:06:27 +01:00
|
|
|
~AbstractRemoteLinuxDeployStep() override;
|
ProjectExplorer: Rework the build step run interface
Originally, the build manager used to run all build steps in a dedicated
thread. Communication between the step and the manager happened via a
QFutureInterface that was passed into the step's run() function.
Later, new steps were added that operated asynchronously, so the build
manager had to differentiate between the different kinds of steps for
starting and stopping.
These days, almost all build and deploy steps work asynchronously, which
made the QFuture-based interface look increasingly odd.
With this patch, all build steps are expected to work asynchronously, so
the build manager no longer needs to differentiate. Steps are started
and requested to stop via the run() and cancel() functions,
respectively, and emit the finished() signal when they are done. Build
step implementors no longer have to deal with a QFutureInterface. For
steps whose implementation is inherently synchronous, the BuildStep base
class offers a runInThread() function.
Change-Id: If905c68b234c5a669f6e19f43142eaa57d594803
Reviewed-by: hjk <hjk@qt.io>
2019-01-25 14:26:34 +01:00
|
|
|
|
|
|
|
|
protected:
|
2015-11-13 11:06:27 +01:00
|
|
|
bool fromMap(const QVariantMap &map) override;
|
|
|
|
|
QVariantMap toMap() const override;
|
2019-01-10 15:31:44 +01:00
|
|
|
bool init() override;
|
2019-06-13 17:03:56 +02:00
|
|
|
void doRun() final;
|
ProjectExplorer: Rework the build step run interface
Originally, the build manager used to run all build steps in a dedicated
thread. Communication between the step and the manager happened via a
QFutureInterface that was passed into the step's run() function.
Later, new steps were added that operated asynchronously, so the build
manager had to differentiate between the different kinds of steps for
starting and stopping.
These days, almost all build and deploy steps work asynchronously, which
made the QFuture-based interface look increasingly odd.
With this patch, all build steps are expected to work asynchronously, so
the build manager no longer needs to differentiate. Steps are started
and requested to stop via the run() and cancel() functions,
respectively, and emit the finished() signal when they are done. Build
step implementors no longer have to deal with a QFutureInterface. For
steps whose implementation is inherently synchronous, the BuildStep base
class offers a runInThread() function.
Change-Id: If905c68b234c5a669f6e19f43142eaa57d594803
Reviewed-by: hjk <hjk@qt.io>
2019-01-25 14:26:34 +01:00
|
|
|
void doCancel() override;
|
2011-07-07 10:43:59 +02:00
|
|
|
|
2020-06-26 13:59:38 +02:00
|
|
|
explicit AbstractRemoteLinuxDeployStep(ProjectExplorer::BuildStepList *bsl, Utils::Id id);
|
2019-06-07 16:43:06 +02:00
|
|
|
|
|
|
|
|
void setInternalInitializer(const std::function<CheckResult()> &init);
|
2019-06-13 17:03:56 +02:00
|
|
|
void setRunPreparer(const std::function<void()> &prep);
|
|
|
|
|
|
|
|
|
|
template <class T>
|
|
|
|
|
T *createDeployService()
|
|
|
|
|
{
|
|
|
|
|
T *service = new T;
|
|
|
|
|
setDeployService(service);
|
|
|
|
|
return service;
|
|
|
|
|
}
|
2011-09-23 17:39:33 +02:00
|
|
|
|
2016-06-30 23:04:57 +03:00
|
|
|
private:
|
2019-06-13 17:03:56 +02:00
|
|
|
void setDeployService(AbstractRemoteLinuxDeployService *service);
|
2011-07-07 10:43:59 +02:00
|
|
|
void handleProgressMessage(const QString &message);
|
|
|
|
|
void handleErrorMessage(const QString &message);
|
2011-09-29 15:00:15 +02:00
|
|
|
void handleWarningMessage(const QString &message);
|
2011-07-07 10:43:59 +02:00
|
|
|
void handleFinished();
|
|
|
|
|
void handleStdOutData(const QString &data);
|
|
|
|
|
void handleStdErrData(const QString &data);
|
|
|
|
|
|
2011-09-16 11:33:48 +02:00
|
|
|
Internal::AbstractRemoteLinuxDeployStepPrivate *d;
|
2011-07-07 10:43:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace RemoteLinux
|