Commit 8d96ce55 authored by Fawzi Mohamed's avatar Fawzi Mohamed Committed by Eike Ziller

ios: preliminary support for ios

first work in progress support for ios
* separate iosTool using xml communication used for device info and run
* iossim tool to handle the simulator
* debug prepared but not working
* separate gcc toolchain detection fix for simulator

1) add a QT built for ios
2) open a project, for example qtbase/examples/widgets/animation/animatedtiles/animatedtiles.pro
3) build/run...

Change-Id: I7e01604e416338cbe4692dfb34f5d3f31312702d
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 3a7d91ca
<plugin name=\"Ios\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_VERSION\" experimental=\"true\">
<vendor>Digia Plc</vendor>
<copyright>(C) 2013 Digia Plc</copyright>
<license>
Commercial Usage
Licensees holding valid Qt Commercial licenses may use this plugin in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Digia.
GNU Lesser General Public License Usage
Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. 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.
</license>
<description>Support for deployment to and execution on iOS Devices</description>
<category>Device Support</category>
<url>http://www.qt-project.org</url>
$$dependencyList
</plugin>
TEMPLATE = lib
TARGET = Ios
include(../../qtcreatorplugin.pri)
QT += xml network
HEADERS += \
iosconstants.h \
iosconfigurations.h \
iosmanager.h \
iosrunconfiguration.h \
iosruncontrol.h \
iosrunfactories.h \
iossettingspage.h \
iossettingswidget.h \
iosrunner.h \
iosdebugsupport.h \
iosqtversionfactory.h \
iosqtversion.h \
iosplugin.h \
iosdevicefactory.h \
iosdevice.h \
iossimulator.h \
iossimulatorfactory.h \
iosprobe.h \
iosbuildstep.h \
iostoolhandler.h \
iosdeployconfiguration.h \
iosdeploystep.h \
iosdeploystepfactory.h \
iosdeploystepwidget.h
SOURCES += \
iosconfigurations.cpp \
iosmanager.cpp \
iosrunconfiguration.cpp \
iosruncontrol.cpp \
iosrunfactories.cpp \
iossettingspage.cpp \
iossettingswidget.cpp \
iosrunner.cpp \
iosdebugsupport.cpp \
iosqtversionfactory.cpp \
iosqtversion.cpp \
iosplugin.cpp \
iosdevicefactory.cpp \
iosdevice.cpp \
iossimulator.cpp \
iossimulatorfactory.cpp \
iosprobe.cpp \
iosbuildstep.cpp \
iostoolhandler.cpp \
iosdeployconfiguration.cpp \
iosdeploystep.cpp \
iosdeploystepfactory.cpp \
iosdeploystepwidget.cpp
FORMS += \
iossettingswidget.ui \
iosbuildstep.ui \
iosrunconfiguration.ui \
iosdeploystepwidget.ui
DEFINES += IOS_LIBRARY
RESOURCES += ios.qrc
import qbs.base 1.0
import "../QtcPlugin.qbs" as QtcPlugin
QtcPlugin {
name: "Ios"
condition: qbs.targetOS.contains("osx")
Depends { name: "Core" }
Depends { name: "ProjectExplorer" }
Depends { name: "Qt4ProjectManager" }
Depends { name: "Debugger" }
Depends { name: "QtSupport" }
Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] }
cpp.includePaths: base.concat("../../shared")
cpp.frameworks: base.concat(["CoreFoundation", "IOKit"])
files: [
"ios.qrc",
"iosbuildstep.cpp",
"iosbuildstep.h",
"iosbuildstep.ui",
"iosconfigurations.cpp",
"iosconfigurations.h",
"iosconstants.h",
"iosdebugsupport.cpp",
"iosdebugsupport.h",
"iosdeployconfiguration.cpp",
"iosdeployconfiguration.h",
"iosdeploystep.cpp",
"iosdeploystep.h",
"iosdeploystepfactory.cpp",
"iosdeploystepfactory.h",
"iosdeploystepwidget.cpp",
"iosdeploystepwidget.h",
"iosdeploystepwidget.ui",
"iosdevice.cpp",
"iosdevice.h",
"iosdevicefactory.cpp",
"iosdevicefactory.h",
"iosmanager.cpp",
"iosmanager.h",
"iosplugin.cpp",
"iosplugin.h",
"iosprobe.cpp",
"iosprobe.h",
"iosqtversion.cpp",
"iosqtversion.h",
"iosqtversionfactory.cpp",
"iosqtversionfactory.h",
"iosrunconfiguration.cpp",
"iosrunconfiguration.h",
"iosrunconfiguration.ui",
"iosruncontrol.cpp",
"iosruncontrol.h",
"iosrunfactories.cpp",
"iosrunfactories.h",
"iosrunner.cpp",
"iosrunner.h",
"iossettingspage.cpp",
"iossettingspage.h",
"iossettingswidget.cpp",
"iossettingswidget.h",
"iossettingswidget.ui",
"iossimulator.cpp",
"iossimulator.h",
"iossimulatorfactory.cpp",
"iossimulatorfactory.h",
"iostoolhandler.cpp",
"iostoolhandler.h"
]
}
<RCC>
<qresource prefix="/ios">
<file>images/QtIos.png</file>
</qresource>
</RCC>
QTC_PLUGIN_NAME = Ios
QTC_LIB_DEPENDS += \
utils
QTC_PLUGIN_DEPENDS += \
coreplugin \
debugger \
projectexplorer \
qt4projectmanager
This diff is collapsed.
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** 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 IOSBUILDSTEP_H
#define IOSBUILDSTEP_H
#include <projectexplorer/abstractprocessstep.h>
QT_BEGIN_NAMESPACE
class QListWidgetItem;
QT_END_NAMESPACE
namespace Ios {
namespace Internal {
class IosBuildStepConfigWidget;
class IosBuildStepFactory;
namespace Ui { class IosBuildStep; }
class IosBuildStep : public ProjectExplorer::AbstractProcessStep
{
Q_OBJECT
friend class IosBuildStepConfigWidget;
friend class IosBuildStepFactory;
public:
IosBuildStep(ProjectExplorer::BuildStepList *parent);
~IosBuildStep();
bool init();
void run(QFutureInterface<bool> &fi);
ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
bool immutable() const;
void setBaseArguments(const QStringList &args);
void setExtraArguments(const QStringList &extraArgs);
QStringList baseArguments() const;
QStringList allArguments() const;
QStringList defaultArguments() const;
QString buildCommand() const;
void setClean(bool clean);
bool isClean() const;
QVariantMap toMap() const;
protected:
IosBuildStep(ProjectExplorer::BuildStepList *parent, IosBuildStep *bs);
IosBuildStep(ProjectExplorer::BuildStepList *parent, const Core::Id id);
bool fromMap(const QVariantMap &map);
private:
void ctor();
QStringList m_baseBuildArguments;
QStringList m_extraArguments;
QString m_buildCommand;
bool m_useDefaultArguments;
bool m_clean;
QList<ProjectExplorer::Task> m_tasks;
};
class IosBuildStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
{
Q_OBJECT
public:
IosBuildStepConfigWidget(IosBuildStep *buildStep);
~IosBuildStepConfigWidget();
QString displayName() const;
QString summaryText() const;
private slots:
void buildArgumentsChanged();
void resetDefaultArguments();
void extraArgumentsChanged();
void updateDetails();
private:
Ui::IosBuildStep *m_ui;
IosBuildStep *m_buildStep;
QString m_summaryText;
};
class IosBuildStepFactory : public ProjectExplorer::IBuildStepFactory
{
Q_OBJECT
public:
explicit IosBuildStepFactory(QObject *parent = 0);
bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id);
bool canClone(ProjectExplorer::BuildStepList *parent,
ProjectExplorer::BuildStep *source) const;
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
ProjectExplorer::BuildStep *source);
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const;
ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent,
const QVariantMap &map);
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const;
QString displayNameForId(const Core::Id id) const;
};
} // namespace Internal
} // namespace Ios
#endif // IOSBUILDSTEP_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Ios::Internal::IosBuildStep</class>
<widget class="QWidget" name="Ios::Internal::IosBuildStep">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>756</width>
<height>183</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="buildArgumentsLabel">
<property name="text">
<string>Base arguments:</string>
</property>
</widget>
</item>
<item row="0" column="1" rowspan="2">
<widget class="QPlainTextEdit" name="buildArgumentsTextEdit"/>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="resetDefaultsButton">
<property name="layoutDirection">
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string>Reset defaults</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="extraArgumentsLabel">
<property name="text">
<string>Extra arguments:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="extraArgumentsLineEdit"/>
</item>
</layout>
<zorder>buildArgumentsTextEdit</zorder>
<zorder>resetDefaultsButton</zorder>
<zorder>extraArgumentsLabel</zorder>
<zorder>extraArgumentsLineEdit</zorder>
<zorder>buildArgumentsLabel</zorder>
</widget>
<resources/>
<connections/>
</ui>
This diff is collapsed.
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** 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 IOSCONFIGURATIONS_H
#define IOSCONFIGURATIONS_H
#include <projectexplorer/abi.h>
#include <utils/fileutils.h>
#include <QMap>
#include <QObject>
#include <QString>
#include <QStringList>
#include <QTimer>
QT_BEGIN_NAMESPACE
class QSettings;
QT_END_NAMESPACE
namespace Ios {
namespace Internal {
class IosConfig
{
public:
IosConfig();
IosConfig(const QSettings &settings);
void save(QSettings &settings) const;
Utils::FileName developerPath;
bool ignoreAllDevices;
};
class IosConfigurations : public QObject
{
Q_OBJECT
public:
static IosConfigurations &instance();
IosConfig config() const { return m_config; }
void setConfig(const IosConfig &config);
Utils::FileName iosToolPath() const;
QStringList sdkTargets();
void updateSimulators();
signals:
void updated();
public slots:
void updateAutomaticKitList();
private:
IosConfigurations(QObject *parent);
void load();
void save();
static IosConfigurations *m_instance;
IosConfig m_config;
QTimer m_updateAvailableDevices;
};
} // namespace Internal
} // namespace Ios
#endif // IOSCONFIGURATIONS_H
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** 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 IOSCONSTANTS_H
#define IOSCONSTANTS_H
#include <QtGlobal>
namespace Ios {
namespace Internal {
enum IosQemuStatus {
IosQemuStarting,
IosQemuFailedToStart,
IosQemuFinished,
IosQemuCrashed,
IosQemuUserReason
};
#ifdef Q_OS_WIN32
#define IOS_BAT_SUFFIX ".bat"
#else
#define IOS_BAT_SUFFIX ""
#endif
} // namespace Internal
namespace Constants {
const char IOS_SETTINGS_ID[] = "ZZ.Ios Configurations";
const char IOS_SETTINGS_CATEGORY[] = "XA.Ios";
const char IOS_SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("Ios", "iOS");
const char IOS_SETTINGS_CATEGORY_ICON[] = ":/ios/images/QtIos.png";
const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios";
const char IOS_DEVICE_TYPE[] = "Ios.Device.Type";
const char IOS_SIMULATOR_TYPE[] = "Ios.Simulator.Type";
const char IOS_DEVICE_ID[] = "iOS Device ";
const char IOS_SIMULATOR_DEVICE_ID[] = "iOS Simulator Device ";
} // namespace Constants;
} // namespace Ios
#endif // IOSCONSTANTS_H
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** 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 "iosdebugsupport.h"
#include "iosrunner.h"
#include "iosmanager.h"
#include <debugger/debuggerengine.h>
#include <debugger/debuggerplugin.h>
#include <debugger/debuggerkitinformation.h>
#include <debugger/debuggerrunner.h>
#include <debugger/debuggerstartparameters.h>
#include <projectexplorer/target.h>
#include <qt4projectmanager/qt4buildconfiguration.h>
#include <qt4projectmanager/qt4nodes.h>
#include <qt4projectmanager/qt4project.h>
#include <qtsupport/qtkitinformation.h>
#include <QDir>
using namespace Debugger;
using namespace ProjectExplorer;
using namespace Qt4ProjectManager;
namespace Ios {
namespace Internal {
static const char * const qMakeVariables[] = {
"QT_INSTALL_LIBS",
"QT_INSTALL_PLUGINS",
"QT_INSTALL_IMPORTS"
};
RunControl *IosDebugSupport::createDebugRunControl(IosRunConfiguration *runConfig,
QString *errorMessage)
{
//Target *target = runConfig->target();
//Qt4Project *project = static_cast<Qt4Project *>(target->project());
DebuggerStartParameters params;
params.startMode = AttachToRemoteServer;
//params.displayName = IosManager::packageName(target);
params.remoteSetupNeeded = true;
DebuggerRunControl * const debuggerRunControl
= DebuggerPlugin::createDebugger(params, runConfig, errorMessage);
new IosDebugSupport(runConfig, debuggerRunControl);
return debuggerRunControl;