Commit 381b04fa authored by BogDan Vatra's avatar BogDan Vatra Committed by Daniel Teske

Android: Remove Necessitas support

Change-Id: I082acfad3b20d5e096fbb2ca3db775bb527eaf7a
Reviewed-by: default avatarBogDan Vatra <bogdan@kde.org>
parent c4451570
......@@ -17,12 +17,6 @@ HEADERS += \
androidtoolchain.h \
androidpackageinstallationstep.h \
androidpackageinstallationfactory.h \
androidpackagecreationstep.h \
androidpackagecreationfactory.h \
androidpackagecreationwidget.h \
androiddeploystep.h \
androiddeploystepwidget.h \
androiddeploystepfactory.h \
androiderrormessage.h \
androidglobal.h \
androidrunner.h \
......@@ -69,12 +63,6 @@ SOURCES += \
androidtoolchain.cpp \
androidpackageinstallationstep.cpp \
androidpackageinstallationfactory.cpp \
androidpackagecreationstep.cpp \
androidpackagecreationfactory.cpp \
androidpackagecreationwidget.cpp \
androiddeploystep.cpp \
androiddeploystepwidget.cpp \
androiddeploystepfactory.cpp \
androiderrormessage.cpp \
androidrunner.cpp \
androiddebugsupport.cpp \
......@@ -111,8 +99,6 @@ SOURCES += \
FORMS += \
androidsettingswidget.ui \
androidpackagecreationwidget.ui \
androiddeploystepwidget.ui \
addnewavddialog.ui \
androidcreatekeystorecertificate.ui \
androiddevicedialog.ui \
......
......@@ -39,13 +39,6 @@ QtcPlugin {
"androiddevicedialog.ui",
"androiddeployconfiguration.cpp",
"androiddeployconfiguration.h",
"androiddeploystep.cpp",
"androiddeploystep.h",
"androiddeploystepfactory.cpp",
"androiddeploystepfactory.h",
"androiddeploystepwidget.cpp",
"androiddeploystepwidget.h",
"androiddeploystepwidget.ui",
"androiddeployqtwidget.cpp",
"androiddeployqtwidget.h",
"androiddeployqtwidget.ui",
......@@ -70,13 +63,6 @@ QtcPlugin {
"androidmanifesteditorfactory.h",
"androidmanifesteditorwidget.cpp",
"androidmanifesteditorwidget.h",
"androidpackagecreationfactory.cpp",
"androidpackagecreationfactory.h",
"androidpackagecreationstep.cpp",
"androidpackagecreationstep.h",
"androidpackagecreationwidget.cpp",
"androidpackagecreationwidget.h",
"androidpackagecreationwidget.ui",
"androidpackageinstallationfactory.cpp",
"androidpackageinstallationfactory.h",
"androidpackageinstallationstep.cpp",
......
......@@ -844,7 +844,7 @@ QString AndroidConfig::bestNdkPlatformMatch(const QString &targetAPI) const
if (apiLevel <= target)
return QString::fromLatin1("android-%1").arg(apiLevel);
}
return QLatin1String("android-8");
return QLatin1String("android-9");
}
FileName AndroidConfig::sdkLocation() const
......
......@@ -29,7 +29,6 @@
#include "androiddebugsupport.h"
#include "androiddeploystep.h"
#include "androidglobal.h"
#include "androidrunner.h"
#include "androidmanager.h"
......
......@@ -29,9 +29,7 @@
#include "androiddeployconfiguration.h"
#include "androidconstants.h"
#include "androiddeploystep.h"
#include "androidpackageinstallationstep.h"
#include "androidpackagecreationstep.h"
#include "androiddeployqtstep.h"
#include "androidmanager.h"
......@@ -76,14 +74,8 @@ DeployConfiguration *AndroidDeployConfigurationFactory::create(Target *parent, C
{
AndroidDeployConfiguration *dc = new AndroidDeployConfiguration(parent, id);
if (id == ANDROID_DEPLOYCONFIGURATION_ID) {
dc->stepList()->insertStep(0, new AndroidPackageInstallationStep(AndroidPackageInstallationStep::ProjectDirectory, dc->stepList()));
dc->stepList()->insertStep(1, new AndroidPackageCreationStep(dc->stepList()));
dc->stepList()->insertStep(2, new AndroidDeployStep(dc->stepList()));
} else {
dc->stepList()->insertStep(0, new AndroidPackageInstallationStep(AndroidPackageInstallationStep::BuildDirectory, dc->stepList()));
dc->stepList()->insertStep(1, new AndroidDeployQtStep(dc->stepList()));
}
dc->stepList()->insertStep(0, new AndroidPackageInstallationStep(AndroidPackageInstallationStep::BuildDirectory, dc->stepList()));
dc->stepList()->insertStep(1, new AndroidDeployQtStep(dc->stepList()));
return dc;
}
......@@ -136,17 +128,13 @@ QList<Core::Id> AndroidDeployConfigurationFactory::availableCreationIds(Target *
QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(parent->kit());
if (qt->type() != QLatin1String(Constants::ANDROIDQT))
return ids;
if (qt->qtVersion() < QtSupport::QtVersionNumber(5, 2, 0))
ids << Core::Id(ANDROID_DEPLOYCONFIGURATION_ID);
else
ids << Core::Id(ANDROID_DEPLOYCONFIGURATION2_ID);
ids << Core::Id(ANDROID_DEPLOYCONFIGURATION_ID);
return ids;
}
QString AndroidDeployConfigurationFactory::displayNameForId(Core::Id id) const
{
if (id.name().startsWith(ANDROID_DC_PREFIX)
|| id.name().startsWith(ANDROID_DC2_PREFIX))
if (id.name().startsWith(ANDROID_DC_PREFIX))
return tr("Deploy on Android");
return QString();
}
......
......@@ -35,12 +35,9 @@
namespace Android {
namespace Internal {
const char ANDROID_DEPLOYCONFIGURATION_ID[] = "Qt4ProjectManager.AndroidDeployConfiguration";
const char ANDROID_DC_PREFIX[] = "Qt4ProjectManager.AndroidDeployConfiguration.";
// Qt 5.2 has a new form of deployment
const char ANDROID_DEPLOYCONFIGURATION2_ID[] = "Qt4ProjectManager.AndroidDeployConfiguration2";
const char ANDROID_DC2_PREFIX[] = "Qt4ProjectManager.AndroidDeployConfiguration2.";
const char ANDROID_DEPLOYCONFIGURATION_ID[] = "Qt4ProjectManager.AndroidDeployConfiguration2";
const char ANDROID_DC_PREFIX[] = "Qt4ProjectManager.AndroidDeployConfiguration2.";
class AndroidDeployConfiguration : public ProjectExplorer::DeployConfiguration
{
......
......@@ -81,9 +81,6 @@ QList<Core::Id> AndroidDeployQtStepFactory::availableCreationIds(ProjectExplorer
return QList<Core::Id>();
if (parent->contains(AndroidDeployQtStep::Id))
return QList<Core::Id>();
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(parent->target()->kit());
if (!qtVersion || qtVersion->qtVersion() < QtSupport::QtVersionNumber(5, 2, 0))
return QList<Core::Id>();
return QList<Core::Id>() << AndroidDeployQtStep::Id;
}
......
This diff is collapsed.
/**************************************************************************
**
** Copyright (c) 2014 BogDan Vatra <bog_dan_ro@yahoo.com>
** 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 ANDROIDDEPLOYSTEP_H
#define ANDROIDDEPLOYSTEP_H
#include "androidconfigurations.h"
#include <projectexplorer/buildstep.h>
#include <qtsupport/baseqtversion.h>
#include <QProcess>
QT_BEGIN_NAMESPACE
class QEventLoop;
class QTimer;
QT_END_NAMESPACE
namespace Android {
namespace Internal {
class AndroidDeviceConfigListModel;
class AndroidPackageCreationStep;
class DeployItem
{
public:
DeployItem(const QString &_localFileName,
unsigned int _localTimeStamp,
const QString &_remoteFileName,
bool _needsStrip)
: localFileName(_localFileName),
remoteFileName(_remoteFileName),
localTimeStamp(_localTimeStamp),
remoteTimeStamp(0),
needsStrip(_needsStrip)
{}
QString localFileName;
QString remoteFileName;
unsigned int localTimeStamp;
unsigned int remoteTimeStamp;
bool needsStrip;
};
class AndroidDeployStep : public ProjectExplorer::BuildStep
{
Q_OBJECT
friend class AndroidDeployStepFactory;
public:
enum AndroidDeployAction
{
NoDeploy, // use ministro
DeployLocal,
InstallQASI, // unused old value
BundleLibraries
};
public:
AndroidDeployStep(ProjectExplorer::BuildStepList *bc);
virtual ~AndroidDeployStep();
QString deviceSerialNumber();
AndroidDeployAction deployAction();
bool fromMap(const QVariantMap &map);
QVariantMap toMap() const;
bool bundleQtOptionAvailable();
public slots:
void setDeployAction(AndroidDeployAction deploy);
signals:
void done();
void error();
void deployOptionsChanged();
private slots:
bool deployPackage();
void handleBuildOutput();
void handleBuildError();
void kitUpdated(ProjectExplorer::Kit *kit);
private:
AndroidDeployStep(ProjectExplorer::BuildStepList *bc,
AndroidDeployStep *other);
virtual bool init();
virtual void run(QFutureInterface<bool> &fi);
virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
virtual bool immutable() const { return true; }
void ctor();
void raiseError(const QString &error);
void writeOutput(const QString &text, OutputFormat = MessageOutput);
bool runCommand(QProcess *buildProc, const QString &program, const QStringList &arguments);
unsigned int remoteModificationTime(const QString &fullDestination,
QHash<QString, unsigned int> *cache);
void collectFiles(QList<DeployItem> *deployList, const QString &localPath,
const QString &remotePath, bool strip, const QStringList &filter = QStringList());
void filterModificationTimes(QList<DeployItem> *deployList);
void copyFilesToTemp(QList<DeployItem> *deployList, const QString &tempDirectory, const QString &sourcePrefix);
void fetchRemoteModificationTimes(QList<DeployItem> *deployList);
void stripFiles(const QList<DeployItem> &deployList, ProjectExplorer::Abi::Architecture architecture, const QString &ndkToolchainVersion);
void deployFiles(QProcess *process, const QList<DeployItem> &deployList);
bool checkForQt51Files();
private:
QString m_deviceSerialNumber;
int m_deviceAPILevel;
QString m_targetArch;
AndroidDeployAction m_deployAction;
// members to transfer data from init() to run
QString m_avdName;
QString m_packageName;
QString m_qtVersionSourcePath;
bool m_signPackage;
Utils::FileName m_androidDirPath;
QString m_apkPathDebug;
QString m_apkPathRelease;
QString m_buildDirectory;
AndroidDeployAction m_runDeployAction;
QString m_ndkToolChainVersion;
QString m_libgnustl;
bool m_bundleQtAvailable;
static const Core::Id Id;
};
} // namespace Internal
} // namespace Android
#endif // ANDROIDDEPLOYSTEP_H
/**************************************************************************
**
** Copyright (c) 2014 BogDan Vatra <bog_dan_ro@yahoo.com>
** 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 "androiddeploystepfactory.h"
#include "androiddeploystep.h"
#include "androidmanager.h"
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <qtsupport/qtsupportconstants.h>
#include <qtsupport/qtkitinformation.h>
#include <QCoreApplication>
using namespace ProjectExplorer;
namespace Android {
namespace Internal {
AndroidDeployStepFactory::AndroidDeployStepFactory(QObject *parent)
: IBuildStepFactory(parent)
{
}
QList<Core::Id> AndroidDeployStepFactory::availableCreationIds(BuildStepList *parent) const
{
if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
return QList<Core::Id>();
if (!AndroidManager::supportsAndroid(parent->target()))
return QList<Core::Id>();
if (parent->contains(AndroidDeployStep::Id))
return QList<Core::Id>();
QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(parent->target()->kit());
if (qtVersion && qtVersion->qtVersion() >= QtSupport::QtVersionNumber(5, 2, 0))
return QList<Core::Id>();
return QList<Core::Id>() << AndroidDeployStep::Id;
}
QString AndroidDeployStepFactory::displayNameForId(Core::Id id) const
{
if (id == AndroidDeployStep::Id)
return tr("Deploy to Android device or emulator");
return QString();
}
bool AndroidDeployStepFactory::canCreate(BuildStepList *parent, Core::Id id) const
{
return availableCreationIds(parent).contains(id);
}
BuildStep *AndroidDeployStepFactory::create(BuildStepList *parent, Core::Id id)
{
Q_ASSERT(canCreate(parent, id));
Q_UNUSED(id);
return new AndroidDeployStep(parent);
}
bool AndroidDeployStepFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const
{
return canCreate(parent, idFromMap(map));
}
BuildStep *AndroidDeployStepFactory::restore(BuildStepList *parent, const QVariantMap &map)
{
Q_ASSERT(canRestore(parent, map));
AndroidDeployStep * const step = new AndroidDeployStep(parent);
if (!step->fromMap(map)) {
delete step;
return 0;
}
return step;
}
bool AndroidDeployStepFactory::canClone(BuildStepList *parent, BuildStep *product) const
{
return canCreate(parent, product->id());
}
BuildStep *AndroidDeployStepFactory::clone(BuildStepList *parent, BuildStep *product)
{
Q_ASSERT(canClone(parent, product));
return new AndroidDeployStep(parent, static_cast<AndroidDeployStep *>(product));
}
} // namespace Internal
} // namespace Android
/**************************************************************************
**
** Copyright (c) 2014 BogDan Vatra <bog_dan_ro@yahoo.com>
** 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 ANDROIDDEPLOYSTEPFACTORY_H
#define ANDROIDDEPLOYSTEPFACTORY_H
#include <projectexplorer/buildstep.h>
namespace Android {
namespace Internal {
class AndroidDeployStepFactory : public ProjectExplorer::IBuildStepFactory
{
Q_OBJECT
public:
explicit AndroidDeployStepFactory(QObject *parent = 0);
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const;
QString displayNameForId(Core::Id id) const;
bool canCreate(ProjectExplorer::BuildStepList *parent, Core::Id id) const;
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, Core::Id id);
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map);
bool canClone(ProjectExplorer::BuildStepList *parent,
ProjectExplorer::BuildStep *product) const;
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
ProjectExplorer::BuildStep *product);
};
} // namespace Internal
} // namespace Android
#endif // ANDROIDDEPLOYSTEPFACTORY_H
/**************************************************************************
**
** Copyright (c) 2014 BogDan Vatra <bog_dan_ro@yahoo.com>
** 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 "androiddeploystepwidget.h"
#include "ui_androiddeploystepwidget.h"
#include "androiddeploystep.h"
#include "androidmanager.h"
#include "androidrunconfiguration.h"
#include <coreplugin/icore.h>
#include <QFileDialog>
namespace Android {
namespace Internal {
AndroidDeployStepWidget::AndroidDeployStepWidget(AndroidDeployStep *step) :
ProjectExplorer::BuildStepConfigWidget(),
ui(new Ui::AndroidDeployStepWidget),
m_step(step)
{
ui->setupUi(this);
deployOptionsChanged();
connect(ui->ministroOption, SIGNAL(clicked()), SLOT(setMinistro()));
connect(ui->temporaryQtOption, SIGNAL(clicked()), SLOT(setDeployLocalQtLibs()));
connect(ui->bundleQtOption, SIGNAL(clicked()), SLOT(setBundleQtLibs()));
connect(ui->chooseButton, SIGNAL(clicked()), SLOT(setQASIPackagePath()));
connect(ui->cleanLibsPushButton, SIGNAL(clicked()), SLOT(cleanLibsOnDevice()));
connect(ui->resetDefaultDevices, SIGNAL(clicked()), SLOT(resetDefaultDevices()));
connect(m_step, SIGNAL(deployOptionsChanged()),
this, SLOT(deployOptionsChanged()));
}
void AndroidDeployStepWidget::deployOptionsChanged()
{
switch (m_step->deployAction()) {
case AndroidDeployStep::NoDeploy:
ui->ministroOption->setChecked(true);
break;
case AndroidDeployStep::DeployLocal:
ui->temporaryQtOption->setChecked(true);
break;
case AndroidDeployStep::BundleLibraries:
ui->bundleQtOption->setChecked(true);
break;
default:
ui->ministroOption->setChecked(true);
break;
}
ui->bundleQtOption->setVisible(m_step->bundleQtOptionAvailable());
}
AndroidDeployStepWidget::~AndroidDeployStepWidget()
{
delete ui;
}
QString AndroidDeployStepWidget::displayName() const
{
return tr("<b>Deploy configurations</b>");
}
QString AndroidDeployStepWidget::summaryText() const
{
return displayName();
}
void AndroidDeployStepWidget::setMinistro()
{
m_step->setDeployAction(AndroidDeployStep::NoDeploy);
}
void AndroidDeployStepWidget::setDeployLocalQtLibs()
{
m_step->setDeployAction(AndroidDeployStep::DeployLocal);
}
void AndroidDeployStepWidget::setBundleQtLibs()
{
m_step->setDeployAction(AndroidDeployStep::BundleLibraries);
}
void AndroidDeployStepWidget::setQASIPackagePath()
{
QString packagePath =
QFileDialog::getOpenFileName(this, tr("Qt Android Smart Installer"),
QDir::homePath(), tr("Android package (*.apk)"));
if (!packagePath.isEmpty())
AndroidManager::installQASIPackage(m_step->target(), packagePath);
}
void AndroidDeployStepWidget::cleanLibsOnDevice()
{
AndroidManager::cleanLibsOnDevice(m_step->target());