forked from qt-creator/qt-creator
ProjectExplorer: Align signatures of BuildConfiguration
... availableBuilds() and availableSetups(). Goal is to merge them and inline all the local createBuildInfo() functions. Change-Id: I9f19093163808b6da6dc83977894420e08a1edd9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -97,9 +97,9 @@ AutotoolsBuildConfigurationFactory::AutotoolsBuildConfigurationFactory()
|
||||
setSupportedProjectMimeTypeName(Constants::MAKEFILE_MIMETYPE);
|
||||
}
|
||||
|
||||
QList<BuildInfo> AutotoolsBuildConfigurationFactory::availableBuilds(const Target *parent) const
|
||||
QList<BuildInfo> AutotoolsBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath) const
|
||||
{
|
||||
return {createBuildInfo(parent->kit(), parent->project()->projectDirectory())};
|
||||
return {createBuildInfo(k, projectPath)};
|
||||
}
|
||||
|
||||
QList<BuildInfo> AutotoolsBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
|
||||
|
@@ -53,7 +53,8 @@ public:
|
||||
AutotoolsBuildConfigurationFactory();
|
||||
|
||||
private:
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
||||
const Utils::FilePath &projectPath) const override;
|
||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
||||
const Utils::FilePath &projectPath) const override;
|
||||
|
||||
|
@@ -481,13 +481,14 @@ BuildConfiguration::BuildType CMakeBuildConfigurationFactory::cmakeBuildTypeToBu
|
||||
return BuildConfiguration::Unknown;
|
||||
}
|
||||
|
||||
QList<BuildInfo> CMakeBuildConfigurationFactory::availableBuilds(const Target *parent) const
|
||||
QList<BuildInfo>
|
||||
CMakeBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath) const
|
||||
{
|
||||
QList<BuildInfo> result;
|
||||
|
||||
for (int type = BuildTypeNone; type != BuildTypeLast; ++type) {
|
||||
result << createBuildInfo(parent->kit(),
|
||||
parent->project()->projectDirectory().toString(),
|
||||
result << createBuildInfo(k,
|
||||
projectPath.toString(),
|
||||
BuildType(type));
|
||||
}
|
||||
return result;
|
||||
|
@@ -134,7 +134,8 @@ public:
|
||||
static BuildType buildTypeFromByteArray(const QByteArray &in);
|
||||
static ProjectExplorer::BuildConfiguration::BuildType cmakeBuildTypeToBuildType(const BuildType &in);
|
||||
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
||||
const Utils::FilePath &projectPath) const override;
|
||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
||||
const Utils::FilePath &projectPath) const override;
|
||||
|
||||
|
@@ -541,13 +541,12 @@ static QList<ProjectExplorer::BuildInfo> defaultBuildInfos(
|
||||
return buildInfos;
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::BuildInfo> CompilationDatabaseBuildConfigurationFactory::availableBuilds(
|
||||
const ProjectExplorer::Target * /*parent*/) const
|
||||
QList<BuildInfo> CompilationDatabaseBuildConfigurationFactory::availableBuilds(const Kit *, const Utils::FilePath &) const
|
||||
{
|
||||
return defaultBuildInfos(this, tr("Release"));
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::BuildInfo> CompilationDatabaseBuildConfigurationFactory::availableSetups(const ProjectExplorer::Kit * /*k*/, const Utils::FilePath & /*projectPath*/) const
|
||||
QList<BuildInfo> CompilationDatabaseBuildConfigurationFactory::availableSetups(const Kit *, const Utils::FilePath &) const
|
||||
{
|
||||
return defaultBuildInfos(this, tr("Release"));
|
||||
}
|
||||
|
@@ -105,7 +105,7 @@ public:
|
||||
CompilationDatabaseBuildConfigurationFactory();
|
||||
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(
|
||||
const ProjectExplorer::Target *parent) const override;
|
||||
const ProjectExplorer::Kit *k, const Utils::FilePath &projectPath) const override;
|
||||
QList<ProjectExplorer::BuildInfo> availableSetups(
|
||||
const ProjectExplorer::Kit *k, const Utils::FilePath &projectPath) const override;
|
||||
};
|
||||
|
@@ -87,9 +87,10 @@ GenericBuildConfigurationFactory::GenericBuildConfigurationFactory()
|
||||
|
||||
GenericBuildConfigurationFactory::~GenericBuildConfigurationFactory() = default;
|
||||
|
||||
QList<BuildInfo> GenericBuildConfigurationFactory::availableBuilds(const Target *parent) const
|
||||
QList<BuildInfo>
|
||||
GenericBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath) const
|
||||
{
|
||||
return {createBuildInfo(parent->kit(), parent->project()->projectDirectory())};
|
||||
return {createBuildInfo(k, projectPath)};
|
||||
}
|
||||
|
||||
QList<BuildInfo>
|
||||
|
@@ -53,7 +53,8 @@ public:
|
||||
~GenericBuildConfigurationFactory() override;
|
||||
|
||||
private:
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
||||
const Utils::FilePath &projectPath) const override;
|
||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
||||
const Utils::FilePath &projectPath) const override;
|
||||
|
||||
|
@@ -155,11 +155,11 @@ NimBuildConfigurationFactory::NimBuildConfigurationFactory()
|
||||
setSupportedProjectMimeTypeName(Constants::C_NIM_PROJECT_MIMETYPE);
|
||||
}
|
||||
|
||||
QList<BuildInfo> NimBuildConfigurationFactory::availableBuilds(const Target *parent) const
|
||||
QList<BuildInfo> NimBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &) const
|
||||
{
|
||||
QList<BuildInfo> result;
|
||||
for (auto buildType : {BuildConfiguration::Debug, BuildConfiguration::Release})
|
||||
result.push_back(createBuildInfo(parent->kit(), buildType));
|
||||
result.push_back(createBuildInfo(k, buildType));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -63,7 +63,8 @@ public:
|
||||
NimBuildConfigurationFactory();
|
||||
|
||||
private:
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
||||
const Utils::FilePath &projectPath) const override;
|
||||
|
||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
||||
const Utils::FilePath &projectPath) const override;
|
||||
|
@@ -416,7 +416,7 @@ const Tasks BuildConfigurationFactory::reportIssues(ProjectExplorer::Kit *kit, c
|
||||
|
||||
const QList<BuildInfo> BuildConfigurationFactory::allAvailableBuilds(const Target *parent) const
|
||||
{
|
||||
return availableBuilds(parent);
|
||||
return availableBuilds(parent->kit(), parent->project()->projectFilePath());
|
||||
}
|
||||
|
||||
const QList<BuildInfo>
|
||||
|
@@ -157,7 +157,8 @@ public:
|
||||
const QString &projectPath, const QString &buildDir) const;
|
||||
|
||||
protected:
|
||||
virtual QList<BuildInfo> availableBuilds(const Target *parent) const = 0;
|
||||
virtual QList<BuildInfo>
|
||||
availableBuilds(const Kit *k, const Utils::FilePath &projectPath) const = 0;
|
||||
virtual QList<BuildInfo>
|
||||
availableSetups(const Kit *k, const Utils::FilePath &projectPath) const = 0;
|
||||
|
||||
|
@@ -382,9 +382,10 @@ BuildInfo QbsBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||
return info;
|
||||
}
|
||||
|
||||
QList<BuildInfo> QbsBuildConfigurationFactory::availableBuilds(const Target *parent) const
|
||||
QList<BuildInfo>
|
||||
QbsBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &) const
|
||||
{
|
||||
return {createBuildInfo(parent->kit(), BuildConfiguration::Debug)};
|
||||
return {createBuildInfo(k, BuildConfiguration::Debug)};
|
||||
}
|
||||
|
||||
QList<BuildInfo>
|
||||
|
@@ -92,7 +92,8 @@ class QbsBuildConfigurationFactory : public ProjectExplorer::BuildConfigurationF
|
||||
public:
|
||||
QbsBuildConfigurationFactory();
|
||||
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
||||
const Utils::FilePath &projectPath) const override;
|
||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
||||
const Utils::FilePath &projectPath) const override;
|
||||
|
||||
|
@@ -665,15 +665,12 @@ static const QList<BuildConfiguration::BuildType> availableBuildTypes(const Base
|
||||
return types;
|
||||
}
|
||||
|
||||
QList<BuildInfo> QmakeBuildConfigurationFactory::availableBuilds(const Target *parent) const
|
||||
QList<BuildInfo> QmakeBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath) const
|
||||
{
|
||||
QList<BuildInfo> result;
|
||||
|
||||
const FilePath projectFilePath = parent->project()->projectFilePath();
|
||||
|
||||
for (BuildConfiguration::BuildType buildType :
|
||||
availableBuildTypes(QtKitAspect::qtVersion(parent->kit()))) {
|
||||
BuildInfo info = createBuildInfo(parent->kit(), projectFilePath, buildType);
|
||||
for (BuildConfiguration::BuildType buildType : availableBuildTypes(QtKitAspect::qtVersion(k))) {
|
||||
BuildInfo info = createBuildInfo(k, projectPath, buildType);
|
||||
info.displayName.clear(); // ask for a name
|
||||
info.buildDirectory.clear(); // This depends on the displayName
|
||||
result << info;
|
||||
|
@@ -149,7 +149,8 @@ class QMAKEPROJECTMANAGER_EXPORT QmakeBuildConfigurationFactory : public Project
|
||||
public:
|
||||
QmakeBuildConfigurationFactory();
|
||||
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
||||
const Utils::FilePath &projectPath) const override;
|
||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
||||
const Utils::FilePath &projectPath) const override;
|
||||
private:
|
||||
|
@@ -71,7 +71,8 @@ public:
|
||||
class DummyBuildConfigurationFactory : public ProjectExplorer::BuildConfigurationFactory
|
||||
{
|
||||
public:
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *) const final
|
||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *,
|
||||
const FilePath &) const final
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
Reference in New Issue
Block a user