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
|
|
|
|
2011-07-07 10:43:59 +02:00
|
|
|
#include "uploadandinstalltarpackagestep.h"
|
|
|
|
|
|
2011-07-15 16:57:25 +02:00
|
|
|
#include "remotelinuxdeployconfiguration.h"
|
2011-07-19 17:30:37 +02:00
|
|
|
#include "remotelinuxpackageinstaller.h"
|
2011-07-15 16:57:25 +02:00
|
|
|
#include "tarpackagecreationstep.h"
|
2011-07-07 10:43:59 +02:00
|
|
|
|
|
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
|
|
|
|
|
namespace RemoteLinux {
|
|
|
|
|
namespace Internal {
|
2011-12-09 13:22:57 +01:00
|
|
|
|
2011-08-02 12:20:16 +02:00
|
|
|
class UploadAndInstallTarPackageServicePrivate
|
2011-07-07 10:43:59 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2011-08-02 12:20:16 +02:00
|
|
|
RemoteLinuxTarPackageInstaller installer;
|
2011-07-07 10:43:59 +02:00
|
|
|
};
|
2011-12-09 13:22:57 +01:00
|
|
|
|
2011-07-07 10:43:59 +02:00
|
|
|
} // namespace Internal
|
|
|
|
|
|
|
|
|
|
using namespace Internal;
|
|
|
|
|
|
2019-06-13 17:03:56 +02:00
|
|
|
UploadAndInstallTarPackageService::UploadAndInstallTarPackageService()
|
|
|
|
|
: d(new UploadAndInstallTarPackageServicePrivate)
|
2011-07-07 10:43:59 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UploadAndInstallTarPackageService::~UploadAndInstallTarPackageService()
|
|
|
|
|
{
|
2011-09-15 09:10:10 +02:00
|
|
|
delete d;
|
2011-07-07 10:43:59 +02:00
|
|
|
}
|
|
|
|
|
|
2011-07-19 17:30:37 +02:00
|
|
|
AbstractRemoteLinuxPackageInstaller *UploadAndInstallTarPackageService::packageInstaller() const
|
2011-07-07 10:43:59 +02:00
|
|
|
{
|
2011-09-15 09:10:10 +02:00
|
|
|
return &d->installer;
|
2011-07-07 10:43:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UploadAndInstallTarPackageStep::UploadAndInstallTarPackageStep(BuildStepList *bsl)
|
|
|
|
|
: AbstractRemoteLinuxDeployStep(bsl, stepId())
|
|
|
|
|
{
|
2019-06-13 17:03:56 +02:00
|
|
|
auto service = createDeployService<UploadAndInstallTarPackageService>();
|
|
|
|
|
|
2011-07-07 10:43:59 +02:00
|
|
|
setDefaultDisplayName(displayName());
|
2018-10-19 17:40:33 +02:00
|
|
|
setWidgetExpandedByDefault(false);
|
2011-07-07 10:43:59 +02:00
|
|
|
|
2019-06-13 17:03:56 +02:00
|
|
|
setInternalInitializer([this, service] {
|
2019-06-07 16:43:06 +02:00
|
|
|
const TarPackageCreationStep *pStep = nullptr;
|
|
|
|
|
|
|
|
|
|
for (BuildStep *step : deployConfiguration()->stepList()->steps()) {
|
|
|
|
|
if (step == this)
|
|
|
|
|
break;
|
|
|
|
|
if ((pStep = dynamic_cast<TarPackageCreationStep *>(step)))
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (!pStep)
|
|
|
|
|
return CheckResult::failure(tr("No tarball creation step found."));
|
|
|
|
|
|
2019-06-13 17:03:56 +02:00
|
|
|
service->setPackageFilePath(pStep->packageFilePath());
|
|
|
|
|
return service->isDeploymentPossible();
|
2019-06-07 16:43:06 +02:00
|
|
|
});
|
2011-07-07 10:43:59 +02:00
|
|
|
}
|
|
|
|
|
|
2012-03-15 17:17:40 +01:00
|
|
|
Core::Id UploadAndInstallTarPackageStep::stepId()
|
2011-07-07 10:43:59 +02:00
|
|
|
{
|
2013-09-03 11:42:35 +02:00
|
|
|
return "MaemoUploadAndInstallTarPackageStep";
|
2011-07-07 10:43:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString UploadAndInstallTarPackageStep::displayName()
|
|
|
|
|
{
|
|
|
|
|
return tr("Deploy tarball via SFTP upload");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} //namespace RemoteLinux
|