Merge remote-tracking branch 'origin/3.0'

Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/git/gitplugin.cpp
	src/plugins/qt4projectmanager/qmakeproject.cpp

Change-Id: Icbd485214b1add7869233dfe0dd9c6a76bddfc7d
This commit is contained in:
Eike Ziller
2013-10-22 08:40:59 +02:00
514 changed files with 4458 additions and 3132 deletions

View File

@@ -223,43 +223,57 @@ void AndroidConfigurations::setConfig(const AndroidConfig &devConfigs)
detectToolchainHost();
save();
updateAvailablePlatforms();
updateAvailableNdkPlatforms();
updateAvailableSdkPlatforms();
updateAutomaticKitList();
updateAndroidDevice();
emit updated();
}
void AndroidConfigurations::updateAvailablePlatforms()
void AndroidConfigurations::updateAvailableNdkPlatforms()
{
m_availablePlatforms.clear();
m_availableNdkPlatforms.clear();
FileName path = m_config.ndkLocation;
QDirIterator it(path.appendPath(QLatin1String("platforms")).toString(), QStringList() << QLatin1String("android-*"), QDir::Dirs);
while (it.hasNext()) {
const QString &fileName = it.next();
m_availablePlatforms.push_back(fileName.mid(fileName.lastIndexOf(QLatin1Char('-')) + 1).toInt());
m_availableNdkPlatforms.push_back(fileName.mid(fileName.lastIndexOf(QLatin1Char('-')) + 1).toInt());
}
qSort(m_availablePlatforms.begin(), m_availablePlatforms.end(), qGreater<int>());
qSort(m_availableNdkPlatforms.begin(), m_availableNdkPlatforms.end(), qGreater<int>());
}
QStringList AndroidConfigurations::sdkTargets(int minApiLevel) const
void AndroidConfigurations::updateAvailableSdkPlatforms()
{
QStringList targets;
m_availableSdkPlatforms.clear();
QProcess proc;
proc.start(androidToolPath().toString(), QStringList() << QLatin1String("list") << QLatin1String("target")); // list avaialbe AVDs
if (!proc.waitForFinished(-1)) {
proc.terminate();
return targets;
return;
}
while (proc.canReadLine()) {
const QString line = QString::fromLocal8Bit(proc.readLine().trimmed());
int index = line.indexOf(QLatin1String("\"android-"));
if (index == -1)
continue;
QString apiLevel = line.mid(index + 1, line.length() - index - 2);
if (apiLevel.mid(apiLevel.lastIndexOf(QLatin1Char('-')) + 1).toInt() >= minApiLevel)
targets.push_back(apiLevel);
QString androidTarget = line.mid(index + 1, line.length() - index - 2);
int apiLevel = androidTarget.mid(androidTarget.lastIndexOf(QLatin1Char('-')) + 1).toInt();
QVector<int>::iterator it = qLowerBound(m_availableSdkPlatforms.begin(), m_availableSdkPlatforms.end(), apiLevel, qGreater<int>());
m_availableSdkPlatforms.insert(it, apiLevel);
}
return targets;
}
QStringList AndroidConfigurations::sdkTargets(int minApiLevel) const
{
QStringList result;
for (int i = 0; i < m_availableSdkPlatforms.size(); ++i) {
if (m_availableSdkPlatforms.at(i) >= minApiLevel)
result << QLatin1String("android-") + QString::number(m_availableSdkPlatforms.at(i));
else
break;
}
return result;
}
FileName AndroidConfigurations::adbToolPath() const
@@ -470,6 +484,8 @@ QString AndroidConfigurations::createAVD(int minApiLevel, QString targetArch) co
QDialog d;
Ui::AddNewAVDDialog avdDialog;
avdDialog.setupUi(&d);
// NOTE: adb list targets does actually include information on which abis are supported per apilevel
// we aren't using that information here
avdDialog.targetComboBox->addItems(sdkTargets(minApiLevel));
if (targetArch.isEmpty())
@@ -735,17 +751,17 @@ QStringList AndroidConfigurations::getAbis(const QString &device) const
return result;
}
QString AndroidConfigurations::highestAvailableAndroidPlatform() const
QString AndroidConfigurations::highestAndroidSdk() const
{
if (m_availablePlatforms.isEmpty())
if (m_availableSdkPlatforms.isEmpty())
return QString();
return QLatin1String("android-") + QString::number(m_availablePlatforms.first());
return QLatin1String("android-") + QString::number(m_availableSdkPlatforms.first());
}
QString AndroidConfigurations::bestMatch(const QString &targetAPI) const
QString AndroidConfigurations::bestNdkPlatformMatch(const QString &targetAPI) const
{
int target = targetAPI.mid(targetAPI.lastIndexOf(QLatin1Char('-')) + 1).toInt();
foreach (int apiLevel, m_availablePlatforms) {
foreach (int apiLevel, m_availableNdkPlatforms) {
if (apiLevel <= target)
return QString::fromLatin1("android-%1").arg(apiLevel);
}
@@ -901,7 +917,8 @@ AndroidConfigurations::AndroidConfigurations(QObject *parent)
: QObject(parent)
{
load();
updateAvailablePlatforms();
updateAvailableNdkPlatforms();
updateAvailableSdkPlatforms();
connect(ProjectExplorer::SessionManager::instance(), SIGNAL(projectRemoved(ProjectExplorer::Project*)),
this, SLOT(clearDefaultDevices(ProjectExplorer::Project*)));

View File

@@ -107,7 +107,7 @@ public:
QString startAVD(const QString &name, int apiLevel, QString cpuAbi) const;
bool startAVDAsync(const QString &avdName) const;
QString waitForAvd(int apiLevel, const QString &cpuAbi) const;
QString bestMatch(const QString &targetAPI) const;
QString bestNdkPlatformMatch(const QString &targetAPI) const;
QStringList makeExtraSearchDirectories() const;
@@ -124,7 +124,7 @@ public:
AndroidDeviceInfo showDeviceDialog(ProjectExplorer::Project *project, int apiLevel, const QString &abi);
void setDefaultDevice(ProjectExplorer::Project *project, const QString &abi, const QString &serialNumber); // serial number or avd name
QString defaultDevice(ProjectExplorer::Project *project, const QString &abi) const; // serial number or avd name
QString highestAvailableAndroidPlatform() const;
QString highestAndroidSdk() const;
public slots:
void clearDefaultDevices(ProjectExplorer::Project *project);
@@ -145,12 +145,15 @@ private:
int getSDKVersion(const QString &device) const;
QStringList getAbis(const QString &device) const;
void updateAvailablePlatforms();
void updateAvailableNdkPlatforms();
void updateAvailableSdkPlatforms();
static AndroidConfigurations *m_instance;
AndroidConfig m_config;
QVector<int> m_availablePlatforms;
QVector<int> m_availableNdkPlatforms;
QVector<int> m_availableSdkPlatforms;
mutable QHash<QString, QString> m_serialNumberToDeviceName;
QMap<ProjectExplorer::Project *, QMap<QString, QString> > m_defaultDeviceForAbi;

View File

@@ -43,9 +43,9 @@
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt4nodes.h>
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qtsupport/qtkitinformation.h>
#include <QDir>
@@ -53,7 +53,7 @@
using namespace Debugger;
using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
using namespace QmakeProjectManager;
namespace Android {
namespace Internal {

View File

@@ -39,7 +39,7 @@
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
@@ -124,7 +124,7 @@ DeployConfiguration *AndroidDeployConfigurationFactory::clone(Target *parent, De
QList<Core::Id> AndroidDeployConfigurationFactory::availableCreationIds(Target *parent) const
{
QList<Core::Id> ids;
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(parent->project()))
if (!qobject_cast<QmakeProjectManager::Qt4Project *>(parent->project()))
return ids;
if (!parent->project()->supportsKit(parent->kit()))

View File

@@ -45,9 +45,9 @@
#include <projectexplorer/target.h>
#include <projectexplorer/project.h>
#include <qtsupport/qtkitinformation.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4nodes.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <QInputDialog>
#include <QMessageBox>
@@ -158,7 +158,7 @@ void AndroidDeployQtStep::ctor()
m_verbose = false;
// will be overwriten by settings if the user choose something different
m_buildTargetSdk = AndroidConfigurations::instance().highestAvailableAndroidPlatform();
m_buildTargetSdk = AndroidConfigurations::instance().highestAndroidSdk();
connect(project(), SIGNAL(proFilesEvaluated()),
this, SLOT(updateInputFile()));
@@ -167,7 +167,7 @@ void AndroidDeployQtStep::ctor()
bool AndroidDeployQtStep::init()
{
if (AndroidManager::checkForQt51Files(project()->projectDirectory()))
emit addOutput(tr("Found old Android folder in source directory. Qt 5.2 does not use that folder by default."), ErrorOutput);
emit addOutput(tr("Found old folder \"android\" in source directory. Qt 5.2 does not use that folder by default."), ErrorOutput);
m_targetArch = AndroidManager::targetArch(target());
if (m_targetArch.isEmpty()) {
@@ -188,8 +188,8 @@ bool AndroidDeployQtStep::init()
m_serialNumber = info.serialNumber;
}
Qt4ProjectManager::Qt4BuildConfiguration *bc
= static_cast<Qt4ProjectManager::Qt4BuildConfiguration *>(target()->activeBuildConfiguration());
QmakeProjectManager::Qt4BuildConfiguration *bc
= static_cast<QmakeProjectManager::Qt4BuildConfiguration *>(target()->activeBuildConfiguration());
if (m_signPackage) {
// check keystore and certificate passwords
@@ -344,12 +344,12 @@ void AndroidDeployQtStep::runCommand(const QString &program, const QStringList &
void AndroidDeployQtStep::updateInputFile()
{
Qt4ProjectManager::Qt4Project *pro = static_cast<Qt4ProjectManager::Qt4Project *>(project());
QList<Qt4ProjectManager::Qt4ProFileNode *> nodes = pro->applicationProFiles();
QmakeProjectManager::Qt4Project *pro = static_cast<QmakeProjectManager::Qt4Project *>(project());
QList<QmakeProjectManager::Qt4ProFileNode *> nodes = pro->applicationProFiles();
QStringList inputFiles;
foreach (Qt4ProjectManager::Qt4ProFileNode *node, nodes)
inputFiles << node->singleVariableValue(Qt4ProjectManager::AndroidDeploySettingsFile);
foreach (QmakeProjectManager::Qt4ProFileNode *node, nodes)
inputFiles << node->singleVariableValue(QmakeProjectManager::AndroidDeploySettingsFile);
if (!inputFiles.contains(m_inputFile))
m_inputFile.clear();

View File

@@ -38,9 +38,9 @@
#include "androidextralibrarylistmodel.h"
#include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4nodes.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <QFileDialog>
@@ -135,7 +135,7 @@ AndroidDeployQtWidget::AndroidDeployQtWidget(AndroidDeployQtStep *step)
connect(m_ui->createAndroidManifestButton, SIGNAL(clicked()),
this, SLOT(createManifestButton()));
m_extraLibraryListModel = new AndroidExtraLibraryListModel(static_cast<Qt4ProjectManager::Qt4Project *>(m_step->project()),
m_extraLibraryListModel = new AndroidExtraLibraryListModel(static_cast<QmakeProjectManager::Qt4Project *>(m_step->project()),
this);
m_ui->androidExtraLibsListView->setModel(m_extraLibraryListModel);
@@ -156,8 +156,8 @@ AndroidDeployQtWidget::~AndroidDeployQtWidget()
void AndroidDeployQtWidget::checkProjectTemplate()
{
Qt4ProjectManager::Qt4Project *project = static_cast<Qt4ProjectManager::Qt4Project *>(m_step->project());
if (project->rootQt4ProjectNode()->projectType() == Qt4ProjectManager::ApplicationTemplate)
QmakeProjectManager::Qt4Project *project = static_cast<QmakeProjectManager::Qt4Project *>(m_step->project());
if (project->rootQt4ProjectNode()->projectType() == QmakeProjectManager::ApplicationTemplate)
m_ui->additionalLibrariesGroupBox->setEnabled(true);
else
m_ui->additionalLibrariesGroupBox->setEnabled(false);
@@ -171,9 +171,9 @@ void AndroidDeployQtWidget::createManifestButton()
void AndroidDeployQtWidget::updateInputFileUi()
{
Qt4ProjectManager::Qt4Project *project
= static_cast<Qt4ProjectManager::Qt4Project *>(m_step->project());
QList<Qt4ProjectManager::Qt4ProFileNode *> nodes = project->applicationProFiles();
QmakeProjectManager::Qt4Project *project
= static_cast<QmakeProjectManager::Qt4Project *>(m_step->project());
QList<QmakeProjectManager::Qt4ProFileNode *> nodes = project->applicationProFiles();
int size = nodes.size();
if (size == 0 || size == 1) {
// there's nothing to select, e.g. before parsing
@@ -185,8 +185,8 @@ void AndroidDeployQtWidget::updateInputFileUi()
m_ui->inputFileComboBox->setVisible(true);
m_ui->inputFileComboBox->clear();
foreach (Qt4ProjectManager::Qt4ProFileNode *node, nodes) {
QString file = node->singleVariableValue(Qt4ProjectManager::AndroidDeploySettingsFile);
foreach (QmakeProjectManager::Qt4ProFileNode *node, nodes) {
QString file = node->singleVariableValue(QmakeProjectManager::AndroidDeploySettingsFile);
m_ui->inputFileComboBox->addItem(node->displayName(), file);
}
@@ -325,8 +325,8 @@ void AndroidDeployQtWidget::activeBuildConfigurationChanged()
disconnect(m_currentBuildConfiguration, SIGNAL(qmakeBuildConfigurationChanged()),
this, SLOT(updateSigningWarning()));
updateSigningWarning();
Qt4ProjectManager::Qt4BuildConfiguration *bc
= qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration *>(m_step->target()->activeBuildConfiguration());
QmakeProjectManager::Qt4BuildConfiguration *bc
= qobject_cast<QmakeProjectManager::Qt4BuildConfiguration *>(m_step->target()->activeBuildConfiguration());
m_currentBuildConfiguration = bc;
if (bc)
connect(bc, SIGNAL(qmakeBuildConfigurationChanged()), this, SLOT(updateSigningWarning()));
@@ -335,7 +335,7 @@ void AndroidDeployQtWidget::activeBuildConfigurationChanged()
void AndroidDeployQtWidget::updateSigningWarning()
{
Qt4ProjectManager::Qt4BuildConfiguration *bc = qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration *>(m_step->target()->activeBuildConfiguration());
QmakeProjectManager::Qt4BuildConfiguration *bc = qobject_cast<QmakeProjectManager::Qt4BuildConfiguration *>(m_step->target()->activeBuildConfiguration());
bool debug = bc && (bc->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild);
if (m_step->signPackage() && debug) {
m_ui->signingDebugWarningIcon->setVisible(true);

View File

@@ -38,7 +38,7 @@ QT_BEGIN_NAMESPACE
namespace Ui { class AndroidDeployQtWidget; }
QT_END_NAMESPACE
namespace Qt4ProjectManager { class Qt4BuildConfiguration; }
namespace QmakeProjectManager { class Qt4BuildConfiguration; }
namespace Android {
namespace Internal {
@@ -85,7 +85,7 @@ private:
Ui::AndroidDeployQtWidget *m_ui;
AndroidDeployQtStep *m_step;
AndroidExtraLibraryListModel *m_extraLibraryListModel;
Qt4ProjectManager::Qt4BuildConfiguration *m_currentBuildConfiguration;
QmakeProjectManager::Qt4BuildConfiguration *m_currentBuildConfiguration;
bool m_ignoreChange;
};

View File

@@ -210,7 +210,7 @@
<item row="0" column="0">
<widget class="QLabel" name="inputFileLabel">
<property name="text">
<string>Android deploy Qt input file:</string>
<string>Input file for androiddeployqt:</string>
</property>
</widget>
</item>
@@ -241,7 +241,7 @@
<item>
<widget class="QLabel" name="oldFilesWarningLabel">
<property name="text">
<string>Qt no longer uses the android folder in the project's source directory.</string>
<string>Qt no longer uses the folder "android" in the project's source directory.</string>
</property>
<property name="wordWrap">
<bool>true</bool>

View File

@@ -44,9 +44,9 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4nodes.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qtsupport/qtkitinformation.h>
@@ -56,7 +56,7 @@
using namespace Core;
using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
using namespace QmakeProjectManager;
namespace Android {
namespace Internal {
@@ -143,7 +143,7 @@ bool AndroidDeployStep::init()
}
m_ndkToolChainVersion = static_cast<AndroidToolChain *>(tc)->ndkToolChainVersion();
QString arch = static_cast<Qt4Project *>(project())->rootQt4ProjectNode()->singleVariableValue(Qt4ProjectManager::AndroidArchVar);
QString arch = static_cast<Qt4Project *>(project())->rootQt4ProjectNode()->singleVariableValue(QmakeProjectManager::AndroidArchVar);
if (!arch.isEmpty())
m_libgnustl = AndroidManager::libGnuStl(arch, m_ndkToolChainVersion);
return true;
@@ -498,4 +498,4 @@ void AndroidDeployStep::writeOutput(const QString &text, OutputFormat format)
}
} // namespace Internal
} // namespace Qt4ProjectManager
} // namespace Android

View File

@@ -134,4 +134,4 @@ void AndroidDeployStepWidget::resetDefaultDevices()
}
} // namespace Internal
} // namespace Qt4ProjectManager
} // namespace Android

View File

@@ -29,13 +29,13 @@
****************************************************************************/
#include "androidextralibrarylistmodel.h"
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4nodes.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
using namespace Android;
using namespace Internal;
AndroidExtraLibraryListModel::AndroidExtraLibraryListModel(Qt4ProjectManager::Qt4Project *project,
AndroidExtraLibraryListModel::AndroidExtraLibraryListModel(QmakeProjectManager::Qt4Project *project,
QObject *parent)
: QAbstractItemModel(parent)
, m_project(project)
@@ -77,18 +77,18 @@ QVariant AndroidExtraLibraryListModel::data(const QModelIndex &index, int role)
void AndroidExtraLibraryListModel::reset()
{
if (m_project->rootQt4ProjectNode()->projectType() != Qt4ProjectManager::ApplicationTemplate)
if (m_project->rootQt4ProjectNode()->projectType() != QmakeProjectManager::ApplicationTemplate)
return;
beginResetModel();
Qt4ProjectManager::Qt4ProFileNode *node = m_project->rootQt4ProjectNode();
m_entries = node->variableValue(Qt4ProjectManager::AndroidExtraLibs);
QmakeProjectManager::Qt4ProFileNode *node = m_project->rootQt4ProjectNode();
m_entries = node->variableValue(QmakeProjectManager::AndroidExtraLibs);
endResetModel();
}
void AndroidExtraLibraryListModel::addEntries(const QStringList &list)
{
if (m_project->rootQt4ProjectNode()->projectType() != Qt4ProjectManager::ApplicationTemplate)
if (m_project->rootQt4ProjectNode()->projectType() != QmakeProjectManager::ApplicationTemplate)
return;
beginInsertRows(QModelIndex(), m_entries.size(), m_entries.size() + list.size());
@@ -96,7 +96,7 @@ void AndroidExtraLibraryListModel::addEntries(const QStringList &list)
foreach (QString path, list)
m_entries += QDir(m_project->projectDirectory()).relativeFilePath(path);
Qt4ProjectManager::Qt4ProFileNode *node = m_project->rootQt4ProjectNode();
QmakeProjectManager::Qt4ProFileNode *node = m_project->rootQt4ProjectNode();
node->setProVariable(QLatin1String("ANDROID_EXTRA_LIBS"), m_entries.join(QLatin1String(" ")));
endInsertRows();
@@ -109,7 +109,7 @@ bool greaterModelIndexByRow(const QModelIndex &a, const QModelIndex &b)
void AndroidExtraLibraryListModel::removeEntries(QModelIndexList list)
{
if (list.isEmpty() || m_project->rootQt4ProjectNode()->projectType() != Qt4ProjectManager::ApplicationTemplate)
if (list.isEmpty() || m_project->rootQt4ProjectNode()->projectType() != QmakeProjectManager::ApplicationTemplate)
return;
std::sort(list.begin(), list.end(), greaterModelIndexByRow);
@@ -128,6 +128,6 @@ void AndroidExtraLibraryListModel::removeEntries(QModelIndexList list)
endRemoveRows();
}
Qt4ProjectManager::Qt4ProFileNode *node = m_project->rootQt4ProjectNode();
QmakeProjectManager::Qt4ProFileNode *node = m_project->rootQt4ProjectNode();
node->setProVariable(QLatin1String("ANDROID_EXTRA_LIBS"), m_entries.join(QLatin1String(" ")));
}

View File

@@ -34,7 +34,7 @@
#include <QAbstractItemModel>
#include <QStringList>
namespace Qt4ProjectManager { class Qt4Project; }
namespace QmakeProjectManager { class Qt4Project; }
namespace Android {
namespace Internal {
@@ -42,7 +42,7 @@ class AndroidExtraLibraryListModel : public QAbstractItemModel
{
Q_OBJECT
public:
explicit AndroidExtraLibraryListModel(Qt4ProjectManager::Qt4Project *project,
explicit AndroidExtraLibraryListModel(QmakeProjectManager::Qt4Project *project,
QObject *parent = 0);
QModelIndex index(int row, int column, const QModelIndex &parent) const;
@@ -58,7 +58,7 @@ private slots:
void reset();
private:
Qt4ProjectManager::Qt4Project *m_project;
QmakeProjectManager::Qt4Project *m_project;
QStringList m_entries;
};

View File

@@ -42,10 +42,10 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <qt4projectmanager/qt4nodes.h>
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakeprojectmanagerconstants.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qtsupport/customexecutablerunconfiguration.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
@@ -127,7 +127,7 @@ namespace Internal {
bool AndroidManager::supportsAndroid(ProjectExplorer::Target *target)
{
if (!qobject_cast<Qt4ProjectManager::Qt4Project *>(target->project()))
if (!qobject_cast<QmakeProjectManager::Qt4Project *>(target->project()))
return false;
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
return version && version->platformName() == QLatin1String(QtSupport::Constants::ANDROID_PLATFORM);
@@ -237,17 +237,17 @@ QString AndroidManager::buildTargetSDK(ProjectExplorer::Target *target)
fallback = QLatin1String("android-9");
if (!createAndroidTemplatesIfNecessary(target))
return AndroidConfigurations::instance().bestMatch(fallback);
return fallback;
QFile file(defaultPropertiesPath(target).toString());
if (!file.open(QIODevice::ReadOnly))
return AndroidConfigurations::instance().bestMatch(fallback);
return fallback;
while (!file.atEnd()) {
QByteArray line = file.readLine();
if (line.startsWith("target="))
return QString::fromLatin1(line.trimmed().mid(7));
}
return AndroidConfigurations::instance().bestMatch(fallback);
return fallback;
}
bool AndroidManager::setBuildTargetSDK(ProjectExplorer::Target *target, const QString &sdk)
@@ -259,13 +259,13 @@ bool AndroidManager::setBuildTargetSDK(ProjectExplorer::Target *target, const QS
QString AndroidManager::targetArch(ProjectExplorer::Target *target)
{
Qt4ProjectManager::Qt4Project *pro = qobject_cast<Qt4ProjectManager::Qt4Project *>(target->project());
QmakeProjectManager::Qt4Project *pro = qobject_cast<QmakeProjectManager::Qt4Project *>(target->project());
if (!pro)
return QString();
Qt4ProjectManager::Qt4ProFileNode *node = pro->rootQt4ProjectNode();
QmakeProjectManager::Qt4ProFileNode *node = pro->rootQt4ProjectNode();
if (!node)
return QString();
return node->singleVariableValue(Qt4ProjectManager::AndroidArchVar);
return node->singleVariableValue(QmakeProjectManager::AndroidArchVar);
}
Utils::FileName AndroidManager::dirPath(ProjectExplorer::Target *target)
@@ -330,11 +330,11 @@ Utils::FileName AndroidManager::apkPath(ProjectExplorer::Target *target, BuildTy
QStringList AndroidManager::availableTargetApplications(ProjectExplorer::Target *target)
{
QStringList apps;
Qt4ProjectManager::Qt4Project *qt4Project = qobject_cast<Qt4ProjectManager::Qt4Project *>(target->project());
QmakeProjectManager::Qt4Project *qt4Project = qobject_cast<QmakeProjectManager::Qt4Project *>(target->project());
if (!qt4Project)
return apps;
foreach (Qt4ProjectManager::Qt4ProFileNode *proFile, qt4Project->applicationProFiles()) {
if (proFile->projectType() == Qt4ProjectManager::ApplicationTemplate) {
foreach (QmakeProjectManager::Qt4ProFileNode *proFile, qt4Project->applicationProFiles()) {
if (proFile->projectType() == QmakeProjectManager::ApplicationTemplate) {
if (proFile->targetInformation().target.startsWith(QLatin1String("lib"))
&& proFile->targetInformation().target.endsWith(QLatin1String(".so")))
apps << proFile->targetInformation().target.mid(3, proFile->targetInformation().target.lastIndexOf(QLatin1Char('.')) - 3);
@@ -509,9 +509,9 @@ QString AndroidManager::targetApplicationPath(ProjectExplorer::Target *target)
QString selectedApp = targetApplication(target);
if (selectedApp.isEmpty())
return QString();
Qt4ProjectManager::Qt4Project *qt4Project = qobject_cast<Qt4ProjectManager::Qt4Project *>(target->project());
foreach (Qt4ProjectManager::Qt4ProFileNode *proFile, qt4Project->applicationProFiles()) {
if (proFile->projectType() == Qt4ProjectManager::ApplicationTemplate) {
QmakeProjectManager::Qt4Project *qt4Project = qobject_cast<QmakeProjectManager::Qt4Project *>(target->project());
foreach (QmakeProjectManager::Qt4ProFileNode *proFile, qt4Project->applicationProFiles()) {
if (proFile->projectType() == QmakeProjectManager::ApplicationTemplate) {
if (proFile->targetInformation().target.startsWith(QLatin1String("lib"))
&& proFile->targetInformation().target.endsWith(QLatin1String(".so"))) {
if (proFile->targetInformation().target.mid(3, proFile->targetInformation().target.lastIndexOf(QLatin1Char('.')) - 3)
@@ -529,7 +529,7 @@ QString AndroidManager::targetApplicationPath(ProjectExplorer::Target *target)
bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target *target)
{
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
Qt4ProjectManager::Qt4Project *qt4Project = qobject_cast<Qt4ProjectManager::Qt4Project*>(target->project());
QmakeProjectManager::Qt4Project *qt4Project = qobject_cast<QmakeProjectManager::Qt4Project*>(target->project());
if (!qt4Project || !qt4Project->rootProjectNode() || !version)
return false;
@@ -620,7 +620,7 @@ bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target *
return false;
}
updateTarget(target, AndroidConfigurations::instance().sdkTargets(minApiLevel).at(0));
updateTarget(target, sdks.first());
QStringList apps = availableTargetApplications(target);
if (!apps.isEmpty())
setTargetApplication(target, apps.at(0));
@@ -804,16 +804,16 @@ QVector<AndroidManager::Library> AndroidManager::availableQtLibsWithDependencies
if (tc->type() != QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE))
return QVector<AndroidManager::Library>();
Qt4ProjectManager::Qt4Project *project = static_cast<Qt4ProjectManager::Qt4Project *>(target->project());
QString arch = project->rootQt4ProjectNode()->singleVariableValue(Qt4ProjectManager::AndroidArchVar);
QmakeProjectManager::Qt4Project *project = static_cast<QmakeProjectManager::Qt4Project *>(target->project());
QString arch = project->rootQt4ProjectNode()->singleVariableValue(QmakeProjectManager::AndroidArchVar);
AndroidToolChain *atc = static_cast<AndroidToolChain *>(tc);
QString libgnustl = libGnuStl(arch, atc->ndkToolChainVersion());
Utils::FileName readelfPath = AndroidConfigurations::instance().readelfPath(target->activeRunConfiguration()->abi().architecture(),
atc->ndkToolChainVersion());
const Qt4ProjectManager::Qt4Project *const qt4Project
= qobject_cast<const Qt4ProjectManager::Qt4Project *>(target->project());
const QmakeProjectManager::Qt4Project *const qt4Project
= qobject_cast<const QmakeProjectManager::Qt4Project *>(target->project());
if (!qt4Project || !version)
return QVector<AndroidManager::Library>();
QString qtLibsPath = version->qmakeProperty("QT_INSTALL_LIBS");
@@ -904,12 +904,12 @@ bool AndroidManager::setBundledInLib(ProjectExplorer::Target *target, const QStr
QStringList AndroidManager::availablePrebundledLibs(ProjectExplorer::Target *target)
{
QStringList libs;
Qt4ProjectManager::Qt4Project *qt4Project = qobject_cast<Qt4ProjectManager::Qt4Project *>(target->project());
QmakeProjectManager::Qt4Project *qt4Project = qobject_cast<QmakeProjectManager::Qt4Project *>(target->project());
if (!qt4Project)
return libs;
foreach (Qt4ProjectManager::Qt4ProFileNode *node, qt4Project->allProFiles())
if (node->projectType() == Qt4ProjectManager::LibraryTemplate)
foreach (QmakeProjectManager::Qt4ProFileNode *node, qt4Project->allProFiles())
if (node->projectType() == QmakeProjectManager::LibraryTemplate)
libs << node->targetInformation().target;
return libs;
}
@@ -1317,4 +1317,4 @@ bool AndroidManager::checkForQt51Files(const QString &projectDirectory)
}
} // namespace Internal
} // namespace Qt4ProjectManager
} // namespace Android

View File

@@ -44,7 +44,7 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/kitinformation.h>
#include <texteditor/texteditoractionhandler.h>
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qmakeproject.h>
#include <QLineEdit>
#include <QFileInfo>

View File

@@ -42,9 +42,9 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4nodes.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qtsupport/qtkitinformation.h>
#include <coreplugin/icore.h>
@@ -72,7 +72,7 @@ namespace {
const QLatin1String CertificateSeparator("*******************************************");
}
using namespace Qt4ProjectManager;
using namespace QmakeProjectManager;
AndroidPackageCreationStep::AndroidPackageCreationStep(BuildStepList *bsl)
: BuildStep(bsl, CreatePackageId)
@@ -109,7 +109,7 @@ bool AndroidPackageCreationStep::init()
// Copying
m_androidDir = AndroidManager::dirPath(target());
Utils::FileName path = m_androidDir;
QString androidTargetArch = project->rootQt4ProjectNode()->singleVariableValue(Qt4ProjectManager::AndroidArchVar);
QString androidTargetArch = project->rootQt4ProjectNode()->singleVariableValue(QmakeProjectManager::AndroidArchVar);
if (androidTargetArch.isEmpty()) {
raiseError(tr("Cannot create Android package: No ANDROID_TARGET_ARCH set in make spec."));
return false;
@@ -435,7 +435,7 @@ void AndroidPackageCreationStep::collectFiles(QList<DeployItem> *deployList,
return;
Qt4Project *project = static_cast<Qt4Project *>(target()->project());
QString androidTargetArch = project->rootQt4ProjectNode()->singleVariableValue(Qt4ProjectManager::AndroidArchVar);
QString androidTargetArch = project->rootQt4ProjectNode()->singleVariableValue(QmakeProjectManager::AndroidArchVar);
QString androidAssetsPath = m_androidDir.toString() + QLatin1String("/assets/");
QString androidJarPath = m_androidDir.toString() + QLatin1String("/libs/");
@@ -882,4 +882,4 @@ void AndroidPackageCreationStep::raiseError(const QString &shortMsg,
const Core::Id AndroidPackageCreationStep::CreatePackageId("Qt4ProjectManager.AndroidPackageCreationStep");
} // namespace Internal
} // namespace Qt4ProjectManager
} // namespace Android

View File

@@ -41,7 +41,7 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakestep.h>
#include <QTimer>
@@ -56,7 +56,7 @@ namespace Android {
namespace Internal {
using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
using namespace QmakeProjectManager;
///////////////////////////// CheckModel /////////////////////////////

View File

@@ -41,7 +41,7 @@ class QFileSystemWatcher;
namespace Ui { class AndroidPackageCreationWidget; }
QT_END_NAMESPACE
namespace Qt4ProjectManager { class Qt4BuildConfiguration; }
namespace QmakeProjectManager { class Qt4BuildConfiguration; }
namespace Android {
namespace Internal {
@@ -112,7 +112,7 @@ private:
CheckModel *m_qtLibsModel;
CheckModel *m_prebundledLibs;
QFileSystemWatcher *m_fileSystemWatcher;
Qt4ProjectManager::Qt4BuildConfiguration *m_currentBuildConfiguration;
QmakeProjectManager::Qt4BuildConfiguration *m_currentBuildConfiguration;
};
} // namespace Internal

View File

@@ -94,6 +94,8 @@ bool AndroidPackageInstallationStep::init()
appendOutputParser(parser);
outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory());
m_androidDirToClean = m_androidDirectory == BuildDirectory ? dirPath : QString();
return AbstractProcessStep::init();
}
@@ -105,6 +107,22 @@ bool AndroidPackageInstallationStep::fromMap(const QVariantMap &map)
return true;
}
void AndroidPackageInstallationStep::run(QFutureInterface<bool> &fi)
{
QString error;
Utils::FileName androidDir = Utils::FileName::fromString(m_androidDirToClean);
if (!m_androidDirToClean.isEmpty()&& androidDir.toFileInfo().exists()) {
emit addOutput(tr("Removing directory %1").arg(m_androidDirToClean), MessageOutput);
if (!Utils::FileUtils::removeRecursively(androidDir, &error)) {
emit addOutput(error, ErrorOutput);
fi.reportResult(false);
emit finished();
return;
}
}
AbstractProcessStep::run(fi);
}
QVariantMap AndroidPackageInstallationStep::toMap() const
{
QVariantMap map = AbstractProcessStep::toMap();

View File

@@ -52,10 +52,12 @@ public:
ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
bool immutable() const;
void run(QFutureInterface<bool> &fi);
private:
AndroidPackageInstallationStep(ProjectExplorer::BuildStepList *bc,
AndroidPackageInstallationStep *other);
AndroidDirectory m_androidDirectory;
QString m_androidDirToClean;
static const Core::Id Id;
};

View File

@@ -35,8 +35,8 @@
#include <utils/environment.h>
#include <utils/hostosinfo.h>
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakeprojectmanagerconstants.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
@@ -50,7 +50,7 @@
using namespace Android::Internal;
using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
using namespace QmakeProjectManager;
AndroidQtVersion::AndroidQtVersion()
: QtSupport::BaseQtVersion()
@@ -109,7 +109,7 @@ void AndroidQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::En
env.set(QLatin1String("ANDROID_NDK_HOST"), AndroidConfigurations::instance().config().toolchainHost);
env.set(QLatin1String("ANDROID_NDK_ROOT"), AndroidConfigurations::instance().config().ndkLocation.toUserOutput());
Qt4Project *qt4pro = qobject_cast<Qt4ProjectManager::Qt4Project *>(ProjectExplorerPlugin::instance()->currentProject());
Qt4Project *qt4pro = qobject_cast<QmakeProjectManager::Qt4Project *>(ProjectExplorerPlugin::instance()->currentProject());
if (!qt4pro || !qt4pro->activeTarget()
|| QtSupport::QtKitInformation::qtVersion(k)->type() != QLatin1String(Constants::ANDROIDQT))
return;
@@ -122,8 +122,7 @@ void AndroidQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::En
return;
env.set(QLatin1String("ANDROID_NDK_PLATFORM"),
AndroidConfigurations::instance().bestMatch(AndroidManager::buildTargetSDK(target)));
AndroidConfigurations::instance().bestNdkPlatformMatch(AndroidManager::buildTargetSDK(target)));
}
QString AndroidQtVersion::description() const

View File

@@ -37,8 +37,8 @@
#include <projectexplorer/target.h>
#include <qtsupport/qtoutputformatter.h>
#include <qtsupport/qtkitinformation.h>
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4nodes.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <utils/qtcassert.h>
@@ -47,7 +47,7 @@ const char PRO_FILE_KEY[] = "Qt4ProjectManager.Qt4RunConfiguration.ProFile";
}
using namespace ProjectExplorer;
using Qt4ProjectManager::Qt4Project;
using QmakeProjectManager::Qt4Project;
namespace Android {
namespace Internal {
@@ -74,8 +74,8 @@ AndroidRunConfiguration::AndroidRunConfiguration(Target *parent, AndroidRunConfi
void AndroidRunConfiguration::init()
{
setDefaultDisplayName(defaultDisplayName());
connect(target()->project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)),
this, SLOT(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)));
connect(target()->project(), SIGNAL(proFileUpdated(QmakeProjectManager::Qt4ProFileNode*,bool,bool)),
this, SLOT(proFileUpdated(QmakeProjectManager::Qt4ProFileNode*,bool,bool)));
}
bool AndroidRunConfiguration::fromMap(const QVariantMap &map)
@@ -112,7 +112,7 @@ QString AndroidRunConfiguration::disabledReason() const
return QString();
}
void AndroidRunConfiguration::proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress)
void AndroidRunConfiguration::proFileUpdated(QmakeProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress)
{
if (m_proFilePath != pro->path())
return;

View File

@@ -35,7 +35,7 @@
#include <projectexplorer/runconfiguration.h>
namespace Qt4ProjectManager { class Qt4ProFileNode; }
namespace QmakeProjectManager { class Qt4ProFileNode; }
namespace Android {
namespace Internal {
@@ -70,7 +70,7 @@ protected:
bool fromMap(const QVariantMap &map);
QVariantMap toMap() const;
private slots:
void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress);
void proFileUpdated(QmakeProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress);
private:
void init();

View File

@@ -111,4 +111,4 @@ QIcon AndroidRunControl::icon() const
}
} // namespace Internal
} // namespace Qt4ProjectManager
} // namespace Android

View File

@@ -40,15 +40,15 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <debugger/debuggerconstants.h>
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4nodes.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qtsupport/customexecutablerunconfiguration.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
using namespace QmakeProjectManager;
namespace Android {
namespace Internal {
@@ -180,4 +180,4 @@ RunControl *AndroidRunControlFactory::create(RunConfiguration *runConfig,
}
} // namespace Internal
} // namespace Qt4ProjectManager
} // namespace Android

View File

@@ -43,7 +43,7 @@ class Node;
namespace Android {
namespace Internal {
class AndroidRunConfigurationFactory : public Qt4ProjectManager::QmakeRunConfigurationFactory
class AndroidRunConfigurationFactory : public QmakeProjectManager::QmakeRunConfigurationFactory
{
Q_OBJECT

View File

@@ -403,4 +403,4 @@ QString AndroidRunner::displayName() const
}
} // namespace Internal
} // namespace Qt4ProjectManager
} // namespace Android

View File

@@ -30,8 +30,8 @@
#include "createandroidmanifestwizard.h"
#include <projectexplorer/target.h>
#include <qt4projectmanager/qt4project.h>
#include <qt4projectmanager/qt4nodes.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <proparser/prowriter.h>
#include <QComboBox>
#include <QFormLayout>
@@ -43,8 +43,8 @@
using namespace Android;
using namespace Android::Internal;
using Qt4ProjectManager::Qt4Project;
using Qt4ProjectManager::Qt4ProFileNode;
using QmakeProjectManager::Qt4Project;
using QmakeProjectManager::Qt4ProFileNode;
//
// NoApplicationProFilePage
@@ -96,7 +96,7 @@ void ChooseProFilePage::nodeSelected(int index)
ChooseDirectoryPage::ChooseDirectoryPage(CreateAndroidManifestWizard *wizard)
: m_wizard(wizard), m_androidPackageSourceDir(0)
{
QString androidPackageDir = m_wizard->node()->singleVariableValue(Qt4ProjectManager::AndroidPackageSourceDir);
QString androidPackageDir = m_wizard->node()->singleVariableValue(QmakeProjectManager::AndroidPackageSourceDir);
QFormLayout *fl = new QFormLayout(this);
QLabel *label = new QLabel(this);
@@ -147,12 +147,12 @@ CreateAndroidManifestWizard::CreateAndroidManifestWizard(ProjectExplorer::Target
}
}
Qt4ProjectManager::Qt4ProFileNode *CreateAndroidManifestWizard::node() const
QmakeProjectManager::Qt4ProFileNode *CreateAndroidManifestWizard::node() const
{
return m_node;
}
void CreateAndroidManifestWizard::setNode(Qt4ProjectManager::Qt4ProFileNode *node)
void CreateAndroidManifestWizard::setNode(QmakeProjectManager::Qt4ProFileNode *node)
{
m_node = node;
}
@@ -205,7 +205,7 @@ void CreateAndroidManifestWizard::createAndroidManifestFile()
return;
}
if (m_node->singleVariableValue(Qt4ProjectManager::AndroidPackageSourceDir).isEmpty()) {
if (m_node->singleVariableValue(QmakeProjectManager::AndroidPackageSourceDir).isEmpty()) {
// and now time for some magic
QString dir = QFileInfo(fileName).absolutePath();
QString value = QLatin1String("$$PWD/")

View File

@@ -37,7 +37,7 @@ class QComboBox;
QT_END_NAMESPACE
namespace ProjectExplorer { class Target; }
namespace Qt4ProjectManager { class Qt4ProFileNode; }
namespace QmakeProjectManager { class Qt4ProFileNode; }
namespace Android {
namespace Internal {
@@ -57,7 +57,7 @@ class ChooseProFilePage : public QWizardPage
{
Q_OBJECT
public:
ChooseProFilePage(CreateAndroidManifestWizard *wizard, const QList<Qt4ProjectManager::Qt4ProFileNode *> &nodes);
ChooseProFilePage(CreateAndroidManifestWizard *wizard, const QList<QmakeProjectManager::Qt4ProFileNode *> &nodes);
private slots:
void nodeSelected(int index);
private:
@@ -81,8 +81,8 @@ class CreateAndroidManifestWizard : public Utils::Wizard
public:
CreateAndroidManifestWizard(ProjectExplorer::Target *target);
Qt4ProjectManager::Qt4ProFileNode *node() const;
void setNode(Qt4ProjectManager::Qt4ProFileNode *node);
QmakeProjectManager::Qt4ProFileNode *node() const;
void setNode(QmakeProjectManager::Qt4ProFileNode *node);
QString sourceFileName() const;
@@ -93,7 +93,7 @@ public slots:
private:
void createAndroidManifestFile();
ProjectExplorer::Target *m_target;
Qt4ProjectManager::Qt4ProFileNode *m_node;
QmakeProjectManager::Qt4ProFileNode *m_node;
QString m_directory;
};
}