forked from qt-creator/qt-creator
QbsProjectManager: Add "clean" and "rebuild" actions for products
... and sub-projects. We used to have only the "build" action for these. Task-number: QTCREATORBUG-15919 Change-Id: I31d06498c0cdadb8a8738be521a98e8b03de32ee Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
@@ -87,6 +87,7 @@ bool QbsCleanStep::init(QList<const BuildStep *> &earlierSteps)
|
||||
if (!bc)
|
||||
return false;
|
||||
|
||||
m_products = bc->products();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -97,9 +98,10 @@ void QbsCleanStep::run(QFutureInterface<bool> &fi)
|
||||
QbsProject *pro = static_cast<QbsProject *>(project());
|
||||
qbs::CleanOptions options(m_qbsCleanOptions);
|
||||
|
||||
m_job = pro->clean(options);
|
||||
|
||||
QString error;
|
||||
m_job = pro->clean(options, m_products, error);
|
||||
if (!m_job) {
|
||||
emit addOutput(error, OutputFormat::ErrorMessage);
|
||||
reportRunResult(*m_fi, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -78,6 +78,7 @@ private:
|
||||
void setMaxJobs(int jobcount);
|
||||
|
||||
qbs::CleanOptions m_qbsCleanOptions;
|
||||
QStringList m_products;
|
||||
|
||||
QFutureInterface<bool> *m_fi;
|
||||
qbs::CleanJob *m_job;
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
#include <QVariantMap>
|
||||
|
||||
#include <algorithm>
|
||||
#include <type_traits>
|
||||
|
||||
using namespace Core;
|
||||
using namespace ProjectExplorer;
|
||||
@@ -326,15 +327,31 @@ void QbsProject::invalidate()
|
||||
prepareForParsing();
|
||||
}
|
||||
|
||||
qbs::BuildJob *QbsProject::build(const qbs::BuildOptions &opts, QStringList productNames,
|
||||
QString &error)
|
||||
static qbs::AbstractJob *doBuildOrClean(const qbs::Project &project,
|
||||
const QList<qbs::ProductData> &products,
|
||||
const qbs::BuildOptions &options)
|
||||
{
|
||||
if (products.isEmpty())
|
||||
return project.buildAllProducts(options);
|
||||
return project.buildSomeProducts(products, options);
|
||||
}
|
||||
|
||||
static qbs::AbstractJob *doBuildOrClean(const qbs::Project &project,
|
||||
const QList<qbs::ProductData> &products,
|
||||
const qbs::CleanOptions &options)
|
||||
{
|
||||
if (products.isEmpty())
|
||||
return project.cleanAllProducts(options);
|
||||
return project.cleanSomeProducts(products, options);
|
||||
}
|
||||
|
||||
template<typename Options>
|
||||
qbs::AbstractJob *QbsProject::buildOrClean(const Options &opts, const QStringList &productNames,
|
||||
QString &error)
|
||||
{
|
||||
QTC_ASSERT(qbsProject().isValid(), return 0);
|
||||
QTC_ASSERT(!isParsing(), return 0);
|
||||
|
||||
if (productNames.isEmpty())
|
||||
return qbsProject().buildAllProducts(opts);
|
||||
|
||||
QList<qbs::ProductData> products;
|
||||
foreach (const QString &productName, productNames) {
|
||||
bool found = false;
|
||||
@@ -346,19 +363,25 @@ qbs::BuildJob *QbsProject::build(const qbs::BuildOptions &opts, QStringList prod
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
error = tr("Cannot build: Selected products do not exist anymore.");
|
||||
return 0;
|
||||
const bool cleaningRequested = std::is_same<Options, qbs::CleanOptions>::value;
|
||||
error = tr("%1: Selected products do not exist anymore.")
|
||||
.arg(cleaningRequested ? tr("Cannot clean") : tr("Cannot build"));
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
return qbsProject().buildSomeProducts(products, opts);
|
||||
return doBuildOrClean(qbsProject(), products, opts);
|
||||
}
|
||||
|
||||
qbs::CleanJob *QbsProject::clean(const qbs::CleanOptions &opts)
|
||||
qbs::BuildJob *QbsProject::build(const qbs::BuildOptions &opts, QStringList productNames,
|
||||
QString &error)
|
||||
{
|
||||
if (!qbsProject().isValid())
|
||||
return 0;
|
||||
return qbsProject().cleanAllProducts(opts);
|
||||
return static_cast<qbs::BuildJob *>(buildOrClean(opts, productNames, error));
|
||||
}
|
||||
|
||||
qbs::CleanJob *QbsProject::clean(const qbs::CleanOptions &opts, const QStringList &productNames,
|
||||
QString &error)
|
||||
{
|
||||
return static_cast<qbs::CleanJob *>(buildOrClean(opts, productNames, error));
|
||||
}
|
||||
|
||||
qbs::InstallJob *QbsProject::install(const qbs::InstallOptions &opts)
|
||||
|
||||
@@ -77,7 +77,8 @@ public:
|
||||
const qbs::GroupData &groupData);
|
||||
|
||||
qbs::BuildJob *build(const qbs::BuildOptions &opts, QStringList products, QString &error);
|
||||
qbs::CleanJob *clean(const qbs::CleanOptions &opts);
|
||||
qbs::CleanJob *clean(const qbs::CleanOptions &opts, const QStringList &productNames,
|
||||
QString &error);
|
||||
qbs::InstallJob *install(const qbs::InstallOptions &opts);
|
||||
|
||||
static ProjectExplorer::FileType fileTypeFor(const QSet<QString> &tags);
|
||||
@@ -140,6 +141,9 @@ private:
|
||||
|
||||
static bool ensureWriteableQbsFile(const QString &file);
|
||||
|
||||
template<typename Options> qbs::AbstractJob *buildOrClean(const Options &opts,
|
||||
const QStringList &productNames, QString &error);
|
||||
|
||||
QHash<ProjectExplorer::Target *, qbs::Project> m_qbsProjects;
|
||||
qbs::Project m_qbsProject;
|
||||
qbs::ProjectData m_projectData;
|
||||
|
||||
@@ -45,6 +45,14 @@ const char ACTION_BUILD_PRODUCT_CONTEXT[] = "Qbs.BuildProductCtx";
|
||||
const char ACTION_BUILD_PRODUCT[] = "Qbs.BuildProduct";
|
||||
const char ACTION_BUILD_SUBPROJECT_CONTEXT[] = "Qbs.BuildSubprojectCtx";
|
||||
const char ACTION_BUILD_SUBPROJECT[] = "Qbs.BuildSubproduct";
|
||||
const char ACTION_CLEAN_PRODUCT_CONTEXT[] = "Qbs.CleanProductCtx";
|
||||
const char ACTION_CLEAN_PRODUCT[] = "Qbs.CleanProduct";
|
||||
const char ACTION_CLEAN_SUBPROJECT_CONTEXT[] = "Qbs.CleanSubprojectCtx";
|
||||
const char ACTION_CLEAN_SUBPROJECT[] = "Qbs.CleanSubproject";
|
||||
const char ACTION_REBUILD_PRODUCT_CONTEXT[] = "Qbs.RebuildProductCtx";
|
||||
const char ACTION_REBUILD_PRODUCT[] = "Qbs.RebuildProduct";
|
||||
const char ACTION_REBUILD_SUBPROJECT_CONTEXT[] = "Qbs.RebuildSubprojectCtx";
|
||||
const char ACTION_REBUILD_SUBPROJECT[] = "Qbs.RebuildSubproject";
|
||||
|
||||
// Ids:
|
||||
const char QBS_BUILDSTEP_ID[] = "Qbs.BuildStep";
|
||||
|
||||
@@ -167,6 +167,40 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
||||
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
|
||||
connect(m_buildProduct, &QAction::triggered, this, &QbsProjectManagerPlugin::buildProduct);
|
||||
|
||||
m_cleanProductCtx = new QAction(tr("Clean"), this);
|
||||
command = Core::ActionManager::registerAction(
|
||||
m_cleanProductCtx, Constants::ACTION_CLEAN_PRODUCT_CONTEXT, projectContext);
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
|
||||
connect(m_cleanProductCtx, &QAction::triggered,
|
||||
this, &QbsProjectManagerPlugin::cleanProductContextMenu);
|
||||
|
||||
m_cleanProduct = new Utils::ParameterAction(tr("Clean Product"), tr("Clean Product \"%1\""),
|
||||
Utils::ParameterAction::AlwaysEnabled, this);
|
||||
command = Core::ActionManager::registerAction(m_cleanProduct, Constants::ACTION_CLEAN_PRODUCT);
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
command->setAttribute(Core::Command::CA_UpdateText);
|
||||
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_CLEAN);
|
||||
connect(m_cleanProduct, &QAction::triggered, this, &QbsProjectManagerPlugin::cleanProduct);
|
||||
|
||||
m_rebuildProductCtx = new QAction(tr("Rebuild"), this);
|
||||
command = Core::ActionManager::registerAction(
|
||||
m_rebuildProductCtx, Constants::ACTION_REBUILD_PRODUCT_CONTEXT, projectContext);
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
|
||||
connect(m_rebuildProductCtx, &QAction::triggered,
|
||||
this, &QbsProjectManagerPlugin::rebuildProductContextMenu);
|
||||
|
||||
m_rebuildProduct = new Utils::ParameterAction(
|
||||
tr("Rebuild Product"), tr("Rebuild Product \"%1\""),
|
||||
Utils::ParameterAction::AlwaysEnabled, this);
|
||||
command = Core::ActionManager::registerAction(m_rebuildProduct,
|
||||
Constants::ACTION_REBUILD_PRODUCT);
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
command->setAttribute(Core::Command::CA_UpdateText);
|
||||
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_REBUILD);
|
||||
connect(m_rebuildProduct, &QAction::triggered, this, &QbsProjectManagerPlugin::rebuildProduct);
|
||||
|
||||
m_buildSubprojectCtx = new QAction(tr("Build"), this);
|
||||
command = Core::ActionManager::registerAction(m_buildSubprojectCtx, Constants::ACTION_BUILD_SUBPROJECT_CONTEXT, projectContext);
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
@@ -184,6 +218,46 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
||||
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
|
||||
connect(m_buildSubproject, &QAction::triggered, this, &QbsProjectManagerPlugin::buildSubproject);
|
||||
|
||||
m_cleanSubprojectCtx = new QAction(tr("Clean"), this);
|
||||
command = Core::ActionManager::registerAction(
|
||||
m_cleanSubprojectCtx, Constants::ACTION_CLEAN_SUBPROJECT_CONTEXT, projectContext);
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
|
||||
connect(m_cleanSubprojectCtx, &QAction::triggered,
|
||||
this, &QbsProjectManagerPlugin::cleanSubprojectContextMenu);
|
||||
|
||||
m_cleanSubproject = new Utils::ParameterAction(
|
||||
tr("Clean Subproject"), tr("Clean Subproject \"%1\""),
|
||||
Utils::ParameterAction::AlwaysEnabled, this);
|
||||
command = Core::ActionManager::registerAction(m_cleanSubproject,
|
||||
Constants::ACTION_CLEAN_SUBPROJECT);
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
command->setAttribute(Core::Command::CA_UpdateText);
|
||||
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_CLEAN);
|
||||
connect(m_cleanSubproject, &QAction::triggered, this,
|
||||
&QbsProjectManagerPlugin::cleanSubproject);
|
||||
|
||||
m_rebuildSubprojectCtx = new QAction(tr("Rebuild"), this);
|
||||
command = Core::ActionManager::registerAction(
|
||||
m_rebuildSubprojectCtx, Constants::ACTION_REBUILD_SUBPROJECT_CONTEXT,
|
||||
projectContext);
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
|
||||
connect(m_rebuildSubprojectCtx, &QAction::triggered,
|
||||
this, &QbsProjectManagerPlugin::rebuildSubprojectContextMenu);
|
||||
|
||||
m_rebuildSubproject = new Utils::ParameterAction(
|
||||
tr("Rebuild Subproject"), tr("Rebuild Subproject \"%1\""),
|
||||
Utils::ParameterAction::AlwaysEnabled, this);
|
||||
command = Core::ActionManager::registerAction(m_rebuildSubproject,
|
||||
Constants::ACTION_REBUILD_SUBPROJECT);
|
||||
command->setAttribute(Core::Command::CA_Hide);
|
||||
command->setAttribute(Core::Command::CA_UpdateText);
|
||||
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_REBUILD);
|
||||
connect(m_rebuildSubproject, &QAction::triggered, this,
|
||||
&QbsProjectManagerPlugin::rebuildSubproject);
|
||||
|
||||
|
||||
// Connect
|
||||
connect(ProjectTree::instance(), &ProjectTree::currentNodeChanged,
|
||||
this, &QbsProjectManagerPlugin::updateContextActions);
|
||||
@@ -241,7 +315,11 @@ void QbsProjectManagerPlugin::updateContextActions()
|
||||
m_reparseQbsCtx->setEnabled(isEnabled);
|
||||
m_buildFileCtx->setEnabled(isEnabled && isFile);
|
||||
m_buildProductCtx->setVisible(isEnabled && isProduct);
|
||||
m_cleanProductCtx->setVisible(isEnabled && isProduct);
|
||||
m_rebuildProductCtx->setVisible(isEnabled && isProduct);
|
||||
m_buildSubprojectCtx->setVisible(isEnabled && isSubproject);
|
||||
m_cleanSubprojectCtx->setVisible(isEnabled && isSubproject);
|
||||
m_rebuildSubprojectCtx->setVisible(isEnabled && isSubproject);
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::updateReparseQbsAction()
|
||||
@@ -293,10 +371,22 @@ void QbsProjectManagerPlugin::updateBuildActions()
|
||||
m_buildProduct->setEnabled(enabled);
|
||||
m_buildProduct->setVisible(productVisible);
|
||||
m_buildProduct->setParameter(productName);
|
||||
m_cleanProduct->setEnabled(enabled);
|
||||
m_cleanProduct->setVisible(productVisible);
|
||||
m_cleanProduct->setParameter(productName);
|
||||
m_rebuildProduct->setEnabled(enabled);
|
||||
m_rebuildProduct->setVisible(productVisible);
|
||||
m_rebuildProduct->setParameter(productName);
|
||||
|
||||
m_buildSubproject->setEnabled(enabled);
|
||||
m_buildSubproject->setVisible(subprojectVisible);
|
||||
m_buildSubproject->setParameter(subprojectName);
|
||||
m_cleanSubproject->setEnabled(enabled);
|
||||
m_cleanSubproject->setVisible(subprojectVisible);
|
||||
m_cleanSubproject->setParameter(subprojectName);
|
||||
m_rebuildSubproject->setEnabled(enabled);
|
||||
m_rebuildSubproject->setVisible(subprojectVisible);
|
||||
m_rebuildSubproject->setParameter(subprojectName);
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::projectChanged()
|
||||
@@ -333,6 +423,24 @@ void QbsProjectManagerPlugin::buildFile()
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::buildProductContextMenu()
|
||||
{
|
||||
runStepsForProductContextMenu({Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::cleanProductContextMenu()
|
||||
{
|
||||
runStepsForProductContextMenu({Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::rebuildProductContextMenu()
|
||||
{
|
||||
runStepsForProductContextMenu({
|
||||
Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN),
|
||||
Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)
|
||||
});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::runStepsForProductContextMenu(const QList<Core::Id> &stepTypes)
|
||||
{
|
||||
Node *node = ProjectTree::currentNode();
|
||||
QTC_ASSERT(node, return);
|
||||
@@ -342,27 +450,62 @@ void QbsProjectManagerPlugin::buildProductContextMenu()
|
||||
const QbsProductNode * const productNode = dynamic_cast<QbsProductNode *>(node);
|
||||
QTC_ASSERT(productNode, return);
|
||||
|
||||
buildProducts(project, {QbsProject::uniqueProductName(productNode->qbsProductData())});
|
||||
runStepsForProducts(project, {QbsProject::uniqueProductName(productNode->qbsProductData())},
|
||||
{stepTypes});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::buildProduct()
|
||||
{
|
||||
runStepsForProduct({Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::cleanProduct()
|
||||
{
|
||||
runStepsForProduct({Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::rebuildProduct()
|
||||
{
|
||||
runStepsForProduct({
|
||||
Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN),
|
||||
Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD),
|
||||
});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::runStepsForProduct(const QList<Core::Id> &stepTypes)
|
||||
{
|
||||
Node *node = currentEditorNode();
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
QbsProductNode *product = dynamic_cast<QbsProductNode *>(node->parentProjectNode());
|
||||
if (!product)
|
||||
return;
|
||||
|
||||
QbsProject *project = currentEditorProject();
|
||||
if (!project)
|
||||
return;
|
||||
|
||||
buildProducts(project, {QbsProject::uniqueProductName(product->qbsProductData())});
|
||||
runStepsForProducts(project, {QbsProject::uniqueProductName(product->qbsProductData())},
|
||||
{stepTypes});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::buildSubprojectContextMenu()
|
||||
{
|
||||
runStepsForSubprojectContextMenu({Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::cleanSubprojectContextMenu()
|
||||
{
|
||||
runStepsForSubprojectContextMenu({Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::rebuildSubprojectContextMenu()
|
||||
{
|
||||
runStepsForSubprojectContextMenu({
|
||||
Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN),
|
||||
Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)
|
||||
});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::runStepsForSubprojectContextMenu(const QList<Core::Id> &stepTypes)
|
||||
{
|
||||
Node *node = ProjectTree::currentNode();
|
||||
QTC_ASSERT(node, return);
|
||||
@@ -376,10 +519,28 @@ void QbsProjectManagerPlugin::buildSubprojectContextMenu()
|
||||
foreach (const qbs::ProductData &data, subProject->qbsProjectData().allProducts())
|
||||
toBuild << QbsProject::uniqueProductName(data);
|
||||
|
||||
buildProducts(project, toBuild);
|
||||
runStepsForProducts(project, toBuild, {stepTypes});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::buildSubproject()
|
||||
{
|
||||
runStepsForSubproject({Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::cleanSubproject()
|
||||
{
|
||||
runStepsForSubproject({Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN)});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::rebuildSubproject()
|
||||
{
|
||||
runStepsForSubproject({
|
||||
Core::Id(ProjectExplorer::Constants::BUILDSTEPS_CLEAN),
|
||||
Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD)
|
||||
});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::runStepsForSubproject(const QList<Core::Id> &stepTypes)
|
||||
{
|
||||
Node *editorNode = currentEditorNode();
|
||||
QbsProject *editorProject = currentEditorProject();
|
||||
@@ -404,7 +565,7 @@ void QbsProjectManagerPlugin::buildSubproject()
|
||||
foreach (const qbs::ProductData &data, subproject->qbsProjectData().allProducts())
|
||||
toBuild << QbsProject::uniqueProductName(data);
|
||||
|
||||
buildProducts(editorProject, toBuild);
|
||||
runStepsForProducts(editorProject, toBuild, {stepTypes});
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::buildFiles(QbsProject *project, const QStringList &files,
|
||||
@@ -441,7 +602,8 @@ void QbsProjectManagerPlugin::buildSingleFile(QbsProject *project, const QString
|
||||
buildFiles(project, QStringList(file), QStringList({"obj", "hpp"}));
|
||||
}
|
||||
|
||||
void QbsProjectManagerPlugin::buildProducts(QbsProject *project, const QStringList &products)
|
||||
void QbsProjectManagerPlugin::runStepsForProducts(QbsProject *project,
|
||||
const QStringList &products, const QList<Core::Id> &stepTypes)
|
||||
{
|
||||
QTC_ASSERT(project, return);
|
||||
QTC_ASSERT(!products.isEmpty(), return);
|
||||
@@ -453,17 +615,20 @@ void QbsProjectManagerPlugin::buildProducts(QbsProject *project, const QStringLi
|
||||
if (!bc)
|
||||
return;
|
||||
|
||||
if (!ProjectExplorerPlugin::saveModifiedFiles())
|
||||
if (stepTypes.contains(ProjectExplorer::Constants::BUILDSTEPS_BUILD)
|
||||
&& !ProjectExplorerPlugin::saveModifiedFiles()) {
|
||||
return;
|
||||
}
|
||||
|
||||
bc->setChangedFiles(QStringList());
|
||||
bc->setProducts(products);
|
||||
|
||||
const Core::Id buildStep = ProjectExplorer::Constants::BUILDSTEPS_BUILD;
|
||||
|
||||
const QString name = ProjectExplorerPlugin::displayNameForStepId(buildStep);
|
||||
BuildManager::buildList(bc->stepList(buildStep), name);
|
||||
|
||||
QList<ProjectExplorer::BuildStepList *> stepLists;
|
||||
QStringList stepListNames;
|
||||
for (const Core::Id &stepType : stepTypes) {
|
||||
stepLists << bc->stepList(stepType);
|
||||
stepListNames <<ProjectExplorerPlugin::displayNameForStepId(stepType);
|
||||
}
|
||||
BuildManager::buildLists(stepLists, stepListNames);
|
||||
bc->setProducts(QStringList());
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <coreplugin/id.h>
|
||||
#include <extensionsystem/iplugin.h>
|
||||
#include <utils/parameteraction.h>
|
||||
|
||||
@@ -52,9 +53,21 @@ private:
|
||||
void buildFileContextMenu();
|
||||
void buildFile();
|
||||
void buildProductContextMenu();
|
||||
void cleanProductContextMenu();
|
||||
void rebuildProductContextMenu();
|
||||
void runStepsForProductContextMenu(const QList<Core::Id> &stepTypes);
|
||||
void buildProduct();
|
||||
void cleanProduct();
|
||||
void rebuildProduct();
|
||||
void runStepsForProduct(const QList<Core::Id> &stepTypes);
|
||||
void buildSubprojectContextMenu();
|
||||
void cleanSubprojectContextMenu();
|
||||
void rebuildSubprojectContextMenu();
|
||||
void runStepsForSubprojectContextMenu(const QList<Core::Id> &stepTypes);
|
||||
void buildSubproject();
|
||||
void cleanSubproject();
|
||||
void rebuildSubproject();
|
||||
void runStepsForSubproject(const QList<Core::Id> &stepTypes);
|
||||
|
||||
void reparseSelectedProject();
|
||||
void reparseCurrentProject();
|
||||
@@ -67,16 +80,26 @@ private:
|
||||
void buildFiles(QbsProject *project, const QStringList &files,
|
||||
const QStringList &activeFileTags);
|
||||
void buildSingleFile(QbsProject *project, const QString &file);
|
||||
void buildProducts(QbsProject *project, const QStringList &products);
|
||||
|
||||
void runStepsForProducts(QbsProject *project, const QStringList &products,
|
||||
const QList<Core::Id> &stepTypes);
|
||||
|
||||
QAction *m_reparseQbs = nullptr;
|
||||
QAction *m_reparseQbsCtx = nullptr;
|
||||
QAction *m_buildFileCtx = nullptr;
|
||||
QAction *m_buildProductCtx = nullptr;
|
||||
QAction *m_cleanProductCtx = nullptr;
|
||||
QAction *m_rebuildProductCtx = nullptr;
|
||||
QAction *m_buildSubprojectCtx = nullptr;
|
||||
QAction *m_cleanSubprojectCtx = nullptr;
|
||||
QAction *m_rebuildSubprojectCtx = nullptr;
|
||||
Utils::ParameterAction *m_buildFile = nullptr;
|
||||
Utils::ParameterAction *m_buildProduct = nullptr;
|
||||
Utils::ParameterAction *m_cleanProduct = nullptr;
|
||||
Utils::ParameterAction *m_rebuildProduct = nullptr;
|
||||
Utils::ParameterAction *m_buildSubproject = nullptr;
|
||||
Utils::ParameterAction *m_cleanSubproject = nullptr;
|
||||
Utils::ParameterAction *m_rebuildSubproject = nullptr;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user