2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-07-07 10:43:59 +02:00
|
|
|
**
|
2013-01-28 17:12:19 +01:00
|
|
|
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
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
|
|
|
|
|
** 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.
|
2011-07-07 10:43:59 +02:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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
|
2011-07-07 10:43:59 +02:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02: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;
|
|
|
|
|
|
|
|
|
|
UploadAndInstallTarPackageService::UploadAndInstallTarPackageService(QObject *parent)
|
|
|
|
|
: AbstractUploadAndInstallPackageService(parent),
|
2011-09-15 09:10:10 +02:00
|
|
|
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())
|
|
|
|
|
{
|
|
|
|
|
ctor();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UploadAndInstallTarPackageStep::UploadAndInstallTarPackageStep(BuildStepList *bsl,
|
|
|
|
|
UploadAndInstallTarPackageStep *other)
|
|
|
|
|
: AbstractRemoteLinuxDeployStep(bsl, other)
|
|
|
|
|
{
|
|
|
|
|
ctor();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void UploadAndInstallTarPackageStep::ctor()
|
|
|
|
|
{
|
|
|
|
|
m_deployService = new UploadAndInstallTarPackageService(this);
|
|
|
|
|
setDefaultDisplayName(displayName());
|
|
|
|
|
}
|
|
|
|
|
|
2011-11-23 11:55:38 +01:00
|
|
|
bool UploadAndInstallTarPackageStep::initInternal(QString *error)
|
2011-07-07 10:43:59 +02:00
|
|
|
{
|
2011-07-15 16:57:25 +02:00
|
|
|
const TarPackageCreationStep * const pStep
|
2011-07-25 11:55:00 +02:00
|
|
|
= deployConfiguration()->earlierBuildStep<TarPackageCreationStep>(this);
|
2011-07-07 10:43:59 +02:00
|
|
|
if (!pStep) {
|
2011-11-23 11:55:38 +01:00
|
|
|
if (error)
|
|
|
|
|
*error = tr("No tarball creation step found.");
|
2011-07-07 10:43:59 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
m_deployService->setPackageFilePath(pStep->packageFilePath());
|
2011-11-23 11:55:38 +01:00
|
|
|
return m_deployService->isDeploymentPossible(error);
|
2011-07-07 10:43:59 +02:00
|
|
|
}
|
|
|
|
|
|
2011-12-09 13:22:57 +01:00
|
|
|
BuildStepConfigWidget *UploadAndInstallTarPackageStep::createConfigWidget()
|
|
|
|
|
{
|
2012-01-09 16:23:40 +01:00
|
|
|
return new SimpleBuildStepConfigWidget(this);
|
2011-12-09 13:22:57 +01:00
|
|
|
}
|
|
|
|
|
|
2012-03-15 17:17:40 +01:00
|
|
|
Core::Id UploadAndInstallTarPackageStep::stepId()
|
2011-07-07 10:43:59 +02:00
|
|
|
{
|
2012-03-15 17:17:40 +01:00
|
|
|
return Core::Id("MaemoUploadAndInstallTarPackageStep");
|
2011-07-07 10:43:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString UploadAndInstallTarPackageStep::displayName()
|
|
|
|
|
{
|
|
|
|
|
return tr("Deploy tarball via SFTP upload");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} //namespace RemoteLinux
|