forked from qt-creator/qt-creator
ProjectExplorer: Merge BuildConfigurationFactory::availableBuilds
... and availableSetups as far as mechanically possible. Change-Id: Ia1d7babe943eea25da97cef7838187c234378673 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -97,28 +97,18 @@ AutotoolsBuildConfigurationFactory::AutotoolsBuildConfigurationFactory()
|
|||||||
setSupportedProjectMimeTypeName(Constants::MAKEFILE_MIMETYPE);
|
setSupportedProjectMimeTypeName(Constants::MAKEFILE_MIMETYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<BuildInfo> AutotoolsBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath) const
|
QList<BuildInfo> AutotoolsBuildConfigurationFactory::availableBuilds
|
||||||
{
|
(const Kit *k, const FilePath &projectPath, bool forSetup) const
|
||||||
return {createBuildInfo(k, projectPath)};
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<BuildInfo> AutotoolsBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
|
|
||||||
{
|
|
||||||
const QString path = projectPath.toFileInfo().absolutePath();
|
|
||||||
BuildInfo info = createBuildInfo(k, Utils::FilePath::fromString(path));
|
|
||||||
//: The name of the build configuration created by default for a autotools project.
|
|
||||||
info.displayName = tr("Default");
|
|
||||||
return {info};
|
|
||||||
}
|
|
||||||
|
|
||||||
BuildInfo AutotoolsBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
|
||||||
const Utils::FilePath &buildDir) const
|
|
||||||
{
|
{
|
||||||
BuildInfo info(this);
|
BuildInfo info(this);
|
||||||
info.typeName = tr("Build");
|
info.typeName = tr("Build");
|
||||||
info.buildDirectory = buildDir;
|
info.buildDirectory = forSetup ? FilePath::fromString(projectPath.toFileInfo().absolutePath()) : projectPath;
|
||||||
info.kitId = k->id();
|
info.kitId = k->id();
|
||||||
return info;
|
if (forSetup) {
|
||||||
|
//: The name of the build configuration created by default for a autotools project.
|
||||||
|
info.displayName = tr("Default");
|
||||||
|
}
|
||||||
|
return {info};
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildConfiguration::BuildType AutotoolsBuildConfiguration::buildType() const
|
BuildConfiguration::BuildType AutotoolsBuildConfiguration::buildType() const
|
||||||
|
@@ -29,8 +29,6 @@
|
|||||||
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
|
|
||||||
namespace Utils { class FilePath; }
|
|
||||||
|
|
||||||
namespace AutotoolsProjectManager {
|
namespace AutotoolsProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -54,11 +52,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
||||||
const Utils::FilePath &projectPath) const override;
|
const Utils::FilePath &projectPath,
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
bool forSetup) const override;
|
||||||
const Utils::FilePath &projectPath) const override;
|
|
||||||
|
|
||||||
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const Utils::FilePath &buildDir) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -481,31 +481,21 @@ BuildConfiguration::BuildType CMakeBuildConfigurationFactory::cmakeBuildTypeToBu
|
|||||||
return BuildConfiguration::Unknown;
|
return BuildConfiguration::Unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<BuildInfo>
|
QList<BuildInfo> CMakeBuildConfigurationFactory::availableBuilds
|
||||||
CMakeBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath) const
|
(const Kit *k, const FilePath &projectPath, bool forSetup) const
|
||||||
{
|
{
|
||||||
QList<BuildInfo> result;
|
QList<BuildInfo> result;
|
||||||
|
|
||||||
|
FilePath path = forSetup ? Project::projectDirectory(projectPath) : projectPath;
|
||||||
|
|
||||||
for (int type = BuildTypeNone; type != BuildTypeLast; ++type) {
|
for (int type = BuildTypeNone; type != BuildTypeLast; ++type) {
|
||||||
result << createBuildInfo(k,
|
BuildInfo info = createBuildInfo(k, path.toString(), BuildType(type));
|
||||||
projectPath.toString(),
|
if (forSetup) {
|
||||||
BuildType(type));
|
info.displayName = info.typeName;
|
||||||
}
|
info.buildDirectory
|
||||||
return result;
|
= CMakeBuildConfiguration::shadowBuildDirectory(projectPath, k,
|
||||||
}
|
info.displayName, info.buildType);
|
||||||
|
}
|
||||||
QList<BuildInfo>
|
|
||||||
CMakeBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
|
|
||||||
{
|
|
||||||
QList<BuildInfo> result;
|
|
||||||
for (int type = BuildTypeDebug; type != BuildTypeLast; ++type) {
|
|
||||||
BuildInfo info = createBuildInfo(k,
|
|
||||||
ProjectExplorer::Project::projectDirectory(projectPath).toString(),
|
|
||||||
BuildType(type));
|
|
||||||
info.displayName = info.typeName;
|
|
||||||
info.buildDirectory
|
|
||||||
= CMakeBuildConfiguration::shadowBuildDirectory(projectPath, k,
|
|
||||||
info.displayName, info.buildType);
|
|
||||||
result << info;
|
result << info;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@@ -135,9 +135,8 @@ public:
|
|||||||
static ProjectExplorer::BuildConfiguration::BuildType cmakeBuildTypeToBuildType(const BuildType &in);
|
static ProjectExplorer::BuildConfiguration::BuildType cmakeBuildTypeToBuildType(const BuildType &in);
|
||||||
|
|
||||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
||||||
const Utils::FilePath &projectPath) const override;
|
const Utils::FilePath &projectPath,
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
bool forSetup) const override;
|
||||||
const Utils::FilePath &projectPath) const override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k,
|
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k,
|
||||||
|
@@ -59,6 +59,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
namespace CompilationDatabaseProjectManager {
|
namespace CompilationDatabaseProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -529,26 +530,15 @@ CompilationDatabaseBuildConfigurationFactory::CompilationDatabaseBuildConfigurat
|
|||||||
setSupportedProjectMimeTypeName(Constants::COMPILATIONDATABASEMIMETYPE);
|
setSupportedProjectMimeTypeName(Constants::COMPILATIONDATABASEMIMETYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QList<ProjectExplorer::BuildInfo> defaultBuildInfos(
|
QList<BuildInfo> CompilationDatabaseBuildConfigurationFactory::availableBuilds
|
||||||
const ProjectExplorer::BuildConfigurationFactory *factory, const QString &name)
|
(const Kit *, const FilePath &, bool) const
|
||||||
{
|
{
|
||||||
ProjectExplorer::BuildInfo info(factory);
|
const QString name = tr("Release");
|
||||||
|
ProjectExplorer::BuildInfo info(this);
|
||||||
info.typeName = name;
|
info.typeName = name;
|
||||||
info.displayName = name;
|
info.displayName = name;
|
||||||
info.buildType = BuildConfiguration::Release;
|
info.buildType = BuildConfiguration::Release;
|
||||||
QList<ProjectExplorer::BuildInfo> buildInfos;
|
return {info};
|
||||||
buildInfos << info;
|
|
||||||
return buildInfos;
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<BuildInfo> CompilationDatabaseBuildConfigurationFactory::availableBuilds(const Kit *, const Utils::FilePath &) const
|
|
||||||
{
|
|
||||||
return defaultBuildInfos(this, tr("Release"));
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<BuildInfo> CompilationDatabaseBuildConfigurationFactory::availableSetups(const Kit *, const Utils::FilePath &) const
|
|
||||||
{
|
|
||||||
return defaultBuildInfos(this, tr("Release"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -104,10 +104,9 @@ class CompilationDatabaseBuildConfigurationFactory
|
|||||||
public:
|
public:
|
||||||
CompilationDatabaseBuildConfigurationFactory();
|
CompilationDatabaseBuildConfigurationFactory();
|
||||||
|
|
||||||
QList<ProjectExplorer::BuildInfo> availableBuilds(
|
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
||||||
const ProjectExplorer::Kit *k, const Utils::FilePath &projectPath) const override;
|
const Utils::FilePath &projectPath,
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(
|
bool forSetup) const override;
|
||||||
const ProjectExplorer::Kit *k, const Utils::FilePath &projectPath) const override;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -85,31 +85,20 @@ GenericBuildConfigurationFactory::GenericBuildConfigurationFactory()
|
|||||||
setSupportedProjectMimeTypeName(Constants::GENERICMIMETYPE);
|
setSupportedProjectMimeTypeName(Constants::GENERICMIMETYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
GenericBuildConfigurationFactory::~GenericBuildConfigurationFactory() = default;
|
QList<BuildInfo> GenericBuildConfigurationFactory::availableBuilds
|
||||||
|
(const Kit *k, const FilePath &projectPath, bool forSetup) const
|
||||||
QList<BuildInfo>
|
|
||||||
GenericBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath) const
|
|
||||||
{
|
|
||||||
return {createBuildInfo(k, projectPath)};
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<BuildInfo>
|
|
||||||
GenericBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
|
|
||||||
{
|
|
||||||
BuildInfo info = createBuildInfo(k, Project::projectDirectory(projectPath));
|
|
||||||
//: The name of the build configuration created by default for a generic project.
|
|
||||||
info.displayName = tr("Default");
|
|
||||||
return {info};
|
|
||||||
}
|
|
||||||
|
|
||||||
BuildInfo
|
|
||||||
GenericBuildConfigurationFactory::createBuildInfo(const Kit *k, const FilePath &buildDir) const
|
|
||||||
{
|
{
|
||||||
BuildInfo info(this);
|
BuildInfo info(this);
|
||||||
info.typeName = tr("Build");
|
info.typeName = tr("Build");
|
||||||
info.buildDirectory = buildDir;
|
info.buildDirectory = forSetup ? Project::projectDirectory(projectPath) : projectPath;
|
||||||
info.kitId = k->id();
|
info.kitId = k->id();
|
||||||
return info;
|
|
||||||
|
if (forSetup) {
|
||||||
|
//: The name of the build configuration created by default for a generic project.
|
||||||
|
info.displayName = tr("Default");
|
||||||
|
}
|
||||||
|
|
||||||
|
return {info};
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildConfiguration::BuildType GenericBuildConfiguration::buildType() const
|
BuildConfiguration::BuildType GenericBuildConfiguration::buildType() const
|
||||||
|
@@ -50,15 +50,11 @@ class GenericBuildConfigurationFactory : public ProjectExplorer::BuildConfigurat
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
GenericBuildConfigurationFactory();
|
GenericBuildConfigurationFactory();
|
||||||
~GenericBuildConfigurationFactory() override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
||||||
const Utils::FilePath &projectPath) const override;
|
const Utils::FilePath &projectPath,
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
bool forSetup) const override;
|
||||||
const Utils::FilePath &projectPath) const override;
|
|
||||||
|
|
||||||
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const Utils::FilePath &buildDir) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -155,48 +155,30 @@ NimBuildConfigurationFactory::NimBuildConfigurationFactory()
|
|||||||
setSupportedProjectMimeTypeName(Constants::C_NIM_PROJECT_MIMETYPE);
|
setSupportedProjectMimeTypeName(Constants::C_NIM_PROJECT_MIMETYPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<BuildInfo> NimBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &) const
|
QList<BuildInfo> NimBuildConfigurationFactory::availableBuilds
|
||||||
{
|
(const Kit *k, const FilePath &projectPath, bool forSetup) const
|
||||||
QList<BuildInfo> result;
|
|
||||||
for (auto buildType : {BuildConfiguration::Debug, BuildConfiguration::Release})
|
|
||||||
result.push_back(createBuildInfo(k, buildType));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<BuildInfo> NimBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
|
|
||||||
{
|
{
|
||||||
QList<BuildInfo> result;
|
QList<BuildInfo> result;
|
||||||
for (auto buildType : {BuildConfiguration::Debug, BuildConfiguration::Release}) {
|
for (auto buildType : {BuildConfiguration::Debug, BuildConfiguration::Release}) {
|
||||||
BuildInfo info = createBuildInfo(k, buildType);
|
BuildInfo info(this);
|
||||||
info.displayName = info.typeName;
|
info.buildType = buildType;
|
||||||
info.buildDirectory = defaultBuildDirectory(k, projectPath, info.typeName, buildType);
|
info.kitId = k->id();
|
||||||
|
|
||||||
|
if (buildType == BuildConfiguration::Debug)
|
||||||
|
info.typeName = tr("Debug");
|
||||||
|
else if (buildType == BuildConfiguration::Profile)
|
||||||
|
info.typeName = tr("Profile");
|
||||||
|
else if (buildType == BuildConfiguration::Release)
|
||||||
|
info.typeName = tr("Release");
|
||||||
|
|
||||||
|
if (forSetup) {
|
||||||
|
info.displayName = info.typeName;
|
||||||
|
info.buildDirectory = defaultBuildDirectory(k, projectPath, info.typeName, buildType);
|
||||||
|
}
|
||||||
result.push_back(info);
|
result.push_back(info);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildInfo NimBuildConfigurationFactory::createBuildInfo(const Kit *k, BuildConfiguration::BuildType buildType) const
|
|
||||||
{
|
|
||||||
BuildInfo info(this);
|
|
||||||
info.buildType = buildType;
|
|
||||||
info.kitId = k->id();
|
|
||||||
info.typeName = displayName(buildType);
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString NimBuildConfigurationFactory::displayName(BuildConfiguration::BuildType buildType) const
|
|
||||||
{
|
|
||||||
switch (buildType) {
|
|
||||||
case ProjectExplorer::BuildConfiguration::Debug:
|
|
||||||
return tr("Debug");
|
|
||||||
case ProjectExplorer::BuildConfiguration::Profile:
|
|
||||||
return tr("Profile");
|
|
||||||
case ProjectExplorer::BuildConfiguration::Release:
|
|
||||||
return tr("Release");
|
|
||||||
default:
|
|
||||||
return QString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Nim
|
} // namespace Nim
|
||||||
|
|
||||||
|
@@ -64,15 +64,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
||||||
const Utils::FilePath &projectPath) const override;
|
const Utils::FilePath &projectPath,
|
||||||
|
bool forSetup) const override;
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
|
||||||
const Utils::FilePath &projectPath) const override;
|
|
||||||
|
|
||||||
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k,
|
|
||||||
ProjectExplorer::BuildConfiguration::BuildType buildType) const;
|
|
||||||
|
|
||||||
QString displayName(ProjectExplorer::BuildConfiguration::BuildType buildType) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -416,13 +416,13 @@ const Tasks BuildConfigurationFactory::reportIssues(ProjectExplorer::Kit *kit, c
|
|||||||
|
|
||||||
const QList<BuildInfo> BuildConfigurationFactory::allAvailableBuilds(const Target *parent) const
|
const QList<BuildInfo> BuildConfigurationFactory::allAvailableBuilds(const Target *parent) const
|
||||||
{
|
{
|
||||||
return availableBuilds(parent->kit(), parent->project()->projectFilePath());
|
return availableBuilds(parent->kit(), parent->project()->projectFilePath(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QList<BuildInfo>
|
const QList<BuildInfo>
|
||||||
BuildConfigurationFactory::allAvailableSetups(const Kit *k, const FilePath &projectPath) const
|
BuildConfigurationFactory::allAvailableSetups(const Kit *k, const FilePath &projectPath) const
|
||||||
{
|
{
|
||||||
return availableSetups(k, projectPath);
|
return availableBuilds(k, projectPath, /* forSetup = */ true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BuildConfigurationFactory::supportsTargetDeviceType(Core::Id id) const
|
bool BuildConfigurationFactory::supportsTargetDeviceType(Core::Id id) const
|
||||||
|
@@ -158,9 +158,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QList<BuildInfo>
|
virtual QList<BuildInfo>
|
||||||
availableBuilds(const Kit *k, const Utils::FilePath &projectPath) const = 0;
|
availableBuilds(const Kit *k, const Utils::FilePath &projectPath, bool forSetup) const = 0;
|
||||||
virtual QList<BuildInfo>
|
|
||||||
availableSetups(const Kit *k, const Utils::FilePath &projectPath) const = 0;
|
|
||||||
|
|
||||||
bool supportsTargetDeviceType(Core::Id id) const;
|
bool supportsTargetDeviceType(Core::Id id) const;
|
||||||
void setSupportedProjectType(Core::Id id);
|
void setSupportedProjectType(Core::Id id);
|
||||||
|
@@ -369,6 +369,39 @@ QbsBuildConfigurationFactory::QbsBuildConfigurationFactory()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<BuildInfo> QbsBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath, bool forSetup) const
|
||||||
|
{
|
||||||
|
QList<BuildInfo> result;
|
||||||
|
|
||||||
|
if (forSetup) {
|
||||||
|
|
||||||
|
BuildInfo info = createBuildInfo(k, BuildConfiguration::Debug);
|
||||||
|
//: The name of the debug build configuration created by default for a qbs project.
|
||||||
|
info.displayName = tr("Debug");
|
||||||
|
//: Non-ASCII characters in directory suffix may cause build issues.
|
||||||
|
info.buildDirectory
|
||||||
|
= defaultBuildDirectory(projectPath, k, tr("Debug", "Shadow build directory suffix"),
|
||||||
|
info.buildType);
|
||||||
|
result << info;
|
||||||
|
|
||||||
|
info = createBuildInfo(k, BuildConfiguration::Release);
|
||||||
|
//: The name of the release build configuration created by default for a qbs project.
|
||||||
|
info.displayName = tr("Release");
|
||||||
|
//: Non-ASCII characters in directory suffix may cause build issues.
|
||||||
|
info.buildDirectory
|
||||||
|
= defaultBuildDirectory(projectPath, k, tr("Release", "Shadow build directory suffix"),
|
||||||
|
info.buildType);
|
||||||
|
result << info;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
result << createBuildInfo(k, BuildConfiguration::Debug);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
BuildInfo QbsBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
BuildInfo QbsBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||||
BuildConfiguration::BuildType type) const
|
BuildConfiguration::BuildType type) const
|
||||||
{
|
{
|
||||||
@@ -382,37 +415,5 @@ BuildInfo QbsBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<BuildInfo>
|
|
||||||
QbsBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &) const
|
|
||||||
{
|
|
||||||
return {createBuildInfo(k, BuildConfiguration::Debug)};
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<BuildInfo>
|
|
||||||
QbsBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
|
|
||||||
{
|
|
||||||
QList<BuildInfo> result;
|
|
||||||
|
|
||||||
BuildInfo info = createBuildInfo(k, BuildConfiguration::Debug);
|
|
||||||
//: The name of the debug build configuration created by default for a qbs project.
|
|
||||||
info.displayName = tr("Debug");
|
|
||||||
//: Non-ASCII characters in directory suffix may cause build issues.
|
|
||||||
info.buildDirectory
|
|
||||||
= defaultBuildDirectory(projectPath, k, tr("Debug", "Shadow build directory suffix"),
|
|
||||||
info.buildType);
|
|
||||||
result << info;
|
|
||||||
|
|
||||||
info = createBuildInfo(k, BuildConfiguration::Release);
|
|
||||||
//: The name of the release build configuration created by default for a qbs project.
|
|
||||||
info.displayName = tr("Release");
|
|
||||||
//: Non-ASCII characters in directory suffix may cause build issues.
|
|
||||||
info.buildDirectory
|
|
||||||
= defaultBuildDirectory(projectPath, k, tr("Release", "Shadow build directory suffix"),
|
|
||||||
info.buildType);
|
|
||||||
result << info;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace QbsProjectManager
|
} // namespace QbsProjectManager
|
||||||
|
@@ -92,10 +92,8 @@ class QbsBuildConfigurationFactory : public ProjectExplorer::BuildConfigurationF
|
|||||||
public:
|
public:
|
||||||
QbsBuildConfigurationFactory();
|
QbsBuildConfigurationFactory();
|
||||||
|
|
||||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
QList<ProjectExplorer::BuildInfo> availableBuilds
|
||||||
const Utils::FilePath &projectPath) const override;
|
(const ProjectExplorer::Kit *k, const Utils::FilePath &projectPath, bool forSetup) const override;
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
|
||||||
const Utils::FilePath &projectPath) const override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k,
|
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k,
|
||||||
|
@@ -665,29 +665,25 @@ static const QList<BuildConfiguration::BuildType> availableBuildTypes(const Base
|
|||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<BuildInfo> QmakeBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath) const
|
QList<BuildInfo> QmakeBuildConfigurationFactory::availableBuilds(const Kit *k, const FilePath &projectPath, bool forSetup) const
|
||||||
{
|
{
|
||||||
QList<BuildInfo> result;
|
QList<BuildInfo> result;
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<BuildInfo> QmakeBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
|
|
||||||
{
|
|
||||||
QList<BuildInfo> result;
|
|
||||||
BaseQtVersion *qtVersion = QtKitAspect::qtVersion(k);
|
BaseQtVersion *qtVersion = QtKitAspect::qtVersion(k);
|
||||||
if (!qtVersion || !qtVersion->isValid())
|
|
||||||
return result;
|
|
||||||
|
|
||||||
for (BuildConfiguration::BuildType buildType : availableBuildTypes(qtVersion))
|
if (forSetup && (!qtVersion || !qtVersion->isValid()))
|
||||||
result << createBuildInfo(k, projectPath, buildType);
|
return {};
|
||||||
|
|
||||||
|
|
||||||
|
for (BuildConfiguration::BuildType buildType : availableBuildTypes(qtVersion)) {
|
||||||
|
BuildInfo info = createBuildInfo(k, projectPath, buildType);
|
||||||
|
if (!forSetup) {
|
||||||
|
info.displayName.clear(); // ask for a name
|
||||||
|
info.buildDirectory.clear(); // This depends on the displayName
|
||||||
|
}
|
||||||
|
result << info;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@@ -150,9 +150,8 @@ public:
|
|||||||
QmakeBuildConfigurationFactory();
|
QmakeBuildConfigurationFactory();
|
||||||
|
|
||||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *k,
|
||||||
const Utils::FilePath &projectPath) const override;
|
const Utils::FilePath &projectPath,
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
bool forSetup) const override;
|
||||||
const Utils::FilePath &projectPath) const override;
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const Utils::FilePath &projectPath,
|
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const Utils::FilePath &projectPath,
|
||||||
ProjectExplorer::BuildConfiguration::BuildType type) const;
|
ProjectExplorer::BuildConfiguration::BuildType type) const;
|
||||||
|
@@ -72,13 +72,7 @@ class DummyBuildConfigurationFactory : public ProjectExplorer::BuildConfiguratio
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *,
|
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Kit *,
|
||||||
const FilePath &) const final
|
const FilePath &, bool) const final
|
||||||
{
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *,
|
|
||||||
const FilePath &) const final
|
|
||||||
{
|
{
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user