2013-04-25 16:02:17 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-04-25 16:02:17 +02:00
|
|
|
**
|
|
|
|
|
** 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
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2013-04-25 16:02:17 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2013-04-25 16:02:17 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "iosbuildstep.h"
|
|
|
|
|
#include "iosconstants.h"
|
|
|
|
|
|
|
|
|
|
#include <extensionsystem/pluginmanager.h>
|
|
|
|
|
#include <projectexplorer/target.h>
|
|
|
|
|
#include <projectexplorer/project.h>
|
|
|
|
|
#include <projectexplorer/buildsteplist.h>
|
|
|
|
|
#include <projectexplorer/gnumakeparser.h>
|
|
|
|
|
#include <projectexplorer/kitinformation.h>
|
|
|
|
|
#include <projectexplorer/projectexplorer.h>
|
|
|
|
|
#include <projectexplorer/buildconfiguration.h>
|
2018-11-17 21:19:04 +02:00
|
|
|
#include <projectexplorer/processparameters.h>
|
2013-04-25 16:02:17 +02:00
|
|
|
#include <projectexplorer/projectexplorerconstants.h>
|
|
|
|
|
#include <projectexplorer/toolchain.h>
|
|
|
|
|
#include <projectexplorer/gcctoolchain.h>
|
2019-06-21 08:31:37 +02:00
|
|
|
|
2013-04-25 16:02:17 +02:00
|
|
|
#include <qtsupport/qtkitinformation.h>
|
|
|
|
|
#include <qtsupport/qtparser.h>
|
2019-06-21 08:31:37 +02:00
|
|
|
|
|
|
|
|
#include <utils/fileutils.h>
|
2013-04-25 16:02:17 +02:00
|
|
|
#include <utils/stringutils.h>
|
|
|
|
|
#include <utils/qtcassert.h>
|
|
|
|
|
#include <utils/qtcprocess.h>
|
|
|
|
|
|
2019-06-26 11:41:36 +02:00
|
|
|
#include <QGridLayout>
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QLineEdit>
|
|
|
|
|
#include <QPlainTextEdit>
|
|
|
|
|
#include <QPushButton>
|
|
|
|
|
|
2013-04-25 16:02:17 +02:00
|
|
|
using namespace Core;
|
|
|
|
|
using namespace ProjectExplorer;
|
2019-06-21 08:31:37 +02:00
|
|
|
using namespace Utils;
|
2013-04-25 16:02:17 +02:00
|
|
|
|
|
|
|
|
namespace Ios {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
const char IOS_BUILD_STEP_ID[] = "Ios.IosBuildStep";
|
|
|
|
|
const char IOS_BUILD_STEP_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("Ios::Internal::IosBuildStep",
|
|
|
|
|
"xcodebuild");
|
|
|
|
|
|
|
|
|
|
const char BUILD_USE_DEFAULT_ARGS_KEY[] = "Ios.IosBuildStep.XcodeArgumentsUseDefault";
|
|
|
|
|
const char BUILD_ARGUMENTS_KEY[] = "Ios.IosBuildStep.XcodeArguments";
|
|
|
|
|
const char CLEAN_KEY[] = "Ios.IosBuildStep.Clean";
|
|
|
|
|
|
2019-06-26 11:41:36 +02:00
|
|
|
//
|
|
|
|
|
// IosBuildStepConfigWidget
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
class IosBuildStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
IosBuildStepConfigWidget(IosBuildStep *buildStep)
|
|
|
|
|
: BuildStepConfigWidget(buildStep), m_buildStep(buildStep)
|
|
|
|
|
{
|
|
|
|
|
auto buildArgumentsLabel = new QLabel(this);
|
|
|
|
|
buildArgumentsLabel->setText(tr("Base arguments:"));
|
|
|
|
|
|
|
|
|
|
m_buildArgumentsTextEdit = new QPlainTextEdit(this);
|
|
|
|
|
m_buildArgumentsTextEdit->setPlainText(QtcProcess::joinArgs(m_buildStep->baseArguments()));
|
|
|
|
|
|
|
|
|
|
m_resetDefaultsButton = new QPushButton(this);
|
|
|
|
|
m_resetDefaultsButton->setLayoutDirection(Qt::RightToLeft);
|
|
|
|
|
m_resetDefaultsButton->setText(tr("Reset Defaults"));
|
|
|
|
|
m_resetDefaultsButton->setEnabled(!m_buildStep->m_useDefaultArguments);
|
|
|
|
|
|
|
|
|
|
auto extraArgumentsLabel = new QLabel(this);
|
|
|
|
|
|
|
|
|
|
m_extraArgumentsLineEdit = new QLineEdit(this);
|
|
|
|
|
m_extraArgumentsLineEdit->setText(QtcProcess::joinArgs(m_buildStep->m_extraArguments));
|
|
|
|
|
|
|
|
|
|
auto gridLayout = new QGridLayout(this);
|
|
|
|
|
gridLayout->addWidget(buildArgumentsLabel, 0, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(m_buildArgumentsTextEdit, 0, 1, 2, 1);
|
|
|
|
|
gridLayout->addWidget(m_resetDefaultsButton, 1, 2, 1, 1);
|
|
|
|
|
gridLayout->addWidget(extraArgumentsLabel, 2, 0, 1, 1);
|
|
|
|
|
gridLayout->addWidget(m_extraArgumentsLineEdit, 2, 1, 1, 1);
|
|
|
|
|
|
|
|
|
|
extraArgumentsLabel->setText(tr("Extra arguments:"));
|
|
|
|
|
|
|
|
|
|
setDisplayName(tr("iOS build", "iOS BuildStep display name."));
|
|
|
|
|
|
|
|
|
|
updateDetails();
|
|
|
|
|
|
|
|
|
|
connect(m_buildArgumentsTextEdit, &QPlainTextEdit::textChanged,
|
|
|
|
|
this, &IosBuildStepConfigWidget::buildArgumentsChanged);
|
|
|
|
|
connect(m_resetDefaultsButton, &QAbstractButton::clicked,
|
|
|
|
|
this, &IosBuildStepConfigWidget::resetDefaultArguments);
|
|
|
|
|
connect(m_extraArgumentsLineEdit, &QLineEdit::editingFinished,
|
|
|
|
|
this, &IosBuildStepConfigWidget::extraArgumentsChanged);
|
|
|
|
|
|
|
|
|
|
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged,
|
|
|
|
|
this, &IosBuildStepConfigWidget::updateDetails);
|
|
|
|
|
connect(m_buildStep->target(), &Target::kitChanged,
|
|
|
|
|
this, &IosBuildStepConfigWidget::updateDetails);
|
|
|
|
|
|
|
|
|
|
Project *pro = m_buildStep->target()->project();
|
|
|
|
|
pro->subscribeSignal(&BuildConfiguration::environmentChanged, this, [this]() {
|
|
|
|
|
if (static_cast<BuildConfiguration *>(sender())->isActive())
|
|
|
|
|
updateDetails();
|
|
|
|
|
});
|
|
|
|
|
connect(pro, &Project::activeProjectConfigurationChanged,
|
|
|
|
|
this, [this](ProjectConfiguration *pc) {
|
|
|
|
|
if (pc && pc->isActive())
|
|
|
|
|
updateDetails();
|
|
|
|
|
});
|
2019-07-29 15:13:17 +02:00
|
|
|
connect(pro, &Project::activeTargetChanged, this, [this](Target *target) {
|
|
|
|
|
if (target && target->isActive())
|
|
|
|
|
updateDetails();
|
|
|
|
|
});
|
2019-06-26 11:41:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void buildArgumentsChanged()
|
|
|
|
|
{
|
|
|
|
|
m_buildStep->setBaseArguments(QtcProcess::splitArgs(m_buildArgumentsTextEdit->toPlainText()));
|
|
|
|
|
m_resetDefaultsButton->setEnabled(!m_buildStep->m_useDefaultArguments);
|
|
|
|
|
updateDetails();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void resetDefaultArguments()
|
|
|
|
|
{
|
|
|
|
|
m_buildStep->setBaseArguments(m_buildStep->defaultArguments());
|
|
|
|
|
m_buildArgumentsTextEdit->setPlainText(QtcProcess::joinArgs(m_buildStep->baseArguments()));
|
|
|
|
|
m_resetDefaultsButton->setEnabled(!m_buildStep->m_useDefaultArguments);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void extraArgumentsChanged()
|
|
|
|
|
{
|
|
|
|
|
m_buildStep->setExtraArguments(QtcProcess::splitArgs(m_extraArgumentsLineEdit->text()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void updateDetails()
|
|
|
|
|
{
|
|
|
|
|
BuildConfiguration *bc = m_buildStep->buildConfiguration();
|
|
|
|
|
|
|
|
|
|
ProcessParameters param;
|
|
|
|
|
param.setMacroExpander(bc->macroExpander());
|
|
|
|
|
param.setWorkingDirectory(bc->buildDirectory());
|
|
|
|
|
param.setEnvironment(bc->environment());
|
|
|
|
|
param.setCommandLine({m_buildStep->buildCommand(), m_buildStep->allArguments()});
|
|
|
|
|
|
|
|
|
|
setSummaryText(param.summary(displayName()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IosBuildStep *m_buildStep;
|
|
|
|
|
|
|
|
|
|
QPlainTextEdit *m_buildArgumentsTextEdit;
|
|
|
|
|
QPushButton *m_resetDefaultsButton;
|
|
|
|
|
QLineEdit *m_extraArgumentsLineEdit;
|
|
|
|
|
};
|
|
|
|
|
|
2013-04-25 16:02:17 +02:00
|
|
|
IosBuildStep::IosBuildStep(BuildStepList *parent) :
|
ProjectExplorer/all: Re-organize BuildSteps/{Deploy,Build}Config setup
This follow the rough pattern of recent *RunConfigurationFactory changes
for build and deploy configurations.
- Collapse the two lines of constructors similar to what
890c1906e6fb2ec did for RunConfigurations
* Deploy* was purely mechanical
* Build* ctors are split in connects() in the ctor body
to create "empty shell for clone" etc
and build step additions in initialize() functions which
are only used in the create() case.
-- Allows to collapse the shared 'ctor()' functions, too.
- Move FooBuildConfigurationFactory::create() implementations
to FooBuildConfiguration() constructor. That was a strange
and unneeded ping-pong between factories and objects, and
furthermore allows one level less of indirection (and for a
later, left out here, some reduction of the
FooBuildConfiguration interfaces that were only used to
accommodate the *Factory::create() functions.
- Most {Build,Deploy}Configuration{,Factory} classes had a canHandle(),
but there wasn't one in the base classses. Have one there.
- Most canHandle() functions were checking simple restrictions on
e.g. project or target types, specify those by setters in the
constructors instead and check them in the base canHandle()
- clone() is generally replaced by a creation of a "shell object"
and a fromMap(source->toMap()), implemented in the base, there
are two cases left for Android and Qbs that needed(?) some extra
polish
- generally use canHandle() in base implementation, instead
of doing that in all Derived::canFoo()
- as a result, canCreate/create/canClone/clone reimplementations
are not needed anymore, keep the base implementation for
now (could be inlined into their only users later), but
de-virtualize them.
- Combine Ios{Preset,DSym}BuildStepFactory. There was only one
'dsym' build step they could create.
- Split the 'mangled' id into the ProjectConfiguration subtype
specific constant identifier, and a QString extraId() bit.
Only maintain the mangled id in saved settings.
- Make ProjectConfiguration::m_id a constant member, adapt
all constructors of derived classe.
Not done in this patch:
- Finish possible cosmetic changes on top
- Add a way to specify restrictions to supported Qt versions
(used in Android/Ios), as the base implementation does not
depend on the qtsupport plugin
- Combine the QList<X> availableFoo() + createFoo(X) function
pairs to somthing like a direct
QList<struct { X; std::function<X()>; }> fooCreators()
to avoid e.g. the baseId.withSuffix() <-> id.suffixAfter(base)
pingpong
- Remove the *Factories from the global object pool
- Do something about priority(). Falling back to plain
qmake in android+qmake setup is not helpful.
Change-Id: I2be7d88d554c5aa8b7db8edf5b93278e1ae0112a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-29 12:28:40 +01:00
|
|
|
AbstractProcessStep(parent, IOS_BUILD_STEP_ID)
|
2013-04-25 16:02:17 +02:00
|
|
|
{
|
|
|
|
|
setDefaultDisplayName(QCoreApplication::translate("GenericProjectManager::Internal::IosBuildStep",
|
|
|
|
|
IOS_BUILD_STEP_DISPLAY_NAME));
|
ProjectExplorer/all: Re-organize BuildSteps/{Deploy,Build}Config setup
This follow the rough pattern of recent *RunConfigurationFactory changes
for build and deploy configurations.
- Collapse the two lines of constructors similar to what
890c1906e6fb2ec did for RunConfigurations
* Deploy* was purely mechanical
* Build* ctors are split in connects() in the ctor body
to create "empty shell for clone" etc
and build step additions in initialize() functions which
are only used in the create() case.
-- Allows to collapse the shared 'ctor()' functions, too.
- Move FooBuildConfigurationFactory::create() implementations
to FooBuildConfiguration() constructor. That was a strange
and unneeded ping-pong between factories and objects, and
furthermore allows one level less of indirection (and for a
later, left out here, some reduction of the
FooBuildConfiguration interfaces that were only used to
accommodate the *Factory::create() functions.
- Most {Build,Deploy}Configuration{,Factory} classes had a canHandle(),
but there wasn't one in the base classses. Have one there.
- Most canHandle() functions were checking simple restrictions on
e.g. project or target types, specify those by setters in the
constructors instead and check them in the base canHandle()
- clone() is generally replaced by a creation of a "shell object"
and a fromMap(source->toMap()), implemented in the base, there
are two cases left for Android and Qbs that needed(?) some extra
polish
- generally use canHandle() in base implementation, instead
of doing that in all Derived::canFoo()
- as a result, canCreate/create/canClone/clone reimplementations
are not needed anymore, keep the base implementation for
now (could be inlined into their only users later), but
de-virtualize them.
- Combine Ios{Preset,DSym}BuildStepFactory. There was only one
'dsym' build step they could create.
- Split the 'mangled' id into the ProjectConfiguration subtype
specific constant identifier, and a QString extraId() bit.
Only maintain the mangled id in saved settings.
- Make ProjectConfiguration::m_id a constant member, adapt
all constructors of derived classe.
Not done in this patch:
- Finish possible cosmetic changes on top
- Add a way to specify restrictions to supported Qt versions
(used in Android/Ios), as the base implementation does not
depend on the qtsupport plugin
- Combine the QList<X> availableFoo() + createFoo(X) function
pairs to somthing like a direct
QList<struct { X; std::function<X()>; }> fooCreators()
to avoid e.g. the baseId.withSuffix() <-> id.suffixAfter(base)
pingpong
- Remove the *Factories from the global object pool
- Do something about priority(). Falling back to plain
qmake in android+qmake setup is not helpful.
Change-Id: I2be7d88d554c5aa8b7db8edf5b93278e1ae0112a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-29 12:28:40 +01:00
|
|
|
if (parent->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) {
|
|
|
|
|
m_clean = true;
|
|
|
|
|
setExtraArguments(QStringList("clean"));
|
|
|
|
|
}
|
2013-04-25 16:02:17 +02:00
|
|
|
}
|
|
|
|
|
|
2019-01-10 15:31:44 +01:00
|
|
|
bool IosBuildStep::init()
|
2013-04-25 16:02:17 +02:00
|
|
|
{
|
|
|
|
|
BuildConfiguration *bc = buildConfiguration();
|
2014-06-20 14:32:40 +02:00
|
|
|
if (!bc)
|
|
|
|
|
emit addTask(Task::buildConfigurationMissingTask());
|
2013-04-25 16:02:17 +02:00
|
|
|
|
2019-02-06 12:50:51 +01:00
|
|
|
ToolChain *tc = ToolChainKitAspect::toolChain(target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID);
|
2014-06-20 14:32:40 +02:00
|
|
|
if (!tc)
|
|
|
|
|
emit addTask(Task::compilerMissingTask());
|
|
|
|
|
|
|
|
|
|
if (!bc || !tc) {
|
|
|
|
|
emitFaultyConfigurationMessage();
|
2013-04-25 16:02:17 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
2014-06-20 14:32:40 +02:00
|
|
|
|
2013-04-25 16:02:17 +02:00
|
|
|
ProcessParameters *pp = processParameters();
|
|
|
|
|
pp->setMacroExpander(bc->macroExpander());
|
2019-05-15 13:59:43 +02:00
|
|
|
pp->setWorkingDirectory(bc->buildDirectory());
|
2013-04-25 16:02:17 +02:00
|
|
|
Utils::Environment env = bc->environment();
|
2016-04-07 13:06:01 +02:00
|
|
|
Utils::Environment::setupEnglishOutput(&env);
|
2013-04-25 16:02:17 +02:00
|
|
|
pp->setEnvironment(env);
|
2019-06-21 08:31:37 +02:00
|
|
|
pp->setCommandLine({buildCommand(), allArguments()});
|
2013-04-25 16:02:17 +02:00
|
|
|
|
|
|
|
|
// 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(new GnuMakeParser());
|
|
|
|
|
IOutputParser *parser = target()->kit()->createOutputParser();
|
|
|
|
|
if (parser)
|
|
|
|
|
appendOutputParser(parser);
|
|
|
|
|
outputParser()->setWorkingDirectory(pp->effectiveWorkingDirectory());
|
|
|
|
|
|
2019-01-10 15:31:44 +01:00
|
|
|
return AbstractProcessStep::init();
|
2013-04-25 16:02:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QVariantMap IosBuildStep::toMap() const
|
|
|
|
|
{
|
|
|
|
|
QVariantMap map(AbstractProcessStep::toMap());
|
|
|
|
|
|
2017-06-12 14:23:06 +02:00
|
|
|
map.insert(BUILD_ARGUMENTS_KEY, m_baseBuildArguments);
|
|
|
|
|
map.insert(BUILD_USE_DEFAULT_ARGS_KEY, m_useDefaultArguments);
|
|
|
|
|
map.insert(CLEAN_KEY, m_clean);
|
2013-04-25 16:02:17 +02:00
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IosBuildStep::fromMap(const QVariantMap &map)
|
|
|
|
|
{
|
2017-06-12 14:23:06 +02:00
|
|
|
QVariant bArgs = map.value(BUILD_ARGUMENTS_KEY);
|
2013-04-25 16:02:17 +02:00
|
|
|
m_baseBuildArguments = bArgs.toStringList();
|
2017-06-12 14:23:06 +02:00
|
|
|
m_useDefaultArguments = map.value(BUILD_USE_DEFAULT_ARGS_KEY).toBool();
|
|
|
|
|
m_clean = map.value(CLEAN_KEY).toBool();
|
2013-04-25 16:02:17 +02:00
|
|
|
|
|
|
|
|
return BuildStep::fromMap(map);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList IosBuildStep::allArguments() const
|
|
|
|
|
{
|
|
|
|
|
return baseArguments() + m_extraArguments;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList IosBuildStep::defaultArguments() const
|
|
|
|
|
{
|
|
|
|
|
QStringList res;
|
|
|
|
|
Kit *kit = target()->kit();
|
2019-02-06 12:50:51 +01:00
|
|
|
ToolChain *tc = ToolChainKitAspect::toolChain(kit, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
|
2018-05-17 10:26:10 +02:00
|
|
|
switch (buildConfiguration()->buildType()) {
|
2013-04-25 16:02:17 +02:00
|
|
|
case BuildConfiguration::Debug :
|
2017-06-12 14:23:06 +02:00
|
|
|
res << "-configuration" << "Debug";
|
2013-04-25 16:02:17 +02:00
|
|
|
break;
|
|
|
|
|
case BuildConfiguration::Release :
|
2015-02-20 15:10:56 +01:00
|
|
|
case BuildConfiguration::Profile :
|
2017-06-12 14:23:06 +02:00
|
|
|
res << "-configuration" << "Release";
|
2013-04-25 16:02:17 +02:00
|
|
|
break;
|
|
|
|
|
case BuildConfiguration::Unknown :
|
|
|
|
|
break;
|
|
|
|
|
default:
|
2014-07-07 09:24:17 +02:00
|
|
|
qCWarning(iosLog) << "IosBuildStep had an unknown buildType "
|
2018-05-17 10:26:10 +02:00
|
|
|
<< buildConfiguration()->buildType();
|
2013-04-25 16:02:17 +02:00
|
|
|
}
|
2015-07-07 15:37:50 +02:00
|
|
|
if (tc->typeId() == ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID
|
|
|
|
|
|| tc->typeId() == ProjectExplorer::Constants::CLANG_TOOLCHAIN_TYPEID) {
|
2018-11-12 19:55:59 +01:00
|
|
|
auto gtc = static_cast<GccToolChain *>(tc);
|
2013-04-25 16:02:17 +02:00
|
|
|
res << gtc->platformCodeGenFlags();
|
|
|
|
|
}
|
2019-02-06 12:50:51 +01:00
|
|
|
if (!SysRootKitAspect::sysRoot(kit).isEmpty())
|
|
|
|
|
res << "-sdk" << SysRootKitAspect::sysRoot(kit).toString();
|
2018-05-17 10:26:10 +02:00
|
|
|
res << "SYMROOT=" + buildConfiguration()->buildDirectory().toString();
|
2013-04-25 16:02:17 +02:00
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-21 08:31:37 +02:00
|
|
|
FilePath IosBuildStep::buildCommand() const
|
2013-04-25 16:02:17 +02:00
|
|
|
{
|
2019-06-21 08:31:37 +02:00
|
|
|
return FilePath::fromString("xcodebuild"); // add path?
|
2013-04-25 16:02:17 +02:00
|
|
|
}
|
|
|
|
|
|
ProjectExplorer: Rework the build step run interface
Originally, the build manager used to run all build steps in a dedicated
thread. Communication between the step and the manager happened via a
QFutureInterface that was passed into the step's run() function.
Later, new steps were added that operated asynchronously, so the build
manager had to differentiate between the different kinds of steps for
starting and stopping.
These days, almost all build and deploy steps work asynchronously, which
made the QFuture-based interface look increasingly odd.
With this patch, all build steps are expected to work asynchronously, so
the build manager no longer needs to differentiate. Steps are started
and requested to stop via the run() and cancel() functions,
respectively, and emit the finished() signal when they are done. Build
step implementors no longer have to deal with a QFutureInterface. For
steps whose implementation is inherently synchronous, the BuildStep base
class offers a runInThread() function.
Change-Id: If905c68b234c5a669f6e19f43142eaa57d594803
Reviewed-by: hjk <hjk@qt.io>
2019-01-25 14:26:34 +01:00
|
|
|
void IosBuildStep::doRun()
|
2013-04-25 16:02:17 +02:00
|
|
|
{
|
ProjectExplorer: Rework the build step run interface
Originally, the build manager used to run all build steps in a dedicated
thread. Communication between the step and the manager happened via a
QFutureInterface that was passed into the step's run() function.
Later, new steps were added that operated asynchronously, so the build
manager had to differentiate between the different kinds of steps for
starting and stopping.
These days, almost all build and deploy steps work asynchronously, which
made the QFuture-based interface look increasingly odd.
With this patch, all build steps are expected to work asynchronously, so
the build manager no longer needs to differentiate. Steps are started
and requested to stop via the run() and cancel() functions,
respectively, and emit the finished() signal when they are done. Build
step implementors no longer have to deal with a QFutureInterface. For
steps whose implementation is inherently synchronous, the BuildStep base
class offers a runInThread() function.
Change-Id: If905c68b234c5a669f6e19f43142eaa57d594803
Reviewed-by: hjk <hjk@qt.io>
2019-01-25 14:26:34 +01:00
|
|
|
AbstractProcessStep::doRun();
|
2013-04-25 16:02:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BuildStepConfigWidget *IosBuildStep::createConfigWidget()
|
|
|
|
|
{
|
|
|
|
|
return new IosBuildStepConfigWidget(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IosBuildStep::setBaseArguments(const QStringList &args)
|
|
|
|
|
{
|
|
|
|
|
m_baseBuildArguments = args;
|
|
|
|
|
m_useDefaultArguments = (args == defaultArguments());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IosBuildStep::setExtraArguments(const QStringList &extraArgs)
|
|
|
|
|
{
|
|
|
|
|
m_extraArguments = extraArgs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList IosBuildStep::baseArguments() const
|
|
|
|
|
{
|
|
|
|
|
if (m_useDefaultArguments)
|
|
|
|
|
return defaultArguments();
|
|
|
|
|
return m_baseBuildArguments;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// IosBuildStepFactory
|
|
|
|
|
//
|
|
|
|
|
|
ProjectExplorer/all: Re-organize BuildSteps/{Deploy,Build}Config setup
This follow the rough pattern of recent *RunConfigurationFactory changes
for build and deploy configurations.
- Collapse the two lines of constructors similar to what
890c1906e6fb2ec did for RunConfigurations
* Deploy* was purely mechanical
* Build* ctors are split in connects() in the ctor body
to create "empty shell for clone" etc
and build step additions in initialize() functions which
are only used in the create() case.
-- Allows to collapse the shared 'ctor()' functions, too.
- Move FooBuildConfigurationFactory::create() implementations
to FooBuildConfiguration() constructor. That was a strange
and unneeded ping-pong between factories and objects, and
furthermore allows one level less of indirection (and for a
later, left out here, some reduction of the
FooBuildConfiguration interfaces that were only used to
accommodate the *Factory::create() functions.
- Most {Build,Deploy}Configuration{,Factory} classes had a canHandle(),
but there wasn't one in the base classses. Have one there.
- Most canHandle() functions were checking simple restrictions on
e.g. project or target types, specify those by setters in the
constructors instead and check them in the base canHandle()
- clone() is generally replaced by a creation of a "shell object"
and a fromMap(source->toMap()), implemented in the base, there
are two cases left for Android and Qbs that needed(?) some extra
polish
- generally use canHandle() in base implementation, instead
of doing that in all Derived::canFoo()
- as a result, canCreate/create/canClone/clone reimplementations
are not needed anymore, keep the base implementation for
now (could be inlined into their only users later), but
de-virtualize them.
- Combine Ios{Preset,DSym}BuildStepFactory. There was only one
'dsym' build step they could create.
- Split the 'mangled' id into the ProjectConfiguration subtype
specific constant identifier, and a QString extraId() bit.
Only maintain the mangled id in saved settings.
- Make ProjectConfiguration::m_id a constant member, adapt
all constructors of derived classe.
Not done in this patch:
- Finish possible cosmetic changes on top
- Add a way to specify restrictions to supported Qt versions
(used in Android/Ios), as the base implementation does not
depend on the qtsupport plugin
- Combine the QList<X> availableFoo() + createFoo(X) function
pairs to somthing like a direct
QList<struct { X; std::function<X()>; }> fooCreators()
to avoid e.g. the baseId.withSuffix() <-> id.suffixAfter(base)
pingpong
- Remove the *Factories from the global object pool
- Do something about priority(). Falling back to plain
qmake in android+qmake setup is not helpful.
Change-Id: I2be7d88d554c5aa8b7db8edf5b93278e1ae0112a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-29 12:28:40 +01:00
|
|
|
IosBuildStepFactory::IosBuildStepFactory()
|
2013-04-25 16:02:17 +02:00
|
|
|
{
|
ProjectExplorer/all: Re-organize BuildSteps/{Deploy,Build}Config setup
This follow the rough pattern of recent *RunConfigurationFactory changes
for build and deploy configurations.
- Collapse the two lines of constructors similar to what
890c1906e6fb2ec did for RunConfigurations
* Deploy* was purely mechanical
* Build* ctors are split in connects() in the ctor body
to create "empty shell for clone" etc
and build step additions in initialize() functions which
are only used in the create() case.
-- Allows to collapse the shared 'ctor()' functions, too.
- Move FooBuildConfigurationFactory::create() implementations
to FooBuildConfiguration() constructor. That was a strange
and unneeded ping-pong between factories and objects, and
furthermore allows one level less of indirection (and for a
later, left out here, some reduction of the
FooBuildConfiguration interfaces that were only used to
accommodate the *Factory::create() functions.
- Most {Build,Deploy}Configuration{,Factory} classes had a canHandle(),
but there wasn't one in the base classses. Have one there.
- Most canHandle() functions were checking simple restrictions on
e.g. project or target types, specify those by setters in the
constructors instead and check them in the base canHandle()
- clone() is generally replaced by a creation of a "shell object"
and a fromMap(source->toMap()), implemented in the base, there
are two cases left for Android and Qbs that needed(?) some extra
polish
- generally use canHandle() in base implementation, instead
of doing that in all Derived::canFoo()
- as a result, canCreate/create/canClone/clone reimplementations
are not needed anymore, keep the base implementation for
now (could be inlined into their only users later), but
de-virtualize them.
- Combine Ios{Preset,DSym}BuildStepFactory. There was only one
'dsym' build step they could create.
- Split the 'mangled' id into the ProjectConfiguration subtype
specific constant identifier, and a QString extraId() bit.
Only maintain the mangled id in saved settings.
- Make ProjectConfiguration::m_id a constant member, adapt
all constructors of derived classe.
Not done in this patch:
- Finish possible cosmetic changes on top
- Add a way to specify restrictions to supported Qt versions
(used in Android/Ios), as the base implementation does not
depend on the qtsupport plugin
- Combine the QList<X> availableFoo() + createFoo(X) function
pairs to somthing like a direct
QList<struct { X; std::function<X()>; }> fooCreators()
to avoid e.g. the baseId.withSuffix() <-> id.suffixAfter(base)
pingpong
- Remove the *Factories from the global object pool
- Do something about priority(). Falling back to plain
qmake in android+qmake setup is not helpful.
Change-Id: I2be7d88d554c5aa8b7db8edf5b93278e1ae0112a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-11-29 12:28:40 +01:00
|
|
|
registerStep<IosBuildStep>(IOS_BUILD_STEP_ID);
|
|
|
|
|
setSupportedDeviceTypes({Constants::IOS_DEVICE_TYPE,
|
|
|
|
|
Constants::IOS_SIMULATOR_TYPE});
|
|
|
|
|
setSupportedStepLists({ProjectExplorer::Constants::BUILDSTEPS_CLEAN,
|
|
|
|
|
ProjectExplorer::Constants::BUILDSTEPS_BUILD});
|
|
|
|
|
setDisplayName(QCoreApplication::translate("GenericProjectManager::Internal::IosBuildStep",
|
|
|
|
|
IOS_BUILD_STEP_DISPLAY_NAME));
|
2013-04-25 16:02:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Ios
|