34
34
#include "projectconfiguration.h"
36
36
#include <utils/environment.h>
37
#include <utils/fileutils.h>
39
class AbstractMacroExpander;
39
namespace Utils { class AbstractMacroExpander; }
42
41
namespace ProjectExplorer {
44
43
class BuildConfiguration;
46
46
class BuildStepList;
56
56
// ctors are protected
57
57
virtual ~BuildConfiguration();
59
virtual QString buildDirectory() const = 0;
59
Utils::FileName buildDirectory() const;
60
Utils::FileName rawBuildDirectory() const;
61
62
virtual ProjectExplorer::NamedWidget *createConfigWidget() = 0;
62
63
virtual QList<NamedWidget *> createSubConfigWidgets();
99
100
BuildConfiguration(Target *target, const Core::Id id);
100
101
BuildConfiguration(Target *target, BuildConfiguration *source);
103
virtual void setBuildDirectory(const Utils::FileName &dir);
102
104
void cloneSteps(BuildConfiguration *source);
105
107
void handleKitUpdate();
108
void emitBuildDirectoryChanged();
108
111
void emitEnvironmentChanged();
111
114
QList<Utils::EnvironmentItem> m_userEnvironmentChanges;
112
115
QList<BuildStepList *> m_stepLists;
113
116
Utils::AbstractMacroExpander *m_macroExpander;
117
Utils::FileName m_buildDirectory;
118
Utils::FileName m_lastEmmitedBuildDirectory;
114
119
mutable Utils::Environment m_cachedEnvironment;
123
128
explicit IBuildConfigurationFactory(QObject *parent = 0);
124
129
virtual ~IBuildConfigurationFactory();
126
// used to show the list of possible additons to a target, returns a list of types
127
virtual QList<Core::Id> availableCreationIds(const Target *parent) const = 0;
128
// used to translate the types to names to display to the user
129
virtual QString displayNameForId(const Core::Id id) const = 0;
131
virtual bool canCreate(const Target *parent, const Core::Id id) const = 0;
132
virtual BuildConfiguration *create(Target *parent, const Core::Id id, const QString &name = QString()) = 0;
131
// The priority is negative if this factory can not create anything for the target.
132
// It is 0 for the "default" factory that wants to handle the target.
133
// Add 100 for each specialization.
134
virtual int priority(const Target *parent) const = 0;
135
// List of build information that can be used to create a new build configuration via
136
// "Add Build Configuration" button.
137
virtual QList<BuildInfo *> availableBuilds(const Target *parent) const = 0;
139
virtual int priority(const Kit *k, const QString &projectPath) const = 0;
140
// List of build information that can be used to initially set up a new build configuration.
141
virtual QList<BuildInfo *> availableSetups(const Kit *k, const QString &projectPath) const = 0;
143
virtual BuildConfiguration *create(Target *parent, const BuildInfo *info) const = 0;
133
145
// used to recreate the runConfigurations when restoring settings
134
146
virtual bool canRestore(const Target *parent, const QVariantMap &map) const = 0;
135
147
virtual BuildConfiguration *restore(Target *parent, const QVariantMap &map) = 0;
137
149
virtual BuildConfiguration *clone(Target *parent, BuildConfiguration *product) = 0;
139
151
static IBuildConfigurationFactory *find(Target *parent, const QVariantMap &map);
152
static IBuildConfigurationFactory *find(Kit *k, const QString &projectPath);
140
153
static IBuildConfigurationFactory *find(Target *parent);
141
154
static IBuildConfigurationFactory *find(Target *parent, BuildConfiguration *bc);