2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2016-02-02 18:26:51 +01:00
|
|
|
#pragma once
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2009-09-21 15:50:27 +02:00
|
|
|
#include "projectexplorer_export.h"
|
2010-11-01 11:18:27 +01:00
|
|
|
#include "projectconfiguration.h"
|
2019-05-27 16:09:44 +02:00
|
|
|
#include "task.h"
|
2010-09-23 10:35:23 +02:00
|
|
|
|
|
|
|
|
#include <utils/environment.h>
|
2022-05-20 16:51:30 +02:00
|
|
|
#include <utils/filepath.h>
|
2009-09-21 15:50:27 +02:00
|
|
|
|
2020-02-18 14:44:58 +01:00
|
|
|
namespace Utils { class MacroExpander; }
|
|
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
namespace ProjectExplorer {
|
2009-06-12 13:55:08 +02:00
|
|
|
|
2019-10-21 14:47:17 +02:00
|
|
|
namespace Internal { class BuildConfigurationPrivate; }
|
|
|
|
|
|
2019-11-25 17:55:39 +01:00
|
|
|
class BuildDirectoryAspect;
|
2013-07-22 15:53:57 +02:00
|
|
|
class BuildInfo;
|
2019-10-25 09:55:32 +02:00
|
|
|
class BuildSystem;
|
2010-07-16 14:00:41 +02:00
|
|
|
class BuildStepList;
|
2012-09-03 18:31:44 +02:00
|
|
|
class Kit;
|
2019-04-26 14:27:50 +02:00
|
|
|
class NamedWidget;
|
|
|
|
|
class Node;
|
2019-12-04 17:23:02 +01:00
|
|
|
class RunConfiguration;
|
2010-02-08 15:50:06 +01:00
|
|
|
class Target;
|
2009-09-30 18:36:31 +02:00
|
|
|
|
2010-01-18 12:11:04 +01:00
|
|
|
class PROJECTEXPLORER_EXPORT BuildConfiguration : public ProjectConfiguration
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2009-09-21 15:50:27 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
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
|
|
|
protected:
|
2019-01-29 08:55:52 +01:00
|
|
|
friend class BuildConfigurationFactory;
|
2020-06-26 13:59:38 +02:00
|
|
|
explicit BuildConfiguration(Target *target, Utils::Id id);
|
2009-11-23 12:11:48 +01: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
|
|
|
public:
|
2019-12-09 12:59:38 +01:00
|
|
|
~BuildConfiguration() override;
|
2019-10-21 14:47:17 +02:00
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
Utils::FilePath buildDirectory() const;
|
|
|
|
|
Utils::FilePath rawBuildDirectory() const;
|
|
|
|
|
void setBuildDirectory(const Utils::FilePath &dir);
|
2009-11-25 18:50:20 +01:00
|
|
|
|
2019-10-25 09:55:32 +02:00
|
|
|
virtual BuildSystem *buildSystem() const;
|
|
|
|
|
|
2019-04-26 12:16:08 +02:00
|
|
|
virtual NamedWidget *createConfigWidget();
|
2012-11-08 18:02:50 +01:00
|
|
|
virtual QList<NamedWidget *> createSubConfigWidgets();
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2012-05-03 16:10:00 +02:00
|
|
|
// Maybe the BuildConfiguration is not the best place for the environment
|
2012-10-17 14:15:21 +02:00
|
|
|
Utils::Environment baseEnvironment() const;
|
2010-03-11 17:47:09 +01:00
|
|
|
QString baseEnvironmentText() const;
|
2010-09-23 10:35:23 +02:00
|
|
|
Utils::Environment environment() const;
|
2019-05-07 16:51:22 +02:00
|
|
|
void setUserEnvironmentChanges(const Utils::EnvironmentItems &diff);
|
|
|
|
|
Utils::EnvironmentItems userEnvironmentChanges() const;
|
2010-03-11 17:47:09 +01:00
|
|
|
bool useSystemEnvironment() const;
|
|
|
|
|
void setUseSystemEnvironment(bool b);
|
|
|
|
|
|
2015-01-27 18:46:40 +01:00
|
|
|
virtual void addToEnvironment(Utils::Environment &env) const;
|
|
|
|
|
|
2021-08-05 22:47:23 +02:00
|
|
|
bool parseStdOut() const;
|
|
|
|
|
void setParseStdOut(bool b);
|
2020-06-26 13:59:38 +02:00
|
|
|
const QList<Utils::Id> customParsers() const;
|
|
|
|
|
void setCustomParsers(const QList<Utils::Id> &parsers);
|
2020-05-06 12:51:08 +02:00
|
|
|
|
2019-12-05 16:19:42 +01:00
|
|
|
BuildStepList *buildSteps() const;
|
|
|
|
|
BuildStepList *cleanSteps() const;
|
2010-07-16 14:00:41 +02:00
|
|
|
|
2020-06-26 13:59:38 +02:00
|
|
|
void appendInitialBuildStep(Utils::Id id);
|
|
|
|
|
void appendInitialCleanStep(Utils::Id id);
|
2019-12-06 18:42:11 +01:00
|
|
|
|
2015-11-13 11:06:27 +01:00
|
|
|
bool fromMap(const QVariantMap &map) override;
|
|
|
|
|
QVariantMap toMap() const override;
|
2010-01-18 12:11:04 +01:00
|
|
|
|
2020-12-03 15:17:23 +01:00
|
|
|
bool isEnabled() const;
|
|
|
|
|
QString disabledReason() const;
|
2011-01-19 15:46:01 +01:00
|
|
|
|
2018-07-03 15:09:51 +02:00
|
|
|
virtual bool regenerateBuildFiles(Node *node);
|
|
|
|
|
|
2019-12-04 17:23:02 +01:00
|
|
|
virtual void restrictNextBuild(const RunConfiguration *rc);
|
|
|
|
|
|
2011-03-03 16:12:00 +01:00
|
|
|
enum BuildType {
|
|
|
|
|
Unknown,
|
|
|
|
|
Debug,
|
2015-02-20 15:10:56 +01:00
|
|
|
Profile,
|
2011-03-03 16:12:00 +01:00
|
|
|
Release
|
|
|
|
|
};
|
2019-10-21 14:47:17 +02:00
|
|
|
virtual BuildType buildType() const;
|
2019-08-02 18:06:29 +02:00
|
|
|
|
2015-10-22 16:45:52 +02:00
|
|
|
static QString buildTypeName(BuildType type);
|
|
|
|
|
|
2021-08-24 08:34:32 +02:00
|
|
|
static Utils::FilePath buildDirectoryFromTemplate(const Utils::FilePath &projectDir,
|
|
|
|
|
const Utils::FilePath &mainFilePath,
|
|
|
|
|
const QString &projectName,
|
|
|
|
|
const Kit *kit,
|
|
|
|
|
const QString &bcName,
|
2022-06-03 13:32:49 +02:00
|
|
|
BuildType buildType,
|
|
|
|
|
const QString &buildSystem);
|
2021-08-24 08:34:32 +02:00
|
|
|
|
2020-02-21 15:18:40 +01:00
|
|
|
bool isActive() const;
|
2016-05-02 16:04:45 +02:00
|
|
|
|
2018-07-03 11:22:37 +02:00
|
|
|
void updateCacheAndEmitEnvironmentChanged();
|
2017-10-17 12:27:37 +02:00
|
|
|
|
2019-11-25 17:55:39 +01:00
|
|
|
ProjectExplorer::BuildDirectoryAspect *buildDirectoryAspect() const;
|
2019-04-26 12:16:08 +02:00
|
|
|
void setConfigWidgetDisplayName(const QString &display);
|
2019-04-29 12:43:34 +02:00
|
|
|
void setBuildDirectoryHistoryCompleter(const QString &history);
|
2019-04-26 18:25:28 +02:00
|
|
|
void setConfigWidgetHasFrame(bool configWidgetHasFrame);
|
2019-04-26 19:26:50 +02:00
|
|
|
void setBuildDirectorySettingsKey(const QString &key);
|
2019-04-26 12:16:08 +02:00
|
|
|
|
2019-10-25 09:55:32 +02:00
|
|
|
void addConfigWidgets(const std::function<void (NamedWidget *)> &adder);
|
|
|
|
|
|
2019-12-09 12:59:38 +01:00
|
|
|
void doInitialize(const BuildInfo &info);
|
|
|
|
|
|
2020-02-18 14:44:58 +01:00
|
|
|
Utils::MacroExpander *macroExpander() const;
|
|
|
|
|
|
2020-03-19 16:45:20 +01:00
|
|
|
bool createBuildDirectory();
|
|
|
|
|
|
2009-11-25 18:50:20 +01:00
|
|
|
signals:
|
|
|
|
|
void environmentChanged();
|
2022-10-20 15:35:38 +02:00
|
|
|
void buildDirectoryInitialized();
|
2009-11-25 18:50:20 +01:00
|
|
|
void buildDirectoryChanged();
|
2011-01-19 15:46:01 +01:00
|
|
|
void enabledChanged();
|
2014-06-19 15:29:11 +02:00
|
|
|
void buildTypeChanged();
|
2009-11-25 18:50:20 +01:00
|
|
|
|
2009-11-23 12:11:48 +01:00
|
|
|
protected:
|
2019-12-06 17:32:07 +01:00
|
|
|
void setInitializer(const std::function<void(const BuildInfo &info)> &initializer);
|
2010-01-18 12:11:04 +01:00
|
|
|
|
2016-01-29 16:38:37 +02:00
|
|
|
private:
|
2013-08-16 17:45:16 +02:00
|
|
|
void emitBuildDirectoryChanged();
|
2019-10-21 14:47:17 +02:00
|
|
|
Internal::BuildConfigurationPrivate *d = nullptr;
|
2008-12-02 12:01:29 +01:00
|
|
|
};
|
2009-06-12 13:55:08 +02:00
|
|
|
|
2020-01-09 17:32:51 +01:00
|
|
|
class PROJECTEXPLORER_EXPORT BuildConfigurationFactory
|
2009-09-24 16:02:02 +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
|
|
|
protected:
|
2019-01-29 08:55:52 +01:00
|
|
|
BuildConfigurationFactory();
|
2020-01-09 17:32:51 +01:00
|
|
|
BuildConfigurationFactory(const BuildConfigurationFactory &) = delete;
|
|
|
|
|
BuildConfigurationFactory &operator=(const BuildConfigurationFactory &) = delete;
|
|
|
|
|
|
|
|
|
|
virtual ~BuildConfigurationFactory(); // Needed for dynamic_casts in importers.
|
2009-09-24 16:02:02 +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
|
|
|
public:
|
2013-07-22 15:53:57 +02:00
|
|
|
// List of build information that can be used to create a new build configuration via
|
|
|
|
|
// "Add Build Configuration" button.
|
2019-01-29 16:51:17 +01:00
|
|
|
const QList<BuildInfo> allAvailableBuilds(const Target *parent) const;
|
2013-08-13 10:52:57 +02:00
|
|
|
|
|
|
|
|
// List of build information that can be used to initially set up a new build configuration.
|
2019-06-26 17:09:35 +02:00
|
|
|
const QList<BuildInfo>
|
|
|
|
|
allAvailableSetups(const Kit *k, const Utils::FilePath &projectPath) const;
|
2013-08-13 10:52:57 +02:00
|
|
|
|
2019-01-29 16:51:17 +01:00
|
|
|
BuildConfiguration *create(Target *parent, const BuildInfo &info) const;
|
2009-09-24 16:02:02 +02:00
|
|
|
|
2018-03-12 10:11:10 +01:00
|
|
|
static BuildConfiguration *restore(Target *parent, const QVariantMap &map);
|
|
|
|
|
static BuildConfiguration *clone(Target *parent, const BuildConfiguration *source);
|
2009-09-30 16:54:33 +02:00
|
|
|
|
2019-06-26 17:09:35 +02:00
|
|
|
static BuildConfigurationFactory *find(const Kit *k, const Utils::FilePath &projectPath);
|
2019-01-29 08:55:52 +01:00
|
|
|
static BuildConfigurationFactory *find(Target *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
|
|
|
|
2019-05-27 16:09:44 +02:00
|
|
|
using IssueReporter = std::function<Tasks(Kit *, const QString &, const QString &)>;
|
2019-01-29 16:51:17 +01:00
|
|
|
void setIssueReporter(const IssueReporter &issueReporter);
|
2019-05-27 16:09:44 +02:00
|
|
|
const Tasks reportIssues(ProjectExplorer::Kit *kit,
|
|
|
|
|
const QString &projectPath, const QString &buildDir) const;
|
2019-01-29 16:51:17 +01: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
|
|
|
protected:
|
2020-01-09 15:06:30 +01:00
|
|
|
using BuildGenerator
|
|
|
|
|
= std::function<QList<BuildInfo>(const Kit *, const Utils::FilePath &, bool)>;
|
|
|
|
|
void setBuildGenerator(const BuildGenerator &buildGenerator);
|
2019-01-29 16:51:17 +01:00
|
|
|
|
2020-06-26 13:59:38 +02:00
|
|
|
bool supportsTargetDeviceType(Utils::Id id) const;
|
|
|
|
|
void setSupportedProjectType(Utils::Id id);
|
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
|
|
|
void setSupportedProjectMimeTypeName(const QString &mimeTypeName);
|
2020-06-26 13:59:38 +02:00
|
|
|
void addSupportedTargetDeviceType(Utils::Id id);
|
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
|
|
|
void setDefaultDisplayName(const QString &defaultDisplayName);
|
|
|
|
|
|
|
|
|
|
using BuildConfigurationCreator = std::function<BuildConfiguration *(Target *)>;
|
|
|
|
|
|
|
|
|
|
template <class BuildConfig>
|
2020-06-26 13:59:38 +02:00
|
|
|
void registerBuildConfiguration(Utils::Id buildConfigId)
|
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
|
|
|
{
|
2018-05-04 16:52:21 +02:00
|
|
|
m_creator = [buildConfigId](Target *t) { return new BuildConfig(t, buildConfigId); };
|
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
|
|
|
m_buildConfigId = buildConfigId;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
2018-03-12 10:11:10 +01:00
|
|
|
bool canHandle(const ProjectExplorer::Target *t) const;
|
|
|
|
|
|
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
|
|
|
BuildConfigurationCreator m_creator;
|
2020-06-26 13:59:38 +02:00
|
|
|
Utils::Id m_buildConfigId;
|
|
|
|
|
Utils::Id m_supportedProjectType;
|
|
|
|
|
QList<Utils::Id> m_supportedTargetDeviceTypes;
|
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
|
|
|
QString m_supportedProjectMimeTypeName;
|
2019-01-29 16:51:17 +01:00
|
|
|
IssueReporter m_issueReporter;
|
2020-01-09 15:06:30 +01:00
|
|
|
BuildGenerator m_buildGenerator;
|
2009-09-24 16:02:02 +02:00
|
|
|
};
|
|
|
|
|
|
2008-12-02 16:19:05 +01:00
|
|
|
} // namespace ProjectExplorer
|