forked from qt-creator/qt-creator
ProjectExplorer etc: More FilePath usage
Mostly for project files. Change-Id: Icb6059f80758865e42cc9f9c092ec6782770dfd7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -102,9 +102,9 @@ QList<BuildInfo> AutotoolsBuildConfigurationFactory::availableBuilds(const Targe
|
|||||||
return {createBuildInfo(parent->kit(), parent->project()->projectDirectory())};
|
return {createBuildInfo(parent->kit(), parent->project()->projectDirectory())};
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<BuildInfo> AutotoolsBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const
|
QList<BuildInfo> AutotoolsBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
|
||||||
{
|
{
|
||||||
const QString path = QFileInfo(projectPath).absolutePath();
|
const QString path = projectPath.toFileInfo().absolutePath();
|
||||||
BuildInfo info = createBuildInfo(k, Utils::FilePath::fromString(path));
|
BuildInfo info = createBuildInfo(k, Utils::FilePath::fromString(path));
|
||||||
//: The name of the build configuration created by default for a autotools project.
|
//: The name of the build configuration created by default for a autotools project.
|
||||||
info.displayName = tr("Default");
|
info.displayName = tr("Default");
|
||||||
|
@@ -55,7 +55,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
||||||
const QString &projectPath) const override;
|
const Utils::FilePath &projectPath) const override;
|
||||||
|
|
||||||
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const Utils::FilePath &buildDir) const;
|
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const Utils::FilePath &buildDir) const;
|
||||||
};
|
};
|
||||||
|
@@ -267,7 +267,7 @@ FilePath CMakeBuildConfiguration::shadowBuildDirectory(const FilePath &projectFi
|
|||||||
return FilePath();
|
return FilePath();
|
||||||
|
|
||||||
const QString projectName = projectFilePath.parentDir().fileName();
|
const QString projectName = projectFilePath.parentDir().fileName();
|
||||||
ProjectMacroExpander expander(projectFilePath.toString(), projectName, k, bcName, buildType);
|
ProjectMacroExpander expander(projectFilePath, projectName, k, bcName, buildType);
|
||||||
QDir projectDir = QDir(Project::projectDirectory(projectFilePath).toString());
|
QDir projectDir = QDir(Project::projectDirectory(projectFilePath).toString());
|
||||||
QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
|
QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
|
||||||
buildPath.replace(" ", "-");
|
buildPath.replace(" ", "-");
|
||||||
@@ -493,17 +493,17 @@ QList<BuildInfo> CMakeBuildConfigurationFactory::availableBuilds(const Target *p
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<BuildInfo> CMakeBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const
|
QList<BuildInfo>
|
||||||
|
CMakeBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
|
||||||
{
|
{
|
||||||
QList<BuildInfo> result;
|
QList<BuildInfo> result;
|
||||||
const FilePath projectPathName = FilePath::fromString(projectPath);
|
|
||||||
for (int type = BuildTypeDebug; type != BuildTypeLast; ++type) {
|
for (int type = BuildTypeDebug; type != BuildTypeLast; ++type) {
|
||||||
BuildInfo info = createBuildInfo(k,
|
BuildInfo info = createBuildInfo(k,
|
||||||
ProjectExplorer::Project::projectDirectory(projectPathName).toString(),
|
ProjectExplorer::Project::projectDirectory(projectPath).toString(),
|
||||||
BuildType(type));
|
BuildType(type));
|
||||||
info.displayName = info.typeName;
|
info.displayName = info.typeName;
|
||||||
info.buildDirectory
|
info.buildDirectory
|
||||||
= CMakeBuildConfiguration::shadowBuildDirectory(projectPathName, k,
|
= CMakeBuildConfiguration::shadowBuildDirectory(projectPath, k,
|
||||||
info.displayName, info.buildType);
|
info.displayName, info.buildType);
|
||||||
result << info;
|
result << info;
|
||||||
}
|
}
|
||||||
|
@@ -136,7 +136,7 @@ public:
|
|||||||
|
|
||||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
||||||
const QString &projectPath) const override;
|
const Utils::FilePath &projectPath) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k,
|
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k,
|
||||||
|
@@ -349,7 +349,7 @@ const QList<BuildInfo> CMakeProjectImporter::buildInfoListForKit(const Kit *k, v
|
|||||||
{
|
{
|
||||||
auto data = static_cast<const DirectoryData *>(directoryData);
|
auto data = static_cast<const DirectoryData *>(directoryData);
|
||||||
auto factory = qobject_cast<CMakeBuildConfigurationFactory *>(
|
auto factory = qobject_cast<CMakeBuildConfigurationFactory *>(
|
||||||
BuildConfigurationFactory::find(k, projectFilePath().toString()));
|
BuildConfigurationFactory::find(k, projectFilePath()));
|
||||||
if (!factory)
|
if (!factory)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
|
@@ -547,8 +547,7 @@ QList<ProjectExplorer::BuildInfo> CompilationDatabaseBuildConfigurationFactory::
|
|||||||
return defaultBuildInfos(this, tr("Release"));
|
return defaultBuildInfos(this, tr("Release"));
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<ProjectExplorer::BuildInfo> CompilationDatabaseBuildConfigurationFactory::availableSetups(
|
QList<ProjectExplorer::BuildInfo> CompilationDatabaseBuildConfigurationFactory::availableSetups(const ProjectExplorer::Kit * /*k*/, const Utils::FilePath & /*projectPath*/) const
|
||||||
const ProjectExplorer::Kit * /*k*/, const QString & /*projectPath*/) const
|
|
||||||
{
|
{
|
||||||
return defaultBuildInfos(this, tr("Release"));
|
return defaultBuildInfos(this, tr("Release"));
|
||||||
}
|
}
|
||||||
|
@@ -106,8 +106,8 @@ public:
|
|||||||
|
|
||||||
QList<ProjectExplorer::BuildInfo> availableBuilds(
|
QList<ProjectExplorer::BuildInfo> availableBuilds(
|
||||||
const ProjectExplorer::Target *parent) const override;
|
const ProjectExplorer::Target *parent) const override;
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
QList<ProjectExplorer::BuildInfo> availableSetups(
|
||||||
const QString &projectPath) const override;
|
const ProjectExplorer::Kit *k, const Utils::FilePath &projectPath) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -92,16 +92,17 @@ QList<BuildInfo> GenericBuildConfigurationFactory::availableBuilds(const Target
|
|||||||
return {createBuildInfo(parent->kit(), parent->project()->projectDirectory())};
|
return {createBuildInfo(parent->kit(), parent->project()->projectDirectory())};
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<BuildInfo> GenericBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const
|
QList<BuildInfo>
|
||||||
|
GenericBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
|
||||||
{
|
{
|
||||||
BuildInfo info = createBuildInfo(k, Project::projectDirectory(Utils::FilePath::fromString(projectPath)));
|
BuildInfo info = createBuildInfo(k, Project::projectDirectory(projectPath));
|
||||||
//: The name of the build configuration created by default for a generic project.
|
//: The name of the build configuration created by default for a generic project.
|
||||||
info.displayName = tr("Default");
|
info.displayName = tr("Default");
|
||||||
return {info};
|
return {info};
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildInfo GenericBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
BuildInfo
|
||||||
const Utils::FilePath &buildDir) const
|
GenericBuildConfigurationFactory::createBuildInfo(const Kit *k, const FilePath &buildDir) const
|
||||||
{
|
{
|
||||||
BuildInfo info(this);
|
BuildInfo info(this);
|
||||||
info.typeName = tr("Build");
|
info.typeName = tr("Build");
|
||||||
|
@@ -55,7 +55,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
||||||
const QString &projectPath) const override;
|
const Utils::FilePath &projectPath) const override;
|
||||||
|
|
||||||
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const Utils::FilePath &buildDir) const;
|
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const Utils::FilePath &buildDir) const;
|
||||||
};
|
};
|
||||||
|
@@ -52,13 +52,14 @@ using namespace Utils;
|
|||||||
namespace Nim {
|
namespace Nim {
|
||||||
|
|
||||||
static FilePath defaultBuildDirectory(const Kit *k,
|
static FilePath defaultBuildDirectory(const Kit *k,
|
||||||
const QString &projectFilePath,
|
const FilePath &projectFilePath,
|
||||||
const QString &bc,
|
const QString &bc,
|
||||||
BuildConfiguration::BuildType buildType)
|
BuildConfiguration::BuildType buildType)
|
||||||
{
|
{
|
||||||
QFileInfo projectFileInfo(projectFilePath);
|
QFileInfo projectFileInfo = projectFilePath.toFileInfo();
|
||||||
|
|
||||||
ProjectMacroExpander expander(projectFilePath, projectFileInfo.baseName(), k, bc, buildType);
|
ProjectMacroExpander expander(projectFilePath,
|
||||||
|
projectFileInfo.baseName(), k, bc, buildType);
|
||||||
QString buildDirectory = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
|
QString buildDirectory = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
|
||||||
|
|
||||||
if (FileUtils::isAbsolutePath(buildDirectory))
|
if (FileUtils::isAbsolutePath(buildDirectory))
|
||||||
@@ -85,7 +86,7 @@ void NimBuildConfiguration::initialize(const BuildInfo &info)
|
|||||||
|
|
||||||
// Create the build configuration and initialize it from build info
|
// Create the build configuration and initialize it from build info
|
||||||
setBuildDirectory(defaultBuildDirectory(target()->kit(),
|
setBuildDirectory(defaultBuildDirectory(target()->kit(),
|
||||||
project->projectFilePath().toString(),
|
project->projectFilePath(),
|
||||||
info.displayName,
|
info.displayName,
|
||||||
info.buildType));
|
info.buildType));
|
||||||
|
|
||||||
@@ -162,7 +163,7 @@ QList<BuildInfo> NimBuildConfigurationFactory::availableBuilds(const Target *par
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<BuildInfo> NimBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const
|
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}) {
|
||||||
|
@@ -66,7 +66,7 @@ private:
|
|||||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
||||||
|
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
||||||
const QString &projectPath) const override;
|
const Utils::FilePath &projectPath) const override;
|
||||||
|
|
||||||
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k,
|
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k,
|
||||||
ProjectExplorer::BuildConfiguration::BuildType buildType) const;
|
ProjectExplorer::BuildConfiguration::BuildType buildType) const;
|
||||||
|
@@ -52,6 +52,8 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
|
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
static const char BUILD_STEP_LIST_COUNT[] = "ProjectExplorer.BuildConfiguration.BuildStepListCount";
|
static const char BUILD_STEP_LIST_COUNT[] = "ProjectExplorer.BuildConfiguration.BuildStepListCount";
|
||||||
static const char BUILD_STEP_LIST_PREFIX[] = "ProjectExplorer.BuildConfiguration.BuildStepList.";
|
static const char BUILD_STEP_LIST_PREFIX[] = "ProjectExplorer.BuildConfiguration.BuildStepList.";
|
||||||
static const char CLEAR_SYSTEM_ENVIRONMENT_KEY[] = "ProjectExplorer.BuildConfiguration.ClearSystemEnvironment";
|
static const char CLEAR_SYSTEM_ENVIRONMENT_KEY[] = "ProjectExplorer.BuildConfiguration.ClearSystemEnvironment";
|
||||||
@@ -417,7 +419,8 @@ const QList<BuildInfo> BuildConfigurationFactory::allAvailableBuilds(const Targe
|
|||||||
return availableBuilds(parent);
|
return availableBuilds(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QList<BuildInfo> BuildConfigurationFactory::allAvailableSetups(const Kit *k, const QString &projectPath) const
|
const QList<BuildInfo>
|
||||||
|
BuildConfigurationFactory::allAvailableSetups(const Kit *k, const FilePath &projectPath) const
|
||||||
{
|
{
|
||||||
return availableSetups(k, projectPath);
|
return availableSetups(k, projectPath);
|
||||||
}
|
}
|
||||||
@@ -430,12 +433,13 @@ bool BuildConfigurationFactory::supportsTargetDeviceType(Core::Id id) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// setup
|
// setup
|
||||||
BuildConfigurationFactory *BuildConfigurationFactory::find(const Kit *k, const QString &projectPath)
|
BuildConfigurationFactory *BuildConfigurationFactory::find(const Kit *k, const FilePath &projectPath)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(k, return nullptr);
|
QTC_ASSERT(k, return nullptr);
|
||||||
const Core::Id deviceType = DeviceTypeKitAspect::deviceTypeId(k);
|
const Core::Id deviceType = DeviceTypeKitAspect::deviceTypeId(k);
|
||||||
for (BuildConfigurationFactory *factory : g_buildConfigurationFactories) {
|
for (BuildConfigurationFactory *factory : g_buildConfigurationFactories) {
|
||||||
if (Utils::mimeTypeForFile(projectPath).matchesName(factory->m_supportedProjectMimeTypeName)
|
if (Utils::mimeTypeForFile(projectPath.toString())
|
||||||
|
.matchesName(factory->m_supportedProjectMimeTypeName)
|
||||||
&& factory->supportsTargetDeviceType(deviceType))
|
&& factory->supportsTargetDeviceType(deviceType))
|
||||||
return factory;
|
return factory;
|
||||||
}
|
}
|
||||||
|
@@ -140,14 +140,15 @@ public:
|
|||||||
const QList<BuildInfo> allAvailableBuilds(const Target *parent) const;
|
const QList<BuildInfo> allAvailableBuilds(const Target *parent) const;
|
||||||
|
|
||||||
// List of build information that can be used to initially set up a new build configuration.
|
// List of build information that can be used to initially set up a new build configuration.
|
||||||
const QList<BuildInfo> allAvailableSetups(const Kit *k, const QString &projectPath) const;
|
const QList<BuildInfo>
|
||||||
|
allAvailableSetups(const Kit *k, const Utils::FilePath &projectPath) const;
|
||||||
|
|
||||||
BuildConfiguration *create(Target *parent, const BuildInfo &info) const;
|
BuildConfiguration *create(Target *parent, const BuildInfo &info) const;
|
||||||
|
|
||||||
static BuildConfiguration *restore(Target *parent, const QVariantMap &map);
|
static BuildConfiguration *restore(Target *parent, const QVariantMap &map);
|
||||||
static BuildConfiguration *clone(Target *parent, const BuildConfiguration *source);
|
static BuildConfiguration *clone(Target *parent, const BuildConfiguration *source);
|
||||||
|
|
||||||
static BuildConfigurationFactory *find(const Kit *k, const QString &projectPath);
|
static BuildConfigurationFactory *find(const Kit *k, const Utils::FilePath &projectPath);
|
||||||
static BuildConfigurationFactory *find(Target *parent);
|
static BuildConfigurationFactory *find(Target *parent);
|
||||||
|
|
||||||
using IssueReporter = std::function<Tasks(Kit *, const QString &, const QString &)>;
|
using IssueReporter = std::function<Tasks(Kit *, const QString &, const QString &)>;
|
||||||
@@ -157,7 +158,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QList<BuildInfo> availableBuilds(const Target *parent) const = 0;
|
virtual QList<BuildInfo> availableBuilds(const Target *parent) const = 0;
|
||||||
virtual QList<BuildInfo> availableSetups(const Kit *k, const QString &projectPath) 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);
|
||||||
|
@@ -65,7 +65,7 @@ void JsonKitsPage::initializePage()
|
|||||||
setPreferredKitPredicate([platform, preferred](const Kit *k) {
|
setPreferredKitPredicate([platform, preferred](const Kit *k) {
|
||||||
return k->supportedPlatforms().contains(platform) && k->hasFeatures(preferred);
|
return k->supportedPlatforms().contains(platform) && k->hasFeatures(preferred);
|
||||||
});
|
});
|
||||||
setProjectPath(wiz->expander()->expand(unexpandedProjectPath()));
|
setProjectPath(wiz->expander()->expand(Utils::FilePath::fromString(unexpandedProjectPath())));
|
||||||
|
|
||||||
TargetSetupPage::initializePage();
|
TargetSetupPage::initializePage();
|
||||||
}
|
}
|
||||||
|
@@ -29,13 +29,13 @@
|
|||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
ProjectMacroExpander::ProjectMacroExpander(const QString &mainFilePath, const QString &projectName,
|
ProjectMacroExpander::ProjectMacroExpander(const Utils::FilePath &mainFilePath, const QString &projectName,
|
||||||
const Kit *kit, const QString &bcName,
|
const Kit *kit, const QString &bcName,
|
||||||
BuildConfiguration::BuildType buildType)
|
BuildConfiguration::BuildType buildType)
|
||||||
{
|
{
|
||||||
registerFileVariables(Constants::VAR_CURRENTPROJECT_PREFIX,
|
registerFileVariables(Constants::VAR_CURRENTPROJECT_PREFIX,
|
||||||
QCoreApplication::translate("ProjectExplorer", "Main file of current project"),
|
QCoreApplication::translate("ProjectExplorer", "Main file of current project"),
|
||||||
[mainFilePath]() -> QString { return mainFilePath; });
|
[mainFilePath] { return mainFilePath.toString(); });
|
||||||
|
|
||||||
registerVariable(Constants::VAR_CURRENTPROJECT_NAME,
|
registerVariable(Constants::VAR_CURRENTPROJECT_NAME,
|
||||||
QCoreApplication::translate("ProjectExplorer", "Name of current project"),
|
QCoreApplication::translate("ProjectExplorer", "Name of current project"),
|
||||||
|
@@ -37,8 +37,11 @@ class Kit;
|
|||||||
class PROJECTEXPLORER_EXPORT ProjectMacroExpander : public Utils::MacroExpander
|
class PROJECTEXPLORER_EXPORT ProjectMacroExpander : public Utils::MacroExpander
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ProjectMacroExpander(const QString &mainFilePath, const QString &projectName, const Kit *kit,
|
ProjectMacroExpander(const Utils::FilePath &mainFilePath,
|
||||||
const QString &bcName, BuildConfiguration::BuildType buildType);
|
const QString &projectName,
|
||||||
|
const Kit *kit,
|
||||||
|
const QString &bcName,
|
||||||
|
BuildConfiguration::BuildType buildType);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
@@ -500,7 +500,7 @@ void Target::updateDefaultBuildConfigurations()
|
|||||||
qWarning("No build configuration factory found for target id '%s'.", qPrintable(id().toString()));
|
qWarning("No build configuration factory found for target id '%s'.", qPrintable(id().toString()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (const BuildInfo &info : bcFactory->allAvailableSetups(kit(), project()->projectFilePath().toString())) {
|
for (const BuildInfo &info : bcFactory->allAvailableSetups(kit(), project()->projectFilePath())) {
|
||||||
if (BuildConfiguration *bc = bcFactory->create(this, info))
|
if (BuildConfiguration *bc = bcFactory->create(this, info))
|
||||||
addBuildConfiguration(bc);
|
addBuildConfiguration(bc);
|
||||||
}
|
}
|
||||||
|
@@ -198,7 +198,7 @@ void TargetSetupPageWrapper::addTargetSetupPage()
|
|||||||
{
|
{
|
||||||
m_targetSetupPage = new TargetSetupPage(this);
|
m_targetSetupPage = new TargetSetupPage(this);
|
||||||
m_targetSetupPage->setUseScrollArea(false);
|
m_targetSetupPage->setUseScrollArea(false);
|
||||||
m_targetSetupPage->setProjectPath(m_project->projectFilePath().toString());
|
m_targetSetupPage->setProjectPath(m_project->projectFilePath());
|
||||||
m_targetSetupPage->setRequiredKitPredicate(m_project->requiredKitPredicate());
|
m_targetSetupPage->setRequiredKitPredicate(m_project->requiredKitPredicate());
|
||||||
m_targetSetupPage->setPreferredKitPredicate(m_project->preferredKitPredicate());
|
m_targetSetupPage->setPreferredKitPredicate(m_project->preferredKitPredicate());
|
||||||
m_targetSetupPage->setProjectImporter(m_project->projectImporter());
|
m_targetSetupPage->setProjectImporter(m_project->projectImporter());
|
||||||
|
@@ -52,6 +52,8 @@
|
|||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
|
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
|
|
||||||
static QList<IPotentialKit *> g_potentialKits;
|
static QList<IPotentialKit *> g_potentialKits;
|
||||||
@@ -67,10 +69,10 @@ IPotentialKit::~IPotentialKit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
static Utils::FilePath importDirectory(const QString &projectPath)
|
static FilePath importDirectory(const FilePath &projectPath)
|
||||||
{
|
{
|
||||||
// Setup import widget:
|
// Setup import widget:
|
||||||
auto path = Utils::FilePath::fromString(projectPath);
|
auto path = projectPath;
|
||||||
path = path.parentDir(); // base dir
|
path = path.parentDir(); // base dir
|
||||||
path = path.parentDir(); // parent dir
|
path = path.parentDir(); // parent dir
|
||||||
|
|
||||||
@@ -298,11 +300,11 @@ TargetSetupWidget *TargetSetupPage::widget(const Core::Id kitId,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSetupPage::setProjectPath(const QString &path)
|
void TargetSetupPage::setProjectPath(const FilePath &path)
|
||||||
{
|
{
|
||||||
m_projectPath = path;
|
m_projectPath = path;
|
||||||
if (!m_projectPath.isEmpty()) {
|
if (!m_projectPath.isEmpty()) {
|
||||||
QFileInfo fileInfo(QDir::cleanPath(path));
|
QFileInfo fileInfo(QDir::cleanPath(path.toString()));
|
||||||
QStringList subDirsList = fileInfo.absolutePath().split('/');
|
QStringList subDirsList = fileInfo.absolutePath().split('/');
|
||||||
m_ui->headerLabel->setText(tr("The following kits can be used for project <b>%1</b>:",
|
m_ui->headerLabel->setText(tr("The following kits can be used for project <b>%1</b>:",
|
||||||
"%1: Project name").arg(subDirsList.last()));
|
"%1: Project name").arg(subDirsList.last()));
|
||||||
|
@@ -68,7 +68,7 @@ public:
|
|||||||
// Call these before initializePage!
|
// Call these before initializePage!
|
||||||
void setRequiredKitPredicate(const ProjectExplorer::Kit::Predicate &predicate);
|
void setRequiredKitPredicate(const ProjectExplorer::Kit::Predicate &predicate);
|
||||||
void setPreferredKitPredicate(const ProjectExplorer::Kit::Predicate &predicate);
|
void setPreferredKitPredicate(const ProjectExplorer::Kit::Predicate &predicate);
|
||||||
void setProjectPath(const QString &dir);
|
void setProjectPath(const Utils::FilePath &dir);
|
||||||
void setProjectImporter(ProjectImporter *importer);
|
void setProjectImporter(ProjectImporter *importer);
|
||||||
bool importLineEditHasFocus() const;
|
bool importLineEditHasFocus() const;
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ private:
|
|||||||
ProjectExplorer::Kit::Predicate m_preferredPredicate;
|
ProjectExplorer::Kit::Predicate m_preferredPredicate;
|
||||||
QPointer<ProjectImporter> m_importer;
|
QPointer<ProjectImporter> m_importer;
|
||||||
QLayout *m_baseLayout = nullptr;
|
QLayout *m_baseLayout = nullptr;
|
||||||
QString m_projectPath;
|
Utils::FilePath m_projectPath;
|
||||||
QString m_defaultShadowBuildLocation;
|
QString m_defaultShadowBuildLocation;
|
||||||
std::vector<Internal::TargetSetupWidget *> m_widgets;
|
std::vector<Internal::TargetSetupWidget *> m_widgets;
|
||||||
Internal::TargetSetupWidget *m_firstWidget = nullptr;
|
Internal::TargetSetupWidget *m_firstWidget = nullptr;
|
||||||
|
@@ -47,6 +47,8 @@
|
|||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -54,7 +56,7 @@ namespace Internal {
|
|||||||
// TargetSetupWidget
|
// TargetSetupWidget
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
TargetSetupWidget::TargetSetupWidget(Kit *k, const QString &projectPath) :
|
TargetSetupWidget::TargetSetupWidget(Kit *k, const FilePath &projectPath) :
|
||||||
m_kit(k)
|
m_kit(k)
|
||||||
{
|
{
|
||||||
Q_ASSERT(m_kit);
|
Q_ASSERT(m_kit);
|
||||||
@@ -208,7 +210,7 @@ void TargetSetupWidget::manageKit()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetSetupWidget::setProjectPath(const QString &projectPath)
|
void TargetSetupWidget::setProjectPath(const FilePath &projectPath)
|
||||||
{
|
{
|
||||||
if (!m_kit)
|
if (!m_kit)
|
||||||
return;
|
return;
|
||||||
@@ -225,7 +227,7 @@ void TargetSetupWidget::expandWidget()
|
|||||||
m_detailsWidget->setState(Utils::DetailsWidget::Expanded);
|
m_detailsWidget->setState(Utils::DetailsWidget::Expanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QList<BuildInfo> TargetSetupWidget::buildInfoList(const Kit *k, const QString &projectPath)
|
const QList<BuildInfo> TargetSetupWidget::buildInfoList(const Kit *k, const FilePath &projectPath)
|
||||||
{
|
{
|
||||||
if (auto factory = BuildConfigurationFactory::find(k, projectPath))
|
if (auto factory = BuildConfigurationFactory::find(k, projectPath))
|
||||||
return factory->allAvailableSetups(k, projectPath);
|
return factory->allAvailableSetups(k, projectPath);
|
||||||
@@ -320,7 +322,7 @@ QPair<Task::TaskType, QString> TargetSetupWidget::findIssues(const BuildInfo &in
|
|||||||
QString buildDir = info.buildDirectory.toString();
|
QString buildDir = info.buildDirectory.toString();
|
||||||
Tasks issues;
|
Tasks issues;
|
||||||
if (info.factory())
|
if (info.factory())
|
||||||
issues = info.factory()->reportIssues(m_kit, m_projectPath, buildDir);
|
issues = info.factory()->reportIssues(m_kit, m_projectPath.toString(), buildDir);
|
||||||
|
|
||||||
QString text;
|
QString text;
|
||||||
Task::TaskType highestType = Task::Unknown;
|
Task::TaskType highestType = Task::Unknown;
|
||||||
|
@@ -57,8 +57,7 @@ class TargetSetupWidget : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TargetSetupWidget(Kit *k,
|
TargetSetupWidget(Kit *k, const Utils::FilePath &projectPath);
|
||||||
const QString &projectPath);
|
|
||||||
|
|
||||||
Kit *kit() const;
|
Kit *kit() const;
|
||||||
void clearKit();
|
void clearKit();
|
||||||
@@ -69,14 +68,14 @@ public:
|
|||||||
void addBuildInfo(const BuildInfo &info, bool isImport);
|
void addBuildInfo(const BuildInfo &info, bool isImport);
|
||||||
|
|
||||||
const QList<BuildInfo> selectedBuildInfoList() const;
|
const QList<BuildInfo> selectedBuildInfoList() const;
|
||||||
void setProjectPath(const QString &projectPath);
|
void setProjectPath(const Utils::FilePath &projectPath);
|
||||||
void expandWidget();
|
void expandWidget();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void selectedToggled() const;
|
void selectedToggled() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const QList<BuildInfo> buildInfoList(const Kit *k, const QString &projectPath);
|
static const QList<BuildInfo> buildInfoList(const Kit *k, const Utils::FilePath &projectPath);
|
||||||
|
|
||||||
void handleKitUpdate(ProjectExplorer::Kit *k);
|
void handleKitUpdate(ProjectExplorer::Kit *k);
|
||||||
|
|
||||||
@@ -90,7 +89,7 @@ private:
|
|||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
Kit *m_kit;
|
Kit *m_kit;
|
||||||
QString m_projectPath;
|
Utils::FilePath m_projectPath;
|
||||||
bool m_haveImported = false;
|
bool m_haveImported = false;
|
||||||
Utils::DetailsWidget *m_detailsWidget;
|
Utils::DetailsWidget *m_detailsWidget;
|
||||||
QPushButton *m_manageButton;
|
QPushButton *m_manageButton;
|
||||||
|
@@ -59,13 +59,13 @@ using namespace Utils;
|
|||||||
namespace QbsProjectManager {
|
namespace QbsProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
static FilePath defaultBuildDirectory(const QString &projectFilePath, const Kit *k,
|
static FilePath defaultBuildDirectory(const FilePath &projectFilePath, const Kit *k,
|
||||||
const QString &bcName,
|
const QString &bcName,
|
||||||
BuildConfiguration::BuildType buildType)
|
BuildConfiguration::BuildType buildType)
|
||||||
{
|
{
|
||||||
const QString projectName = QFileInfo(projectFilePath).completeBaseName();
|
const QString projectName = projectFilePath.toFileInfo().completeBaseName();
|
||||||
ProjectMacroExpander expander(projectFilePath, projectName, k, bcName, buildType);
|
ProjectMacroExpander expander(projectFilePath, projectName, k, bcName, buildType);
|
||||||
QString projectDir = Project::projectDirectory(FilePath::fromString(projectFilePath)).toString();
|
QString projectDir = Project::projectDirectory(projectFilePath).toString();
|
||||||
QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
|
QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
|
||||||
return FilePath::fromString(FileUtils::resolvePath(projectDir, buildPath));
|
return FilePath::fromString(FileUtils::resolvePath(projectDir, buildPath));
|
||||||
}
|
}
|
||||||
@@ -102,7 +102,7 @@ void QbsBuildConfiguration::initialize(const BuildInfo &info)
|
|||||||
|
|
||||||
Utils::FilePath buildDir = info.buildDirectory;
|
Utils::FilePath buildDir = info.buildDirectory;
|
||||||
if (buildDir.isEmpty())
|
if (buildDir.isEmpty())
|
||||||
buildDir = defaultBuildDirectory(target()->project()->projectFilePath().toString(),
|
buildDir = defaultBuildDirectory(target()->project()->projectFilePath(),
|
||||||
target()->kit(), info.displayName, info.buildType);
|
target()->kit(), info.displayName, info.buildType);
|
||||||
setBuildDirectory(buildDir);
|
setBuildDirectory(buildDir);
|
||||||
|
|
||||||
@@ -387,7 +387,8 @@ QList<BuildInfo> QbsBuildConfigurationFactory::availableBuilds(const Target *par
|
|||||||
return {createBuildInfo(parent->kit(), BuildConfiguration::Debug)};
|
return {createBuildInfo(parent->kit(), BuildConfiguration::Debug)};
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<BuildInfo> QbsBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const
|
QList<BuildInfo>
|
||||||
|
QbsBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
|
||||||
{
|
{
|
||||||
QList<BuildInfo> result;
|
QList<BuildInfo> result;
|
||||||
|
|
||||||
|
@@ -94,7 +94,7 @@ public:
|
|||||||
|
|
||||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
||||||
const QString &projectPath) const override;
|
const Utils::FilePath &projectPath) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k,
|
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k,
|
||||||
|
@@ -725,8 +725,8 @@ void QbsProject::configureAsExampleProject(const QSet<Id> &platforms)
|
|||||||
= QtSupport::QtKitAspect::qtVersion(k);
|
= QtSupport::QtKitAspect::qtVersion(k);
|
||||||
if (!qtVersion || !qtVersionMatchesPlatform(qtVersion))
|
if (!qtVersion || !qtVersionMatchesPlatform(qtVersion))
|
||||||
continue;
|
continue;
|
||||||
if (auto factory = BuildConfigurationFactory::find(k, projectFilePath().toString()))
|
if (auto factory = BuildConfigurationFactory::find(k, projectFilePath()))
|
||||||
infoList << factory->allAvailableSetups(k, projectFilePath().toString());
|
infoList << factory->allAvailableSetups(k, projectFilePath());
|
||||||
}
|
}
|
||||||
setup(infoList);
|
setup(infoList);
|
||||||
prepareForParsing();
|
prepareForParsing();
|
||||||
|
@@ -87,13 +87,12 @@ QbsProjectImporter::QbsProjectImporter(const FilePath &path) : QtProjectImporter
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString buildDir(const QString &projectFilePath, const Kit *k)
|
static QString buildDir(const FilePath &projectFilePath, const Kit *k)
|
||||||
{
|
{
|
||||||
const QString projectName = QFileInfo(projectFilePath).completeBaseName();
|
const QString projectName = projectFilePath.toFileInfo().completeBaseName();
|
||||||
ProjectMacroExpander expander(projectFilePath, projectName, k, QString(),
|
ProjectMacroExpander expander(projectFilePath, projectName, k, QString(),
|
||||||
BuildConfiguration::Unknown);
|
BuildConfiguration::Unknown);
|
||||||
const QString projectDir
|
const QString projectDir = Project::projectDirectory(projectFilePath).toString();
|
||||||
= Project::projectDirectory(FilePath::fromString(projectFilePath)).toString();
|
|
||||||
const QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
|
const QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
|
||||||
return FileUtils::resolvePath(projectDir, buildPath);
|
return FileUtils::resolvePath(projectDir, buildPath);
|
||||||
}
|
}
|
||||||
@@ -125,7 +124,7 @@ QStringList QbsProjectImporter::importCandidates()
|
|||||||
seenCandidates.insert(projectDir);
|
seenCandidates.insert(projectDir);
|
||||||
const auto &kits = KitManager::kits();
|
const auto &kits = KitManager::kits();
|
||||||
for (Kit * const k : kits) {
|
for (Kit * const k : kits) {
|
||||||
QFileInfo fi(buildDir(projectFilePath().toString(), k));
|
QFileInfo fi(buildDir(projectFilePath(), k));
|
||||||
const QString candidate = fi.absolutePath();
|
const QString candidate = fi.absolutePath();
|
||||||
if (!seenCandidates.contains(candidate)) {
|
if (!seenCandidates.contains(candidate)) {
|
||||||
seenCandidates.insert(candidate);
|
seenCandidates.insert(candidate);
|
||||||
@@ -224,7 +223,7 @@ const QList<BuildInfo> QbsProjectImporter::buildInfoListForKit(const Kit *k, voi
|
|||||||
{
|
{
|
||||||
qCDebug(qbsPmLog) << "creating build info for kit" << k->displayName();
|
qCDebug(qbsPmLog) << "creating build info for kit" << k->displayName();
|
||||||
const auto factory = qobject_cast<QbsBuildConfigurationFactory *>(
|
const auto factory = qobject_cast<QbsBuildConfigurationFactory *>(
|
||||||
BuildConfigurationFactory::find(k, projectFilePath().toString()));
|
BuildConfigurationFactory::find(k, projectFilePath()));
|
||||||
if (!factory) {
|
if (!factory) {
|
||||||
qCDebug(qbsPmLog) << "no build config factory found";
|
qCDebug(qbsPmLog) << "no build config factory found";
|
||||||
return {};
|
return {};
|
||||||
|
@@ -78,21 +78,21 @@ namespace QmakeProjectManager {
|
|||||||
// Helpers:
|
// Helpers:
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
QString QmakeBuildConfiguration::shadowBuildDirectory(const QString &proFilePath, const Kit *k,
|
QString QmakeBuildConfiguration::shadowBuildDirectory(const FilePath &proFilePath, const Kit *k,
|
||||||
const QString &suffix,
|
const QString &suffix,
|
||||||
BuildConfiguration::BuildType buildType)
|
BuildConfiguration::BuildType buildType)
|
||||||
{
|
{
|
||||||
if (proFilePath.isEmpty())
|
if (proFilePath.isEmpty())
|
||||||
return QString();
|
return QString();
|
||||||
|
|
||||||
const QString projectName = QFileInfo(proFilePath).completeBaseName();
|
const QString projectName = proFilePath.toFileInfo().completeBaseName();
|
||||||
ProjectMacroExpander expander(proFilePath, projectName, k, suffix, buildType);
|
ProjectMacroExpander expander(proFilePath, projectName, k, suffix, buildType);
|
||||||
QString projectDir = Project::projectDirectory(FilePath::fromString(proFilePath)).toString();
|
QString projectDir = Project::projectDirectory(proFilePath).toString();
|
||||||
QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
|
QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
|
||||||
return FileUtils::resolvePath(projectDir, buildPath);
|
return FileUtils::resolvePath(projectDir, buildPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
static FilePath defaultBuildDirectory(const QString &projectPath,
|
static FilePath defaultBuildDirectory(const FilePath &projectPath,
|
||||||
const Kit *k,
|
const Kit *k,
|
||||||
const QString &suffix,
|
const QString &suffix,
|
||||||
BuildConfiguration::BuildType type)
|
BuildConfiguration::BuildType type)
|
||||||
@@ -160,7 +160,7 @@ void QmakeBuildConfiguration::initialize(const BuildInfo &info)
|
|||||||
|
|
||||||
FilePath directory = info.buildDirectory;
|
FilePath directory = info.buildDirectory;
|
||||||
if (directory.isEmpty()) {
|
if (directory.isEmpty()) {
|
||||||
directory = defaultBuildDirectory(target()->project()->projectFilePath().toString(),
|
directory = defaultBuildDirectory(target()->project()->projectFilePath(),
|
||||||
target()->kit(), info.displayName, buildType());
|
target()->kit(), info.displayName, buildType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,7 +602,7 @@ QmakeBuildConfigurationFactory::QmakeBuildConfigurationFactory()
|
|||||||
}
|
}
|
||||||
|
|
||||||
BuildInfo QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
BuildInfo QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
||||||
const QString &projectPath,
|
const FilePath &projectPath,
|
||||||
BuildConfiguration::BuildType type) const
|
BuildConfiguration::BuildType type) const
|
||||||
{
|
{
|
||||||
BaseQtVersion *version = QtKitAspect::qtVersion(k);
|
BaseQtVersion *version = QtKitAspect::qtVersion(k);
|
||||||
@@ -639,10 +639,9 @@ BuildInfo QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
|||||||
info.kitId = k->id();
|
info.kitId = k->id();
|
||||||
|
|
||||||
// check if this project is in the source directory:
|
// check if this project is in the source directory:
|
||||||
FilePath projectFilePath = FilePath::fromString(projectPath);
|
if (version && version->isInSourceDirectory(projectPath)) {
|
||||||
if (version && version->isInSourceDirectory(projectFilePath)) {
|
|
||||||
// assemble build directory
|
// assemble build directory
|
||||||
QString projectDirectory = projectFilePath.toFileInfo().absolutePath();
|
QString projectDirectory = projectPath.toFileInfo().absolutePath();
|
||||||
QDir qtSourceDir = QDir(version->sourcePath().toString());
|
QDir qtSourceDir = QDir(version->sourcePath().toString());
|
||||||
QString relativeProjectPath = qtSourceDir.relativeFilePath(projectDirectory);
|
QString relativeProjectPath = qtSourceDir.relativeFilePath(projectDirectory);
|
||||||
QString qtBuildDir = version->qmakeProperty("QT_INSTALL_PREFIX");
|
QString qtBuildDir = version->qmakeProperty("QT_INSTALL_PREFIX");
|
||||||
@@ -657,7 +656,7 @@ BuildInfo QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k,
|
|||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
static QList<BuildConfiguration::BuildType> availableBuildTypes(const BaseQtVersion *version)
|
static const QList<BuildConfiguration::BuildType> availableBuildTypes(const BaseQtVersion *version)
|
||||||
{
|
{
|
||||||
QList<BuildConfiguration::BuildType> types = {BuildConfiguration::Debug,
|
QList<BuildConfiguration::BuildType> types = {BuildConfiguration::Debug,
|
||||||
BuildConfiguration::Release};
|
BuildConfiguration::Release};
|
||||||
@@ -670,9 +669,9 @@ QList<BuildInfo> QmakeBuildConfigurationFactory::availableBuilds(const Target *p
|
|||||||
{
|
{
|
||||||
QList<BuildInfo> result;
|
QList<BuildInfo> result;
|
||||||
|
|
||||||
const QString projectFilePath = parent->project()->projectFilePath().toString();
|
const FilePath projectFilePath = parent->project()->projectFilePath();
|
||||||
|
|
||||||
foreach (BuildConfiguration::BuildType buildType,
|
for (BuildConfiguration::BuildType buildType :
|
||||||
availableBuildTypes(QtKitAspect::qtVersion(parent->kit()))) {
|
availableBuildTypes(QtKitAspect::qtVersion(parent->kit()))) {
|
||||||
BuildInfo info = createBuildInfo(parent->kit(), projectFilePath, buildType);
|
BuildInfo info = createBuildInfo(parent->kit(), projectFilePath, buildType);
|
||||||
info.displayName.clear(); // ask for a name
|
info.displayName.clear(); // ask for a name
|
||||||
@@ -683,14 +682,14 @@ QList<BuildInfo> QmakeBuildConfigurationFactory::availableBuilds(const Target *p
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<BuildInfo> QmakeBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const
|
QList<BuildInfo> QmakeBuildConfigurationFactory::availableSetups(const Kit *k, const FilePath &projectPath) const
|
||||||
{
|
{
|
||||||
QList<BuildInfo> result;
|
QList<BuildInfo> result;
|
||||||
BaseQtVersion *qtVersion = QtKitAspect::qtVersion(k);
|
BaseQtVersion *qtVersion = QtKitAspect::qtVersion(k);
|
||||||
if (!qtVersion || !qtVersion->isValid())
|
if (!qtVersion || !qtVersion->isValid())
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
foreach (BuildConfiguration::BuildType buildType, availableBuildTypes(qtVersion))
|
for (BuildConfiguration::BuildType buildType : availableBuildTypes(qtVersion))
|
||||||
result << createBuildInfo(k, projectPath, buildType);
|
result << createBuildInfo(k, projectPath, buildType);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@@ -60,7 +60,7 @@ public:
|
|||||||
void setQMakeBuildConfiguration(QtSupport::BaseQtVersion::QmakeBuildConfigs config);
|
void setQMakeBuildConfiguration(QtSupport::BaseQtVersion::QmakeBuildConfigs config);
|
||||||
|
|
||||||
/// suffix should be unique
|
/// suffix should be unique
|
||||||
static QString shadowBuildDirectory(const QString &profilePath, const ProjectExplorer::Kit *k,
|
static QString shadowBuildDirectory(const Utils::FilePath &profilePath, const ProjectExplorer::Kit *k,
|
||||||
const QString &suffix, BuildConfiguration::BuildType type);
|
const QString &suffix, BuildConfiguration::BuildType type);
|
||||||
|
|
||||||
/// \internal for qmakestep
|
/// \internal for qmakestep
|
||||||
@@ -151,9 +151,9 @@ public:
|
|||||||
|
|
||||||
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
QList<ProjectExplorer::BuildInfo> availableBuilds(const ProjectExplorer::Target *parent) const override;
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k,
|
||||||
const QString &projectPath) const override;
|
const Utils::FilePath &projectPath) const override;
|
||||||
private:
|
private:
|
||||||
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const QString &projectPath,
|
ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const Utils::FilePath &projectPath,
|
||||||
ProjectExplorer::BuildConfiguration::BuildType type) const;
|
ProjectExplorer::BuildConfiguration::BuildType type) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -949,8 +949,8 @@ void QmakeProject::configureAsExampleProject(const QSet<Core::Id> &platforms)
|
|||||||
&& !Utils::contains(version->targetDeviceTypes(), [platforms](Core::Id i) { return platforms.contains(i); })))
|
&& !Utils::contains(version->targetDeviceTypes(), [platforms](Core::Id i) { return platforms.contains(i); })))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (auto factory = BuildConfigurationFactory::find(k, projectFilePath().toString()))
|
if (auto factory = BuildConfigurationFactory::find(k, projectFilePath()))
|
||||||
infoList << factory->allAvailableSetups(k, projectFilePath().toString());
|
infoList << factory->allAvailableSetups(k, projectFilePath());
|
||||||
}
|
}
|
||||||
setup(infoList);
|
setup(infoList);
|
||||||
}
|
}
|
||||||
|
@@ -52,7 +52,7 @@ QmakeProjectConfigWidget::QmakeProjectConfigWidget(QmakeBuildConfiguration *bc)
|
|||||||
Project *project = bc->target()->project();
|
Project *project = bc->target()->project();
|
||||||
|
|
||||||
m_defaultShadowBuildDir
|
m_defaultShadowBuildDir
|
||||||
= QmakeBuildConfiguration::shadowBuildDirectory(project->projectFilePath().toString(),
|
= QmakeBuildConfiguration::shadowBuildDirectory(project->projectFilePath(),
|
||||||
bc->target()->kit(),
|
bc->target()->kit(),
|
||||||
Utils::FileUtils::qmakeFriendlyName(bc->displayName()),
|
Utils::FileUtils::qmakeFriendlyName(bc->displayName()),
|
||||||
bc->buildType());
|
bc->buildType());
|
||||||
|
@@ -96,7 +96,7 @@ QStringList QmakeProjectImporter::importCandidates()
|
|||||||
candidates << pfi.absolutePath();
|
candidates << pfi.absolutePath();
|
||||||
|
|
||||||
foreach (Kit *k, KitManager::kits()) {
|
foreach (Kit *k, KitManager::kits()) {
|
||||||
QFileInfo fi(QmakeBuildConfiguration::shadowBuildDirectory(projectFilePath().toString(), k,
|
QFileInfo fi(QmakeBuildConfiguration::shadowBuildDirectory(projectFilePath(), k,
|
||||||
QString(), BuildConfiguration::Unknown));
|
QString(), BuildConfiguration::Unknown));
|
||||||
const QString baseDir = fi.absolutePath();
|
const QString baseDir = fi.absolutePath();
|
||||||
|
|
||||||
@@ -235,7 +235,7 @@ const QList<BuildInfo> QmakeProjectImporter::buildInfoListForKit(const Kit *k, v
|
|||||||
{
|
{
|
||||||
auto *data = static_cast<DirectoryData *>(directoryData);
|
auto *data = static_cast<DirectoryData *>(directoryData);
|
||||||
auto factory = qobject_cast<QmakeBuildConfigurationFactory *>(
|
auto factory = qobject_cast<QmakeBuildConfigurationFactory *>(
|
||||||
BuildConfigurationFactory::find(k, projectFilePath().toString()));
|
BuildConfigurationFactory::find(k, projectFilePath()));
|
||||||
if (!factory)
|
if (!factory)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
|
@@ -293,9 +293,7 @@ void BaseQmakeProjectWizardDialog::generateProfileName(const QString &name, cons
|
|||||||
if (!m_targetSetupPage)
|
if (!m_targetSetupPage)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const QString proFile =
|
const QString proFile = QDir::cleanPath(path + '/' + name + '/' + name + ".pro");
|
||||||
QDir::cleanPath(path + QLatin1Char('/') + name + QLatin1Char('/')
|
|
||||||
+ name + QLatin1String(".pro"));
|
|
||||||
|
|
||||||
m_targetSetupPage->setProjectPath(proFile);
|
m_targetSetupPage->setProjectPath(Utils::FilePath::fromString(proFile));
|
||||||
}
|
}
|
||||||
|
@@ -38,6 +38,9 @@
|
|||||||
#include <QLibraryInfo>
|
#include <QLibraryInfo>
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
|
using namespace ProjectExplorer;
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
namespace QmlProfiler {
|
namespace QmlProfiler {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -74,7 +77,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *,
|
QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *,
|
||||||
const QString &) const final
|
const FilePath &) const final
|
||||||
{
|
{
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user