2011-07-07 10:43:59 +02:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
|
|
|
|
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
|
|
|
|
**
|
|
|
|
|
** Contact: Nokia Corporation (info@qt.nokia.com)
|
|
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
|
|
|
|
** 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, Nokia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
|
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
|
|
|
|
** If you have questions regarding the use of this file, please contact
|
|
|
|
|
** Nokia at info@qt.nokia.com.
|
|
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
#include <projectexplorer/buildsteplist.h>
|
|
|
|
|
|
|
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
|
|
|
|
|
namespace RemoteLinux {
|
|
|
|
|
namespace Internal {
|
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
|
|
|
};
|
|
|
|
|
} // 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());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool UploadAndInstallTarPackageStep::isDeploymentPossible(QString *whyNot) const
|
|
|
|
|
{
|
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) {
|
|
|
|
|
if (whyNot)
|
|
|
|
|
*whyNot = tr("No tarball creation step found.");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
m_deployService->setPackageFilePath(pStep->packageFilePath());
|
|
|
|
|
return AbstractRemoteLinuxDeployStep::isDeploymentPossible(whyNot);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString UploadAndInstallTarPackageStep::stepId()
|
|
|
|
|
{
|
|
|
|
|
return QLatin1String("MaemoUploadAndInstallTarPackageStep");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString UploadAndInstallTarPackageStep::displayName()
|
|
|
|
|
{
|
|
|
|
|
return tr("Deploy tarball via SFTP upload");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} //namespace RemoteLinux
|