Commit f0a54abf authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Maemo: Introduce dedicated Fremantle and Harmattan targets.

Task-number: QTCREATORBUG-2770
parent 45e69d2e
......@@ -227,7 +227,8 @@ static DebuggerEngineType engineForToolChain(ToolChainType toolChainType)
case ToolChain_RVCT2_ARMV6:
case ToolChain_RVCT_ARMV5_GNUPOC:
case ToolChain_GCCE_GNUPOC:
case ToolChain_GCC_MAEMO:
case ToolChain_GCC_MAEMO5:
case ToolChain_GCC_HARMATTAN:
#ifdef WITH_LLDB
// lldb override
if (Core::ICore::instance()->settings()->value("LLDB/enabled").toBool())
......
......@@ -80,7 +80,8 @@ static QList<int> allGdbToolChains()
<< ProjectExplorer::ToolChain_RVCT2_ARMV5
<< ProjectExplorer::ToolChain_RVCT2_ARMV6
#endif
<< ProjectExplorer::ToolChain_GCC_MAEMO
<< ProjectExplorer::ToolChain_GCC_MAEMO5
<< ProjectExplorer::ToolChain_GCC_HARMATTAN
#ifdef Q_OS_UNIX
<< ProjectExplorer::ToolChain_GCCE_GNUPOC
<< ProjectExplorer::ToolChain_RVCT_ARMV5_GNUPOC
......@@ -461,7 +462,8 @@ ToolChainSelectorWidget::ToolChainSelectorWidget(QWidget *parent) :
case ProjectExplorer::ToolChain_RVCT_ARMV5_GNUPOC:
symbianLayout->addWidget(createToolChainCheckBox(tc));
break;
case ProjectExplorer::ToolChain_GCC_MAEMO:
case ProjectExplorer::ToolChain_GCC_MAEMO5:
case ProjectExplorer::ToolChain_GCC_HARMATTAN:
maemoLayout->addWidget(createToolChainCheckBox(tc));
break;
case ProjectExplorer::ToolChain_INVALID:
......
......@@ -83,7 +83,8 @@ AbstractGdbAdapter::DumperHandling RemoteGdbServerAdapter::dumperHandling() cons
case ProjectExplorer::ToolChain_GCCE:
case ProjectExplorer::ToolChain_RVCT2_ARMV5:
case ProjectExplorer::ToolChain_RVCT2_ARMV6:
case ProjectExplorer::ToolChain_GCC_MAEMO:
case ProjectExplorer::ToolChain_GCC_MAEMO5:
case ProjectExplorer::ToolChain_GCC_HARMATTAN:
return DumperLoadedByGdb;
default:
break;
......
......@@ -161,8 +161,10 @@ QString ToolChain::toolChainName(ToolChainType tc)
return QCoreApplication::translate("ToolChain", "RVCT 4 (ARMV5)");
case ToolChain_RVCT4_ARMV6:
return QCoreApplication::translate("ToolChain", "RVCT 4 (ARMV6)");
case ToolChain_GCC_MAEMO:
return QCoreApplication::translate("ToolChain", "GCC for Maemo");
case ToolChain_GCC_MAEMO5:
return QCoreApplication::translate("ToolChain", "GCC for Maemo5");
case ToolChain_GCC_HARMATTAN:
return QCoreApplication::translate("ToolChain", "GCC for Harmattan");
case ToolChain_OTHER:
return QCoreApplication::translate("ToolChain", "Other");
case ToolChain_INVALID:
......
......@@ -47,12 +47,13 @@ enum ToolChainType
ToolChain_GCCE = 6,
ToolChain_RVCT2_ARMV5 = 7,
ToolChain_RVCT2_ARMV6 = 8,
ToolChain_GCC_MAEMO = 9,
ToolChain_GCC_MAEMO5 = 9,
ToolChain_GCCE_GNUPOC = 10,
ToolChain_RVCT_ARMV5_GNUPOC = 11,
ToolChain_RVCT4_ARMV5 = 12,
ToolChain_RVCT4_ARMV6 = 13,
ToolChain_LAST_VALID = 13,
ToolChain_GCC_HARMATTAN = 14,
ToolChain_LAST_VALID = 14,
ToolChain_OTHER = 200,
ToolChain_UNKNOWN = 201,
ToolChain_INVALID = 202
......
......@@ -80,8 +80,11 @@ DebuggingHelperBuildTask::DebuggingHelperBuildTask(QtVersion *version, Debugging
tc->addToEnvironment(m_environment);
m_target = (tc->type() == ProjectExplorer::ToolChain_GCC_MAEMO ? QLatin1String("-unix")
: QLatin1String(""));
if (tc->type() == ProjectExplorer::ToolChain_GCC_MAEMO5
|| tc->type() == ProjectExplorer::ToolChain_GCC_HARMATTAN) {
m_target = QLatin1String("-unix");
}
m_qmakeCommand = version->qmakeCommand();
m_makeCommand = tc->makeCommand();
m_mkspec = version->mkspec();
......
......@@ -45,8 +45,8 @@
#include <debugger/debuggerstartparameters.h>
#include <debugger/debuggerrunner.h>
#include <debugger/debuggerengine.h>
#include <projectexplorer/toolchaintype.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
......@@ -74,7 +74,8 @@ RunControl *MaemoDebugSupport::createDebugRunControl(MaemoRunConfiguration *runC
if (debuggingType != MaemoRunConfiguration::DebugQmlOnly) {
params.processArgs = runConfig->arguments();
params.sysRoot = runConfig->sysRoot();
params.toolChainType = ProjectExplorer::ToolChain_GCC_MAEMO;
params.toolChainType
= runConfig->activeQt4BuildConfiguration()->toolChainType();
params.dumperLibrary = runConfig->dumperLib();
params.remoteDumperLib = uploadDir(devConf).toUtf8() + '/'
+ QFileInfo(runConfig->dumperLib()).fileName().toUtf8();
......
......@@ -341,8 +341,8 @@ const QtVersion *MaemoDeployableListModel::qtVersion() const
const ProjectExplorer::Project *const activeProject
= ProjectExplorer::ProjectExplorerPlugin::instance()->session()->startupProject();
QTC_ASSERT(activeProject, return 0);
const Qt4MaemoTarget *const activeTarget
= qobject_cast<Qt4MaemoTarget *>(activeProject->activeTarget());
const AbstractQt4MaemoTarget *const activeTarget
= qobject_cast<AbstractQt4MaemoTarget *>(activeProject->activeTarget());
QTC_ASSERT(activeTarget, return 0);
const Qt4BuildConfiguration *const bc
= activeTarget->activeBuildConfiguration();
......
......@@ -55,7 +55,7 @@
namespace Qt4ProjectManager {
namespace Internal {
MaemoDeployables::MaemoDeployables(const Qt4MaemoTarget *target)
MaemoDeployables::MaemoDeployables(const AbstractQt4MaemoTarget *target)
: m_target(target), m_updateTimer(new QTimer(this))
{
QTimer::singleShot(0, this, SLOT(init()));
......
......@@ -56,13 +56,13 @@ class Qt4BuildConfiguration;
namespace Internal {
class Qt4ProFileNode;
class Qt4MaemoTarget;
class AbstractQt4MaemoTarget;
class MaemoDeployables : public QAbstractListModel
{
Q_OBJECT
public:
MaemoDeployables(const Qt4MaemoTarget *target);
MaemoDeployables(const AbstractQt4MaemoTarget *target);
~MaemoDeployables();
void setUnmodified();
bool isModified() const;
......@@ -84,7 +84,7 @@ private:
QList<MaemoDeployableListModel *> m_listModels;
UpdateSettingsMap m_updateSettings;
const Qt4MaemoTarget * const m_target;
const AbstractQt4MaemoTarget * const m_target;
QTimer *const m_updateTimer;
};
......
......@@ -52,6 +52,7 @@
#include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qt4projectmanager/qt4target.h>
#include <QtCore/QCoreApplication>
......@@ -89,7 +90,10 @@ MaemoDeployStep::~MaemoDeployStep() { }
void MaemoDeployStep::ctor()
{
//: MaemoDeployStep default display name
setDefaultDisplayName(tr("Deploy to Maemo device"));
if (target()->id() == QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID))
setDefaultDisplayName(tr("Deploy to Maemo5 device"));
else if (target()->id() == QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID))
setDefaultDisplayName(tr("Deploy to Harmattan device"));
// A MaemoDeployables object is only dependent on the active build
// configuration and therefore can (and should) be shared among all
......@@ -97,7 +101,7 @@ void MaemoDeployStep::ctor()
const QList<DeployConfiguration *> &deployConfigs
= target()->deployConfigurations();
if (deployConfigs.isEmpty()) {
const Qt4MaemoTarget * const qt4Target = qobject_cast<Qt4MaemoTarget *>(target());
const AbstractQt4MaemoTarget * const qt4Target = qobject_cast<AbstractQt4MaemoTarget *>(target());
Q_ASSERT(qt4Target);
m_deployables = QSharedPointer<MaemoDeployables>(new MaemoDeployables(qt4Target));
} else {
......@@ -816,11 +820,11 @@ QString MaemoDeployStep::deployMountPoint() const
+ QLatin1String("/deployMountPoint_") + packagingStep()->projectName();
}
const MaemoToolChain *MaemoDeployStep::toolChain() const
const AbstractMaemoToolChain *MaemoDeployStep::toolChain() const
{
const Qt4BuildConfiguration * const bc
= static_cast<Qt4BuildConfiguration *>(buildConfiguration());
return static_cast<MaemoToolChain *>(bc->toolChain());
return static_cast<AbstractMaemoToolChain *>(bc->toolChain());
}
void MaemoDeployStep::handleSysrootInstallerOutput()
......
......@@ -65,7 +65,7 @@ namespace Internal {
class MaemoRemoteMounter;
class MaemoDeviceConfig;
class MaemoPackageCreationStep;
class MaemoToolChain;
class AbstractMaemoToolChain;
class MaemoUsedPortsGatherer;
class MaemoDeployStep : public ProjectExplorer::BuildStep
......@@ -142,7 +142,7 @@ private:
void getDeployTimesFromMap(const QVariantMap &map);
const MaemoPackageCreationStep *packagingStep() const;
QString deployMountPoint() const;
const MaemoToolChain *toolChain() const;
const AbstractMaemoToolChain *toolChain() const;
void copyNextFileToDevice();
void installToSysroot();
QString uploadDir() const;
......
#include "maemodeploystepfactory.h"
#include "maemodeploystep.h"
#include "maemomanager.h"
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/buildsteplist.h>
......@@ -23,7 +24,7 @@ MaemoDeployStepFactory::MaemoDeployStepFactory(QObject *parent)
QStringList MaemoDeployStepFactory::availableCreationIds(BuildStepList *parent) const
{
if (parent->id() == QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
&& parent->target()->id() == QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID)
&& MaemoManager::instance().isMaemoTargetId(parent->target()->id())
&& !parent->contains(MaemoDeployStep::Id))
return QStringList() << MaemoDeployStep::Id;
return QStringList();
......@@ -41,7 +42,7 @@ bool MaemoDeployStepFactory::canCreate(BuildStepList *parent, const QString &id)
{
return parent->id() == QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
&& id == QLatin1String(MaemoDeployStep::Id)
&& parent->target()->id() == QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID)
&& MaemoManager::instance().isMaemoTargetId(parent->target()->id())
&& !parent->contains(MaemoDeployStep::Id);
}
......
......@@ -148,7 +148,6 @@ MaemoGlobal::MaemoVersion MaemoGlobal::version(const QtVersion *qtVersion)
return Maemo5;
if (name.startsWith(QLatin1String("harmattan")))
return Maemo6;
qWarning("Unknown Maemo version!");
return static_cast<MaemoVersion>(-1);
}
......
......@@ -36,7 +36,6 @@
#include "maemoconstants.h"
#include "maemodeploystepfactory.h"
#include "maemodeviceconfigurations.h"
#include "maemoglobal.h"
#include "maemopackagecreationfactory.h"
#include "maemopublishingwizardfactories.h"
#include "maemoqemumanager.h"
......@@ -46,6 +45,7 @@
#include "qt4maemotargetfactory.h"
#include <extensionsystem/pluginmanager.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <qt4projectmanager/qtversionmanager.h>
#include <QtCore/QDir>
......@@ -110,17 +110,36 @@ MaemoManager &MaemoManager::instance()
return *m_instance;
}
bool MaemoManager::isValidMaemoQtVersion(const QtVersion *version) const
bool MaemoManager::isMaemoTargetId(const QString &id) const
{
return id == QLatin1String(Constants::MAEMO5_DEVICE_TARGET_ID)
|| id == QLatin1String(Constants::HARMATTAN_DEVICE_TARGET_ID);
}
bool MaemoManager::isValidMaemo5QtVersion(const QtVersion *version) const
{
return isValidMaemoQtVersion(version, MaemoGlobal::Maemo5);
}
bool MaemoManager::isValidHarmattanQtVersion(const QtVersion *version) const
{
return isValidMaemoQtVersion(version, MaemoGlobal::Maemo6);
}
bool MaemoManager::isValidMaemoQtVersion(const QtVersion *qtVersion,
MaemoGlobal::MaemoVersion maemoVersion) const
{
if (MaemoGlobal::version(qtVersion) != maemoVersion)
return false;
QProcess madAdminProc;
const QStringList arguments(QLatin1String("list"));
if (!MaemoGlobal::callMadAdmin(madAdminProc, arguments, version))
if (!MaemoGlobal::callMadAdmin(madAdminProc, arguments, qtVersion))
return false;
if (!madAdminProc.waitForStarted() || !madAdminProc.waitForFinished())
return false;
madAdminProc.setReadChannel(QProcess::StandardOutput);
const QByteArray targetName = MaemoGlobal::targetName(version).toAscii();
const QByteArray targetName = MaemoGlobal::targetName(qtVersion).toAscii();
while (madAdminProc.canReadLine()) {
const QByteArray &line = madAdminProc.readLine();
if (line.contains(targetName)
......@@ -130,10 +149,15 @@ bool MaemoManager::isValidMaemoQtVersion(const QtVersion *version) const
return false;
}
ToolChain* MaemoManager::maemoToolChain(const QtVersion *version) const
ToolChain* MaemoManager::maemo5ToolChain(const QtVersion *version) const
{
return new Maemo5ToolChain(version);
}
ToolChain* MaemoManager::harmattanToolChain(const QtVersion *version) const
{
return new MaemoToolChain(version);
return new HarmattanToolChain(version);
}
} // namespace Internal
} // namespace Internal
} // namespace Qt4ProjectManager
......@@ -34,6 +34,8 @@
#ifndef MAEMOMANAGER_H
#define MAEMOMANAGER_H
#include "maemoglobal.h"
#include <QtCore/QObject>
namespace ProjectExplorer {
......@@ -64,13 +66,19 @@ public:
~MaemoManager();
static MaemoManager &instance();
bool isValidMaemoQtVersion(const Qt4ProjectManager::QtVersion *version) const;
ToolChain *maemoToolChain(const Qt4ProjectManager::QtVersion *version) const;
bool isMaemoTargetId(const QString &id) const;
bool isValidMaemo5QtVersion(const Qt4ProjectManager::QtVersion *version) const;
bool isValidHarmattanQtVersion(const Qt4ProjectManager::QtVersion *version) const;
ToolChain *maemo5ToolChain(const Qt4ProjectManager::QtVersion *version) const;
ToolChain *harmattanToolChain(const Qt4ProjectManager::QtVersion *version) const;
MaemoDeviceConfigurationsSettingsPage *deviceConfigurationsSettingsPage() const { return m_deviceConfigurationsSettingsPage; }
MaemoQemuSettingsPage *qemuSettingsPage() const { return m_qemuSettingsPage; }
private:
bool isValidMaemoQtVersion(const Qt4ProjectManager::QtVersion *qtVersion,
MaemoGlobal::MaemoVersion maemoVersion) const;
static MaemoManager *m_instance;
MaemoRunControlFactory *m_runControlFactory;
......
......@@ -41,6 +41,7 @@
#include "maemopackagecreationfactory.h"
#include "maemomanager.h"
#include "maemopackagecreationstep.h"
#include <projectexplorer/buildconfiguration.h>
......@@ -66,7 +67,7 @@ MaemoPackageCreationFactory::MaemoPackageCreationFactory(QObject *parent)
QStringList MaemoPackageCreationFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
{
if (parent->id() == QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
&& parent->target()->id() == QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID)
&& MaemoManager::instance().isMaemoTargetId(parent->target()->id())
&& !parent->contains(MaemoPackageCreationStep::CreatePackageId))
return QStringList() << MaemoPackageCreationStep::CreatePackageId;
return QStringList();
......@@ -84,7 +85,7 @@ bool MaemoPackageCreationFactory::canCreate(ProjectExplorer::BuildStepList *pare
{
return parent->id() == QLatin1String(ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
&& id == QLatin1String(MaemoPackageCreationStep::CreatePackageId)
&& parent->target()->id() == QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID)
&& MaemoManager::instance().isMaemoTargetId(parent->target()->id())
&& !parent->contains(MaemoPackageCreationStep::CreatePackageId);
}
......
......@@ -203,7 +203,7 @@ bool MaemoPackageCreationStep::createPackage(QProcess *buildProc)
// Workaround for non-working dh_builddeb --destdir=.
if (!QDir(buildDirectory()).isRoot()) {
const Qt4MaemoTarget * const target = maemoTarget();
const AbstractQt4MaemoTarget * const target = maemoTarget();
const ProjectExplorer::Project * const project = target->project();
QString error;
const QString pkgFileName = packageFileName(project,
......@@ -329,9 +329,9 @@ const Qt4BuildConfiguration *MaemoPackageCreationStep::qt4BuildConfiguration() c
return static_cast<Qt4BuildConfiguration *>(buildConfiguration());
}
Qt4MaemoTarget *MaemoPackageCreationStep::maemoTarget() const
AbstractQt4MaemoTarget *MaemoPackageCreationStep::maemoTarget() const
{
return qobject_cast<Qt4MaemoTarget *>(buildConfiguration()->target());
return qobject_cast<AbstractQt4MaemoTarget *>(buildConfiguration()->target());
}
QString MaemoPackageCreationStep::buildDirectory() const
......
......@@ -56,7 +56,7 @@ class Qt4BuildConfiguration;
namespace Internal {
class MaemoDeployStep;
class MaemoDeployableListModel;
class Qt4MaemoTarget;
class AbstractQt4MaemoTarget;
class MaemoPackageCreationStep : public ProjectExplorer::BuildStep
{
......@@ -85,7 +85,7 @@ public:
QString projectName() const;
const Qt4BuildConfiguration *qt4BuildConfiguration() const;
Qt4MaemoTarget *maemoTarget() const;
AbstractQt4MaemoTarget *maemoTarget() const;
static const QLatin1String DefaultVersionNumber;
......
......@@ -84,14 +84,18 @@ void MaemoPackageCreationWidget::init()
void MaemoPackageCreationWidget::initGui()
{
const Qt4BuildConfiguration * const bc = m_step->qt4BuildConfiguration();
if (bc) {
m_ui->skipCheckBox->setVisible(MaemoGlobal::allowsPackagingDisabling(
bc->qtVersion()));
m_ui->skipCheckBox->setChecked(!m_step->isPackagingEnabled());
}
updateDebianFileList();
updateVersionInfo();
handleControlFileUpdate();
connect(m_step, SIGNAL(packageFilePathChanged()), this,
SIGNAL(updateSummary()));
connect(m_step, SIGNAL(qtVersionChanged()), this,
SLOT(handleToolchainChanged()));
handleToolchainChanged();
versionInfoChanged();
connect(m_step->maemoTarget(), SIGNAL(debianDirContentsChanged()),
SLOT(updateDebianFileList()));
......@@ -193,18 +197,6 @@ void MaemoPackageCreationWidget::setShortDescription()
}
}
// TODO: Can go when a target has only one possible type of toolchain
void MaemoPackageCreationWidget::handleToolchainChanged()
{
const Qt4BuildConfiguration * const bc = m_step->qt4BuildConfiguration();
if (!bc)
return;
m_ui->skipCheckBox->setVisible(MaemoGlobal::allowsPackagingDisabling(
bc->qtVersion()));
m_ui->skipCheckBox->setChecked(!m_step->isPackagingEnabled());
emit updateSummary();
}
QString MaemoPackageCreationWidget::summaryText() const
{
const QString constantString = tr("<b>Create Package:</b> ");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment