forked from qt-creator/qt-creator
ios: adding dsymutil build step
The lldb debugger sometime returns misleading debug information unless a dsym has been created. This creates a build step to do it. Task-number: QTCREATORBUG-11580 Change-Id: I7acf2e539cf189d0237e1d502fab2837f17aa489 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
@@ -18,6 +18,7 @@ HEADERS += \
|
|||||||
iossettingswidget.h \
|
iossettingswidget.h \
|
||||||
iosrunner.h \
|
iosrunner.h \
|
||||||
iosdebugsupport.h \
|
iosdebugsupport.h \
|
||||||
|
iosdsymbuildstep.h \
|
||||||
iosqtversionfactory.h \
|
iosqtversionfactory.h \
|
||||||
iosqtversion.h \
|
iosqtversion.h \
|
||||||
iosplugin.h \
|
iosplugin.h \
|
||||||
@@ -44,6 +45,7 @@ SOURCES += \
|
|||||||
iossettingswidget.cpp \
|
iossettingswidget.cpp \
|
||||||
iosrunner.cpp \
|
iosrunner.cpp \
|
||||||
iosdebugsupport.cpp \
|
iosdebugsupport.cpp \
|
||||||
|
iosdsymbuildstep.cpp \
|
||||||
iosqtversionfactory.cpp \
|
iosqtversionfactory.cpp \
|
||||||
iosqtversion.cpp \
|
iosqtversion.cpp \
|
||||||
iosplugin.cpp \
|
iosplugin.cpp \
|
||||||
@@ -63,7 +65,8 @@ FORMS += \
|
|||||||
iossettingswidget.ui \
|
iossettingswidget.ui \
|
||||||
iosbuildstep.ui \
|
iosbuildstep.ui \
|
||||||
iosrunconfiguration.ui \
|
iosrunconfiguration.ui \
|
||||||
iosdeploystepwidget.ui
|
iosdeploystepwidget.ui \
|
||||||
|
iospresetbuildstep.ui
|
||||||
|
|
||||||
DEFINES += IOS_LIBRARY
|
DEFINES += IOS_LIBRARY
|
||||||
|
|
||||||
|
|||||||
@@ -39,10 +39,13 @@ QtcPlugin {
|
|||||||
"iosdevice.h",
|
"iosdevice.h",
|
||||||
"iosdevicefactory.cpp",
|
"iosdevicefactory.cpp",
|
||||||
"iosdevicefactory.h",
|
"iosdevicefactory.h",
|
||||||
|
"iosdsymbuildstep.cpp",
|
||||||
|
"iosdsymbuildstep.h",
|
||||||
"iosmanager.cpp",
|
"iosmanager.cpp",
|
||||||
"iosmanager.h",
|
"iosmanager.h",
|
||||||
"iosplugin.cpp",
|
"iosplugin.cpp",
|
||||||
"iosplugin.h",
|
"iosplugin.h",
|
||||||
|
"iosdpresetbuildstep.ui",
|
||||||
"iosprobe.cpp",
|
"iosprobe.cpp",
|
||||||
"iosprobe.h",
|
"iosprobe.h",
|
||||||
"iosqtversion.cpp",
|
"iosqtversion.cpp",
|
||||||
|
|||||||
@@ -356,15 +356,16 @@ IosBuildStepFactory::IosBuildStepFactory(QObject *parent) :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IosBuildStepFactory::canCreate(BuildStepList *parent, const Id) const
|
bool IosBuildStepFactory::canCreate(BuildStepList *parent, const Id id) const
|
||||||
{
|
{
|
||||||
if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_CLEAN
|
if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_CLEAN
|
||||||
&& parent->id() != ProjectExplorer::Constants::BUILDSTEPS_BUILD)
|
&& parent->id() != ProjectExplorer::Constants::BUILDSTEPS_BUILD)
|
||||||
return false;
|
return false;
|
||||||
Kit *kit = parent->target()->kit();
|
Kit *kit = parent->target()->kit();
|
||||||
Core::Id deviceType = DeviceTypeKitInformation::deviceTypeId(kit);
|
Core::Id deviceType = DeviceTypeKitInformation::deviceTypeId(kit);
|
||||||
return (deviceType == Constants::IOS_DEVICE_TYPE
|
return ((deviceType == Constants::IOS_DEVICE_TYPE
|
||||||
|| deviceType == Constants::IOS_SIMULATOR_TYPE);
|
|| deviceType == Constants::IOS_SIMULATOR_TYPE)
|
||||||
|
&& id == IOS_BUILD_STEP_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *IosBuildStepFactory::create(BuildStepList *parent, const Id id)
|
BuildStep *IosBuildStepFactory::create(BuildStepList *parent, const Id id)
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ const char IOS_DEVICE_TYPE[] = "Ios.Device.Type";
|
|||||||
const char IOS_SIMULATOR_TYPE[] = "Ios.Simulator.Type";
|
const char IOS_SIMULATOR_TYPE[] = "Ios.Simulator.Type";
|
||||||
const char IOS_DEVICE_ID[] = "iOS Device ";
|
const char IOS_DEVICE_ID[] = "iOS Device ";
|
||||||
const char IOS_SIMULATOR_DEVICE_ID[] = "iOS Simulator Device ";
|
const char IOS_SIMULATOR_DEVICE_ID[] = "iOS Simulator Device ";
|
||||||
|
const char IOS_DSYM_BUILD_STEP_ID[] = "Ios.IosDsymBuildStep";
|
||||||
|
|
||||||
const quint16 IOS_DEVICE_PORT_START = 30000;
|
const quint16 IOS_DEVICE_PORT_START = 30000;
|
||||||
const quint16 IOS_DEVICE_PORT_END = 31000;
|
const quint16 IOS_DEVICE_PORT_END = 31000;
|
||||||
|
|||||||
470
src/plugins/ios/iosdsymbuildstep.cpp
Normal file
470
src/plugins/ios/iosdsymbuildstep.cpp
Normal file
@@ -0,0 +1,470 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2014 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 "iosdsymbuildstep.h"
|
||||||
|
|
||||||
|
#include "iosconstants.h"
|
||||||
|
#include "ui_iospresetbuildstep.h"
|
||||||
|
#include "iosmanager.h"
|
||||||
|
#include "iosconfigurations.h"
|
||||||
|
#include "iosrunconfiguration.h"
|
||||||
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
#include <projectexplorer/target.h>
|
||||||
|
#include <projectexplorer/project.h>
|
||||||
|
#include <projectexplorer/buildsteplist.h>
|
||||||
|
#include <projectexplorer/kitinformation.h>
|
||||||
|
#include <projectexplorer/projectexplorer.h>
|
||||||
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
#include <qtsupport/qtparser.h>
|
||||||
|
#include <coreplugin/variablemanager.h>
|
||||||
|
#include <utils/stringutils.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
#include <utils/qtcprocess.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
using namespace Core;
|
||||||
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
|
namespace Ios {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
static const char USE_DEFAULT_ARGS_PARTIAL_KEY[] = ".ArgumentsUseDefault";
|
||||||
|
static const char COMMAND_PARTIAL_KEY[] = ".Command";
|
||||||
|
static const char ARGUMENTS_PARTIAL_KEY[] = ".Arguments";
|
||||||
|
static const char CLEAN_PARTIAL_KEY[] = ".Clean";
|
||||||
|
|
||||||
|
IosPresetBuildStep::IosPresetBuildStep(BuildStepList *parent, const Id id) :
|
||||||
|
AbstractProcessStep(parent, id),
|
||||||
|
m_clean(parent->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IosPresetBuildStep::completeSetup()
|
||||||
|
{
|
||||||
|
m_command = defaultCommand();
|
||||||
|
m_arguments = defaultArguments();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IosPresetBuildStep::completeSetupWithStep(BuildStep *bs)
|
||||||
|
{
|
||||||
|
IosPresetBuildStep *o = qobject_cast<IosPresetBuildStep *>(bs);
|
||||||
|
if (!o)
|
||||||
|
return false;
|
||||||
|
m_arguments = o->m_arguments;
|
||||||
|
m_clean = o->m_clean;
|
||||||
|
m_command = o->m_command;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
IosPresetBuildStep::~IosPresetBuildStep()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IosPresetBuildStep::init()
|
||||||
|
{
|
||||||
|
BuildConfiguration *bc = buildConfiguration();
|
||||||
|
if (!bc)
|
||||||
|
bc = target()->activeBuildConfiguration();
|
||||||
|
|
||||||
|
ProcessParameters *pp = processParameters();
|
||||||
|
pp->setMacroExpander(bc->macroExpander());
|
||||||
|
pp->setWorkingDirectory(bc->buildDirectory().toString());
|
||||||
|
Utils::Environment env = bc->environment();
|
||||||
|
// Force output to english for the parsers. Do this here and not in the toolchain's
|
||||||
|
// addToEnvironment() to not screw up the users run environment.
|
||||||
|
env.set(QLatin1String("LC_ALL"), QLatin1String("C"));
|
||||||
|
pp->setEnvironment(env);
|
||||||
|
pp->setCommand(command());
|
||||||
|
pp->setArguments(Utils::QtcProcess::joinArgs(arguments()));
|
||||||
|
pp->resolveAll();
|
||||||
|
|
||||||
|
// If we are cleaning, then build can fail with an error code, but that doesn't mean
|
||||||
|
// we should stop the clean queue
|
||||||
|
// That is mostly so that rebuild works on an already clean project
|
||||||
|
setIgnoreReturnValue(m_clean);
|
||||||
|
|
||||||
|
setOutputParser(target()->kit()->createOutputParser());
|
||||||
|
if (outputParser())
|
||||||
|
outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory());
|
||||||
|
|
||||||
|
return AbstractProcessStep::init();
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariantMap IosPresetBuildStep::toMap() const
|
||||||
|
{
|
||||||
|
QVariantMap map(AbstractProcessStep::toMap());
|
||||||
|
|
||||||
|
map.insert(id().withSuffix(QLatin1String(ARGUMENTS_PARTIAL_KEY)).toString(),
|
||||||
|
arguments());
|
||||||
|
map.insert(id().withSuffix(QLatin1String(USE_DEFAULT_ARGS_PARTIAL_KEY)).toString(),
|
||||||
|
isDefault());
|
||||||
|
map.insert(id().withSuffix(QLatin1String(CLEAN_PARTIAL_KEY)).toString(), m_clean);
|
||||||
|
map.insert(id().withSuffix(QLatin1String(COMMAND_PARTIAL_KEY)).toString(), command());
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IosPresetBuildStep::fromMap(const QVariantMap &map)
|
||||||
|
{
|
||||||
|
QVariant bArgs = map.value(id().withSuffix(QLatin1String(ARGUMENTS_PARTIAL_KEY)).toString());
|
||||||
|
m_arguments = bArgs.toStringList();
|
||||||
|
bool useDefaultArguments = map.value(
|
||||||
|
id().withSuffix(QLatin1String(USE_DEFAULT_ARGS_PARTIAL_KEY)).toString()).toBool();
|
||||||
|
m_clean = map.value(id().withSuffix(QLatin1String(CLEAN_PARTIAL_KEY)).toString(), m_clean).toBool();
|
||||||
|
m_command = map.value(id().withSuffix(QLatin1String(COMMAND_PARTIAL_KEY)).toString(), m_command)
|
||||||
|
.toString();
|
||||||
|
if (useDefaultArguments) {
|
||||||
|
m_command = defaultCommand();
|
||||||
|
m_arguments = defaultArguments();
|
||||||
|
}
|
||||||
|
|
||||||
|
return BuildStep::fromMap(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList IosPresetBuildStep::defaultArguments() const
|
||||||
|
{
|
||||||
|
if (m_clean)
|
||||||
|
return defaultCleanCmdList().mid(1);
|
||||||
|
return defaultCmdList().mid(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString IosPresetBuildStep::defaultCommand() const
|
||||||
|
{
|
||||||
|
if (m_clean)
|
||||||
|
return defaultCleanCmdList().at(0);
|
||||||
|
else
|
||||||
|
return defaultCmdList().at(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString IosPresetBuildStep::command() const
|
||||||
|
{
|
||||||
|
if (m_command.isEmpty())
|
||||||
|
return defaultCommand();
|
||||||
|
return m_command;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IosPresetBuildStep::setCommand(const QString &command)
|
||||||
|
{
|
||||||
|
if (command == m_command)
|
||||||
|
return;
|
||||||
|
if (command.isEmpty() || command == defaultCommand()) {
|
||||||
|
if (arguments() == defaultArguments())
|
||||||
|
m_command.clear();
|
||||||
|
else
|
||||||
|
m_command = defaultCommand();
|
||||||
|
} else if (m_command.isEmpty()) {
|
||||||
|
m_arguments = defaultArguments();
|
||||||
|
m_command = command;
|
||||||
|
} else {
|
||||||
|
m_command = command;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IosPresetBuildStep::clean() const
|
||||||
|
{
|
||||||
|
return m_clean;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IosPresetBuildStep::setClean(bool clean)
|
||||||
|
{
|
||||||
|
if (m_clean != clean) {
|
||||||
|
m_clean = clean;
|
||||||
|
m_arguments = defaultArguments();
|
||||||
|
m_command = defaultCommand();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IosPresetBuildStep::isDefault() const
|
||||||
|
{
|
||||||
|
return arguments() == defaultArguments() && command() == defaultCommand();
|
||||||
|
}
|
||||||
|
|
||||||
|
void IosPresetBuildStep::run(QFutureInterface<bool> &fi)
|
||||||
|
{
|
||||||
|
AbstractProcessStep::run(fi);
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildStepConfigWidget *IosPresetBuildStep::createConfigWidget()
|
||||||
|
{
|
||||||
|
return new IosPresetBuildStepConfigWidget(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IosPresetBuildStep::immutable() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IosPresetBuildStep::setArguments(const QStringList &args)
|
||||||
|
{
|
||||||
|
if (arguments() == args)
|
||||||
|
return;
|
||||||
|
if (args == defaultArguments() && command() == defaultCommand())
|
||||||
|
m_command.clear();
|
||||||
|
else {
|
||||||
|
if (m_command.isEmpty())
|
||||||
|
m_command = defaultCommand();
|
||||||
|
m_arguments = args;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList IosPresetBuildStep::arguments() const
|
||||||
|
{
|
||||||
|
if (m_command.isEmpty())
|
||||||
|
return defaultArguments();
|
||||||
|
return m_arguments;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// IosPresetBuildStepConfigWidget
|
||||||
|
//
|
||||||
|
|
||||||
|
IosPresetBuildStepConfigWidget::IosPresetBuildStepConfigWidget(IosPresetBuildStep *buildStep)
|
||||||
|
: m_buildStep(buildStep)
|
||||||
|
{
|
||||||
|
m_ui = new Ui::IosPresetBuildStep;
|
||||||
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
|
Project *pro = m_buildStep->target()->project();
|
||||||
|
|
||||||
|
m_ui->commandLineEdit->setText(m_buildStep->command());
|
||||||
|
m_ui->argumentsTextEdit->setPlainText(Utils::QtcProcess::joinArgs(
|
||||||
|
m_buildStep->arguments()));
|
||||||
|
m_ui->resetDefaultsButton->setEnabled(!m_buildStep->isDefault());
|
||||||
|
updateDetails();
|
||||||
|
|
||||||
|
connect(m_ui->argumentsTextEdit, SIGNAL(textChanged()),
|
||||||
|
SLOT(argumentsChanged()));
|
||||||
|
connect(m_ui->commandLineEdit, SIGNAL(editingFinished()),
|
||||||
|
SLOT(commandChanged()));
|
||||||
|
connect(m_ui->resetDefaultsButton, SIGNAL(clicked()),
|
||||||
|
SLOT(resetDefaults()));
|
||||||
|
|
||||||
|
connect(ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
|
||||||
|
SLOT(updateDetails()));
|
||||||
|
connect(m_buildStep->target(), SIGNAL(kitChanged()),
|
||||||
|
SLOT(updateDetails()));
|
||||||
|
connect(pro, SIGNAL(environmentChanged()),
|
||||||
|
SLOT(updateDetails()));
|
||||||
|
}
|
||||||
|
|
||||||
|
IosPresetBuildStepConfigWidget::~IosPresetBuildStepConfigWidget()
|
||||||
|
{
|
||||||
|
delete m_ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString IosPresetBuildStepConfigWidget::displayName() const
|
||||||
|
{
|
||||||
|
return m_buildStep->displayName();
|
||||||
|
}
|
||||||
|
|
||||||
|
void IosPresetBuildStepConfigWidget::updateDetails()
|
||||||
|
{
|
||||||
|
BuildConfiguration *bc = m_buildStep->buildConfiguration();
|
||||||
|
if (!bc)
|
||||||
|
bc = m_buildStep->target()->activeBuildConfiguration();
|
||||||
|
|
||||||
|
ProcessParameters param;
|
||||||
|
param.setMacroExpander(bc->macroExpander());
|
||||||
|
param.setWorkingDirectory(bc->buildDirectory().toString());
|
||||||
|
param.setEnvironment(bc->environment());
|
||||||
|
param.setCommand(m_buildStep->command());
|
||||||
|
param.setArguments(Utils::QtcProcess::joinArgs(m_buildStep->arguments()));
|
||||||
|
m_summaryText = param.summary(displayName());
|
||||||
|
emit updateSummary();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString IosPresetBuildStepConfigWidget::summaryText() const
|
||||||
|
{
|
||||||
|
return m_summaryText;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IosPresetBuildStepConfigWidget::commandChanged()
|
||||||
|
{
|
||||||
|
m_buildStep->setCommand(m_ui->commandLineEdit->text());
|
||||||
|
m_ui->resetDefaultsButton->setEnabled(!m_buildStep->isDefault());
|
||||||
|
updateDetails();
|
||||||
|
}
|
||||||
|
|
||||||
|
void IosPresetBuildStepConfigWidget::argumentsChanged()
|
||||||
|
{
|
||||||
|
m_buildStep->setArguments(Utils::QtcProcess::splitArgs(
|
||||||
|
m_ui->argumentsTextEdit->toPlainText()));
|
||||||
|
m_ui->resetDefaultsButton->setEnabled(!m_buildStep->isDefault());
|
||||||
|
updateDetails();
|
||||||
|
}
|
||||||
|
|
||||||
|
void IosPresetBuildStepConfigWidget::resetDefaults()
|
||||||
|
{
|
||||||
|
m_buildStep->setCommand(m_buildStep->defaultCommand());
|
||||||
|
m_buildStep->setArguments(m_buildStep->defaultArguments());
|
||||||
|
m_ui->commandLineEdit->setText(m_buildStep->command());
|
||||||
|
m_ui->argumentsTextEdit->setPlainText(Utils::QtcProcess::joinArgs(
|
||||||
|
m_buildStep->arguments()));
|
||||||
|
m_ui->resetDefaultsButton->setEnabled(!m_buildStep->isDefault());
|
||||||
|
updateDetails();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// IosPresetBuildStepFactory
|
||||||
|
//
|
||||||
|
|
||||||
|
IosPresetBuildStepFactory::IosPresetBuildStepFactory(QObject *parent) :
|
||||||
|
IBuildStepFactory(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildStep *IosPresetBuildStepFactory::create(BuildStepList *parent, const Id id)
|
||||||
|
{
|
||||||
|
if (!canCreate(parent, id))
|
||||||
|
return 0;
|
||||||
|
IosPresetBuildStep *step = createPresetStep(parent, id);
|
||||||
|
if (step->completeSetup())
|
||||||
|
return step;
|
||||||
|
delete step;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IosPresetBuildStepFactory::canClone(BuildStepList *parent, BuildStep *source) const
|
||||||
|
{
|
||||||
|
return canCreate(parent, source->id());
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildStep *IosPresetBuildStepFactory::clone(BuildStepList *parent, BuildStep *source)
|
||||||
|
{
|
||||||
|
if (!canClone(parent, source))
|
||||||
|
return 0;
|
||||||
|
IosPresetBuildStep *old = qobject_cast<IosPresetBuildStep *>(source);
|
||||||
|
Q_ASSERT(old);
|
||||||
|
IosPresetBuildStep *res = createPresetStep(parent, old->id());
|
||||||
|
if (res->completeSetupWithStep(old))
|
||||||
|
return res;
|
||||||
|
delete res;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IosPresetBuildStepFactory::canRestore(BuildStepList *parent, const QVariantMap &map) const
|
||||||
|
{
|
||||||
|
return canCreate(parent, idFromMap(map));
|
||||||
|
}
|
||||||
|
|
||||||
|
BuildStep *IosPresetBuildStepFactory::restore(BuildStepList *parent, const QVariantMap &map)
|
||||||
|
{
|
||||||
|
if (!canRestore(parent, map))
|
||||||
|
return 0;
|
||||||
|
IosPresetBuildStep *bs = createPresetStep(parent, idFromMap(map));
|
||||||
|
if (bs->fromMap(map))
|
||||||
|
return bs;
|
||||||
|
delete bs;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString IosDsymBuildStepFactory::displayNameForId(const Id id) const
|
||||||
|
{
|
||||||
|
if (id == Constants::IOS_DSYM_BUILD_STEP_ID)
|
||||||
|
return QLatin1String("dsymutil");
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<Id> IosDsymBuildStepFactory::availableCreationIds(BuildStepList *parent) const
|
||||||
|
{
|
||||||
|
if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_CLEAN
|
||||||
|
&& parent->id() != ProjectExplorer::Constants::BUILDSTEPS_BUILD
|
||||||
|
&& parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
|
||||||
|
return QList<Id>();
|
||||||
|
Kit *kit = parent->target()->kit();
|
||||||
|
Core::Id deviceType = DeviceTypeKitInformation::deviceTypeId(kit);
|
||||||
|
if (deviceType == Constants::IOS_DEVICE_TYPE
|
||||||
|
|| deviceType == Constants::IOS_SIMULATOR_TYPE)
|
||||||
|
return QList<Id>() << Id(Constants::IOS_DSYM_BUILD_STEP_ID);
|
||||||
|
return QList<Id>();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IosDsymBuildStepFactory::canCreate(BuildStepList *parent, const Id id) const
|
||||||
|
{
|
||||||
|
if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_CLEAN
|
||||||
|
&& parent->id() != ProjectExplorer::Constants::BUILDSTEPS_BUILD
|
||||||
|
&& parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
|
||||||
|
return false;
|
||||||
|
Kit *kit = parent->target()->kit();
|
||||||
|
Core::Id deviceType = DeviceTypeKitInformation::deviceTypeId(kit);
|
||||||
|
return ((deviceType == Constants::IOS_DEVICE_TYPE
|
||||||
|
|| deviceType == Constants::IOS_SIMULATOR_TYPE)
|
||||||
|
&& id == Constants::IOS_DSYM_BUILD_STEP_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
IosPresetBuildStep *IosDsymBuildStepFactory::createPresetStep(BuildStepList *parent, const Id id) const
|
||||||
|
{
|
||||||
|
return new IosDsymBuildStep(parent, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
IosDsymBuildStep::IosDsymBuildStep(BuildStepList *parent, const Id id)
|
||||||
|
: IosPresetBuildStep(parent, id)
|
||||||
|
{
|
||||||
|
setDefaultDisplayName(QLatin1String("dsymutil"));
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList IosDsymBuildStep::defaultCleanCmdList() const
|
||||||
|
{
|
||||||
|
IosRunConfiguration *runConf =
|
||||||
|
qobject_cast<IosRunConfiguration *>(target()->activeRunConfiguration());
|
||||||
|
QTC_ASSERT(runConf, return QStringList(QLatin1String("echo")));
|
||||||
|
QString dsymPath = runConf->bundleDir().toUserOutput();
|
||||||
|
dsymPath.chop(4);
|
||||||
|
dsymPath.append(QLatin1String(".dSYM"));
|
||||||
|
return QStringList()
|
||||||
|
<< QLatin1String("rm")
|
||||||
|
<< QLatin1String("-rf")
|
||||||
|
<< dsymPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList IosDsymBuildStep::defaultCmdList() const
|
||||||
|
{
|
||||||
|
QString dsymutilCmd = QLatin1String("dsymutil");
|
||||||
|
Utils::FileName dsymUtilPath = IosConfigurations::developerPath()
|
||||||
|
.appendPath(QLatin1String("Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil"));
|
||||||
|
if (dsymUtilPath.toFileInfo().exists())
|
||||||
|
dsymutilCmd = dsymUtilPath.toUserOutput();
|
||||||
|
IosRunConfiguration *runConf =
|
||||||
|
qobject_cast<IosRunConfiguration *>(target()->activeRunConfiguration());
|
||||||
|
QTC_ASSERT(runConf, return QStringList(QLatin1String("echo")));
|
||||||
|
QString dsymPath = runConf->bundleDir().toUserOutput();
|
||||||
|
dsymPath.chop(4);
|
||||||
|
dsymPath.append(QLatin1String(".dSYM"));
|
||||||
|
return QStringList()
|
||||||
|
<< dsymutilCmd
|
||||||
|
<< QLatin1String("-o")
|
||||||
|
<< dsymPath
|
||||||
|
<< runConf->exePath().toUserOutput();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace Ios
|
||||||
148
src/plugins/ios/iosdsymbuildstep.h
Normal file
148
src/plugins/ios/iosdsymbuildstep.h
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2014 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 IOSDSYMBUILDSTEP_H
|
||||||
|
#define IOSDSYMBUILDSTEP_H
|
||||||
|
|
||||||
|
#include <projectexplorer/abstractprocessstep.h>
|
||||||
|
#include <utils/qtcoverride.h>
|
||||||
|
|
||||||
|
namespace Ios {
|
||||||
|
namespace Internal {
|
||||||
|
namespace Ui { class IosPresetBuildStep; }
|
||||||
|
|
||||||
|
class IosPresetBuildStepConfigWidget;
|
||||||
|
class IosPresetBuildStepFactory;
|
||||||
|
|
||||||
|
class IosPresetBuildStep : public ProjectExplorer::AbstractProcessStep
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
friend class IosPresetBuildStepConfigWidget;
|
||||||
|
friend class IosPresetBuildStepFactory;
|
||||||
|
|
||||||
|
public:
|
||||||
|
~IosPresetBuildStep();
|
||||||
|
|
||||||
|
bool init() QTC_OVERRIDE;
|
||||||
|
void run(QFutureInterface<bool> &fi) QTC_OVERRIDE;
|
||||||
|
|
||||||
|
ProjectExplorer::BuildStepConfigWidget *createConfigWidget() QTC_OVERRIDE;
|
||||||
|
bool immutable() const QTC_OVERRIDE;
|
||||||
|
void setArguments(const QStringList &args);
|
||||||
|
QStringList arguments() const;
|
||||||
|
QStringList defaultArguments() const;
|
||||||
|
QString defaultCommand() const;
|
||||||
|
QString command() const;
|
||||||
|
void setCommand(const QString &command);
|
||||||
|
bool clean() const;
|
||||||
|
void setClean(bool clean);
|
||||||
|
bool isDefault() const;
|
||||||
|
|
||||||
|
QVariantMap toMap() const QTC_OVERRIDE;
|
||||||
|
protected:
|
||||||
|
IosPresetBuildStep(ProjectExplorer::BuildStepList *parent, const Core::Id id);
|
||||||
|
virtual bool completeSetup();
|
||||||
|
virtual bool completeSetupWithStep(ProjectExplorer::BuildStep *bs);
|
||||||
|
bool fromMap(const QVariantMap &map) QTC_OVERRIDE;
|
||||||
|
virtual QStringList defaultCleanCmdList() const = 0;
|
||||||
|
virtual QStringList defaultCmdList() const = 0;
|
||||||
|
private:
|
||||||
|
QStringList m_arguments;
|
||||||
|
QString m_command;
|
||||||
|
bool m_clean;
|
||||||
|
};
|
||||||
|
|
||||||
|
class IosPresetBuildStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
IosPresetBuildStepConfigWidget(IosPresetBuildStep *buildStep);
|
||||||
|
~IosPresetBuildStepConfigWidget();
|
||||||
|
QString displayName() const QTC_OVERRIDE;
|
||||||
|
QString summaryText() const QTC_OVERRIDE;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void commandChanged();
|
||||||
|
void argumentsChanged();
|
||||||
|
void resetDefaults();
|
||||||
|
void updateDetails();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::IosPresetBuildStep *m_ui;
|
||||||
|
IosPresetBuildStep *m_buildStep;
|
||||||
|
QString m_summaryText;
|
||||||
|
};
|
||||||
|
|
||||||
|
class IosPresetBuildStepFactory : public ProjectExplorer::IBuildStepFactory
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit IosPresetBuildStepFactory(QObject *parent = 0);
|
||||||
|
|
||||||
|
ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id) QTC_OVERRIDE;
|
||||||
|
bool canClone(ProjectExplorer::BuildStepList *parent,
|
||||||
|
ProjectExplorer::BuildStep *source) const QTC_OVERRIDE;
|
||||||
|
ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent,
|
||||||
|
ProjectExplorer::BuildStep *source) QTC_OVERRIDE;
|
||||||
|
bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const QTC_OVERRIDE;
|
||||||
|
ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent,
|
||||||
|
const QVariantMap &map) QTC_OVERRIDE;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual IosPresetBuildStep *createPresetStep(ProjectExplorer::BuildStepList *parent,
|
||||||
|
const Core::Id id) const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class IosDsymBuildStep : public IosPresetBuildStep
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
friend class IosDsymBuildStepFactory;
|
||||||
|
protected:
|
||||||
|
QStringList defaultCleanCmdList() const QTC_OVERRIDE;
|
||||||
|
QStringList defaultCmdList() const QTC_OVERRIDE;
|
||||||
|
IosDsymBuildStep(ProjectExplorer::BuildStepList *parent, const Core::Id id);
|
||||||
|
};
|
||||||
|
|
||||||
|
class IosDsymBuildStepFactory : public IosPresetBuildStepFactory
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const QTC_OVERRIDE;
|
||||||
|
QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *bc) const QTC_OVERRIDE;
|
||||||
|
QString displayNameForId(const Core::Id id) const QTC_OVERRIDE;
|
||||||
|
IosPresetBuildStep *createPresetStep(ProjectExplorer::BuildStepList *parent,
|
||||||
|
const Core::Id id) const QTC_OVERRIDE;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace Ios
|
||||||
|
|
||||||
|
#endif // IOSDSYMBUILDSTEP_H
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
#include "iosdeploystepfactory.h"
|
#include "iosdeploystepfactory.h"
|
||||||
#include "iosdevicefactory.h"
|
#include "iosdevicefactory.h"
|
||||||
#include "iosmanager.h"
|
#include "iosmanager.h"
|
||||||
|
#include "iosdsymbuildstep.h"
|
||||||
#include "iosqtversionfactory.h"
|
#include "iosqtversionfactory.h"
|
||||||
#include "iosrunfactories.h"
|
#include "iosrunfactories.h"
|
||||||
#include "iossettingspage.h"
|
#include "iossettingspage.h"
|
||||||
@@ -72,6 +73,7 @@ bool IosPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
addAutoReleasedObject(new Internal::IosSimulatorFactory);
|
addAutoReleasedObject(new Internal::IosSimulatorFactory);
|
||||||
addAutoReleasedObject(new Internal::IosBuildStepFactory);
|
addAutoReleasedObject(new Internal::IosBuildStepFactory);
|
||||||
addAutoReleasedObject(new Internal::IosDeployStepFactory);
|
addAutoReleasedObject(new Internal::IosDeployStepFactory);
|
||||||
|
addAutoReleasedObject(new Internal::IosDsymBuildStepFactory);
|
||||||
addAutoReleasedObject(new Internal::IosDeployConfigurationFactory);
|
addAutoReleasedObject(new Internal::IosDeployConfigurationFactory);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
65
src/plugins/ios/iospresetbuildstep.ui
Normal file
65
src/plugins/ios/iospresetbuildstep.ui
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>Ios::Internal::IosPresetBuildStep</class>
|
||||||
|
<widget class="QWidget" name="Ios::Internal::IosPresetBuildStep">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>756</width>
|
||||||
|
<height>133</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="2" column="3">
|
||||||
|
<widget class="QPushButton" name="resetDefaultsButton">
|
||||||
|
<property name="layoutDirection">
|
||||||
|
<enum>Qt::RightToLeft</enum>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Reset to Default</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="commandLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Command:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2" rowspan="2">
|
||||||
|
<widget class="QPlainTextEdit" name="argumentsTextEdit"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="argumentsLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Arguments:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QLineEdit" name="commandLineEdit"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
<zorder>argumentsTextEdit</zorder>
|
||||||
|
<zorder>resetDefaultsButton</zorder>
|
||||||
|
<zorder>argumentsLabel</zorder>
|
||||||
|
<zorder>commandLabel</zorder>
|
||||||
|
<zorder>commandLineEdit</zorder>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
Reference in New Issue
Block a user