From 605726f35ae9eea1bfb6006bac377b78ea21b757 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Tue, 12 Jan 2021 23:55:14 +0000 Subject: [PATCH 1/5] remove 'resolveAll' --- src/project_manager/ros_catkin_make_step.cpp | 1 - src/project_manager/ros_catkin_tools_step.cpp | 1 - src/project_manager/ros_colcon_step.cpp | 1 - 3 files changed, 3 deletions(-) diff --git a/src/project_manager/ros_catkin_make_step.cpp b/src/project_manager/ros_catkin_make_step.cpp index a426ae55..3081b0cb 100644 --- a/src/project_manager/ros_catkin_make_step.cpp +++ b/src/project_manager/ros_catkin_make_step.cpp @@ -113,7 +113,6 @@ bool ROSCatkinMakeStep::init() env.set(QLatin1String("LC_ALL"), QLatin1String("C")); pp->setEnvironment(env); pp->setCommandLine(makeCommand(allArguments(bc->cmakeBuildType()))); - pp->resolveAll(); // If we are cleaning, then make can fail with an error code, but that doesn't mean // we should stop the clean queue diff --git a/src/project_manager/ros_catkin_tools_step.cpp b/src/project_manager/ros_catkin_tools_step.cpp index b33a629c..034d666e 100644 --- a/src/project_manager/ros_catkin_tools_step.cpp +++ b/src/project_manager/ros_catkin_tools_step.cpp @@ -126,7 +126,6 @@ bool ROSCatkinToolsStep::init() env.set(QLatin1String("LC_ALL"), QLatin1String("C")); pp->setEnvironment(env); pp->setCommandLine(makeCommand(allArguments(bc->cmakeBuildType()))); - pp->resolveAll(); // If we are cleaning, then make can fail with an error code, but that doesn't mean // we should stop the clean queue diff --git a/src/project_manager/ros_colcon_step.cpp b/src/project_manager/ros_colcon_step.cpp index 3b958961..45f9e99d 100644 --- a/src/project_manager/ros_colcon_step.cpp +++ b/src/project_manager/ros_colcon_step.cpp @@ -113,7 +113,6 @@ bool ROSColconStep::init() env.set(QLatin1String("LC_ALL"), QLatin1String("C")); pp->setEnvironment(env); pp->setCommandLine(makeCommand(allArguments(bc->cmakeBuildType()))); - pp->resolveAll(); // If we are cleaning, then make can fail with an error code, but that doesn't mean // we should stop the clean queue From 75656e5dd49f02c2da0a5152ba5291f2d2e855f2 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Wed, 13 Jan 2021 13:33:57 +0000 Subject: [PATCH 2/5] remove 'BuildStepConfigWidget' --- src/project_manager/ros_catkin_make_step.cpp | 9 +-------- src/project_manager/ros_catkin_make_step.h | 3 +-- src/project_manager/ros_catkin_tools_step.cpp | 9 +-------- src/project_manager/ros_catkin_tools_step.h | 3 +-- src/project_manager/ros_colcon_step.cpp | 9 +-------- src/project_manager/ros_colcon_step.h | 3 +-- 6 files changed, 6 insertions(+), 30 deletions(-) diff --git a/src/project_manager/ros_catkin_make_step.cpp b/src/project_manager/ros_catkin_make_step.cpp index 3081b0cb..ab5462a1 100644 --- a/src/project_manager/ros_catkin_make_step.cpp +++ b/src/project_manager/ros_catkin_make_step.cpp @@ -211,11 +211,6 @@ void ROSCatkinMakeStep::stdOutput(const QString &line) } } -BuildStepConfigWidget *ROSCatkinMakeStep::createConfigWidget() -{ - return new ROSCatkinMakeStepWidget(this); -} - ROSCatkinMakeStep::BuildTargets ROSCatkinMakeStep::buildTarget() const { return m_target; @@ -231,8 +226,7 @@ void ROSCatkinMakeStep::setBuildTarget(const BuildTargets &target) // ROSCatkinMakeStepWidget::ROSCatkinMakeStepWidget(ROSCatkinMakeStep *makeStep) - : ProjectExplorer::BuildStepConfigWidget(makeStep) - , m_makeStep(makeStep) + : m_makeStep(makeStep) { m_ui = new Ui::ROSCatkinMakeStep; m_ui->setupUi(this); @@ -294,7 +288,6 @@ void ROSCatkinMakeStepWidget::updateDetails() param.setEnvironment(bc->environment()); param.setCommandLine(m_makeStep->makeCommand(m_makeStep->allArguments(bc->cmakeBuildType(), false))); m_summaryText = param.summary(displayName()); - emit updateSummary(); } void ROSCatkinMakeStepWidget::updateBuildSystem(const ROSUtils::BuildSystem &buildSystem) diff --git a/src/project_manager/ros_catkin_make_step.h b/src/project_manager/ros_catkin_make_step.h index 663f2886..b4210ff9 100644 --- a/src/project_manager/ros_catkin_make_step.h +++ b/src/project_manager/ros_catkin_make_step.h @@ -52,7 +52,6 @@ class ROSCatkinMakeStep : public ProjectExplorer::AbstractProcessStep bool init() override; void setupOutputFormatter(Utils::OutputFormatter *formatter) override; - ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override; ROSBuildConfiguration *rosBuildConfiguration() const; BuildTargets buildTarget() const; @@ -77,7 +76,7 @@ class ROSCatkinMakeStep : public ProjectExplorer::AbstractProcessStep QRegExp m_percentProgress; }; -class ROSCatkinMakeStepWidget : public ProjectExplorer::BuildStepConfigWidget +class ROSCatkinMakeStepWidget : public QWidget { Q_OBJECT diff --git a/src/project_manager/ros_catkin_tools_step.cpp b/src/project_manager/ros_catkin_tools_step.cpp index 034d666e..107e1e69 100644 --- a/src/project_manager/ros_catkin_tools_step.cpp +++ b/src/project_manager/ros_catkin_tools_step.cpp @@ -237,11 +237,6 @@ void ROSCatkinToolsStep::stdOutput(const QString &line) } } -BuildStepConfigWidget *ROSCatkinToolsStep::createConfigWidget() -{ - return new ROSCatkinToolsStepWidget(this); -} - ROSCatkinToolsStep::BuildTargets ROSCatkinToolsStep::buildTarget() const { return m_target; @@ -267,8 +262,7 @@ void ROSCatkinToolsStep::setActiveProfile(const QString &profileName) // ROSCatkinToolsStepWidget::ROSCatkinToolsStepWidget(ROSCatkinToolsStep *makeStep) - : ProjectExplorer::BuildStepConfigWidget(makeStep) - , m_makeStep(makeStep) + : m_makeStep(makeStep) { m_ui = new Ui::ROSCatkinToolsStep; m_ui->setupUi(this); @@ -376,7 +370,6 @@ void ROSCatkinToolsStepWidget::updateDetails() param.setWorkingDirectory(Utils::FilePath::fromString(m_makeStep->m_catkinToolsWorkingDir)); param.setCommandLine(m_makeStep->makeCommand(m_makeStep->allArguments(bc->cmakeBuildType(), false))); m_summaryText = param.summary(displayName()); - emit updateSummary(); } void ROSCatkinToolsStepWidget::updateBuildSystem(const ROSUtils::BuildSystem &buildSystem) diff --git a/src/project_manager/ros_catkin_tools_step.h b/src/project_manager/ros_catkin_tools_step.h index a8d89c12..99e73d88 100644 --- a/src/project_manager/ros_catkin_tools_step.h +++ b/src/project_manager/ros_catkin_tools_step.h @@ -60,7 +60,6 @@ class ROSCatkinToolsStep : public ProjectExplorer::AbstractProcessStep bool init() override; void setupOutputFormatter(Utils::OutputFormatter *formatter) override; - ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override; ROSBuildConfiguration *rosBuildConfiguration() const; BuildTargets buildTarget() const; @@ -92,7 +91,7 @@ class ROSCatkinToolsStep : public ProjectExplorer::AbstractProcessStep QRegExp m_percentProgress; }; -class ROSCatkinToolsStepWidget : public ProjectExplorer::BuildStepConfigWidget +class ROSCatkinToolsStepWidget : public QWidget { Q_OBJECT diff --git a/src/project_manager/ros_colcon_step.cpp b/src/project_manager/ros_colcon_step.cpp index 45f9e99d..95180107 100644 --- a/src/project_manager/ros_colcon_step.cpp +++ b/src/project_manager/ros_colcon_step.cpp @@ -220,11 +220,6 @@ void ROSColconStep::stdOutput(const QString &line) } } -BuildStepConfigWidget *ROSColconStep::createConfigWidget() -{ - return new ROSColconStepWidget(this); -} - ROSColconStep::BuildTargets ROSColconStep::buildTarget() const { return m_target; @@ -240,8 +235,7 @@ void ROSColconStep::setBuildTarget(const BuildTargets &target) // ROSColconStepWidget::ROSColconStepWidget(ROSColconStep *makeStep) - : ProjectExplorer::BuildStepConfigWidget(makeStep) - , m_makeStep(makeStep) + : m_makeStep(makeStep) { m_ui = new Ui::ROSColconStep; m_ui->setupUi(this); @@ -303,7 +297,6 @@ void ROSColconStepWidget::updateDetails() param.setEnvironment(bc->environment()); param.setCommandLine(m_makeStep->makeCommand(m_makeStep->allArguments(bc->cmakeBuildType(), false))); m_summaryText = param.summary(displayName()); - emit updateSummary(); } void ROSColconStepWidget::updateBuildSystem(const ROSUtils::BuildSystem &buildSystem) diff --git a/src/project_manager/ros_colcon_step.h b/src/project_manager/ros_colcon_step.h index e3883012..e03cc867 100644 --- a/src/project_manager/ros_colcon_step.h +++ b/src/project_manager/ros_colcon_step.h @@ -52,7 +52,6 @@ class ROSColconStep : public ProjectExplorer::AbstractProcessStep bool init() override; void setupOutputFormatter(Utils::OutputFormatter *formatter) override; - ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override; ROSBuildConfiguration *rosBuildConfiguration() const; BuildTargets buildTarget() const; @@ -78,7 +77,7 @@ class ROSColconStep : public ProjectExplorer::AbstractProcessStep QRegExp m_percentProgress; }; -class ROSColconStepWidget : public ProjectExplorer::BuildStepConfigWidget +class ROSColconStepWidget : public QWidget { Q_OBJECT From dbbf1ad9e9169e492efaa3b80a31ab502d0ee26d Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Wed, 13 Jan 2021 13:36:08 +0000 Subject: [PATCH 3/5] replace 'Core::VariableChooser' by 'Utils::VariableChooser' --- src/project_manager/ros_catkin_tools_step.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/project_manager/ros_catkin_tools_step.cpp b/src/project_manager/ros_catkin_tools_step.cpp index 107e1e69..297b3822 100644 --- a/src/project_manager/ros_catkin_tools_step.cpp +++ b/src/project_manager/ros_catkin_tools_step.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include @@ -338,7 +338,7 @@ ROSCatkinToolsStepWidget::ROSCatkinToolsStepWidget(ROSCatkinToolsStep *makeStep) connect(ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()), this, SLOT(updateDetails())); - Core::VariableChooser::addSupportForChildWidgets(this, makeStep->rosBuildConfiguration()->macroExpander()); + Utils::VariableChooser::addSupportForChildWidgets(this, makeStep->rosBuildConfiguration()->macroExpander()); } ROSCatkinToolsStepWidget::~ROSCatkinToolsStepWidget() From bb34240545c826771f023318ebcdcc678dc807f1 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Wed, 13 Jan 2021 18:06:15 +0000 Subject: [PATCH 4/5] adapt toolkit built-in header paths --- src/project_manager/ros_project.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/project_manager/ros_project.cpp b/src/project_manager/ros_project.cpp index cbf6fa46..e9bf1f89 100644 --- a/src/project_manager/ros_project.cpp +++ b/src/project_manager/ros_project.cpp @@ -475,7 +475,7 @@ void ROSProject::buildCppCodeModel(const ROSUtils::WorkspaceInfo workspaceInfo, ProjectExplorer::RawProjectParts rpps; - ToolChain *cxxToolChain = ToolChainKitAspect::toolChain(k, ProjectExplorer::Constants::CXX_LANGUAGE_ID); + const ToolChain *cxxToolChain = ToolChainKitAspect::cxxToolChain(k); QString pattern = "^.*\\.(" + QRegularExpression::escape("c") + "|" + QRegularExpression::escape("cc") + @@ -520,7 +520,10 @@ void ROSProject::buildCppCodeModel(const ROSUtils::WorkspaceInfo workspaceInfo, rpp.setMacros(ProjectExplorer::Macro::toMacros(defineArg.toUtf8())); QSet toolChainIncludes; - for (const HeaderPath &hp : cxxToolChain->builtInHeaderPaths(targetInfo.flags, sysRoot, env)) { + const HeaderPaths header_paths = \ + cxxToolChain->createBuiltInHeaderPathsRunner(env)\ + (targetInfo.flags, sysRoot.toString(), QString()); + for (const HeaderPath &hp : header_paths) { toolChainIncludes.insert(hp.path); } From 7ff53cdef11d31577f529d85222d6aa44aa79de1 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Wed, 20 Jan 2021 12:51:20 +0000 Subject: [PATCH 5/5] implement file I/O flags in build system --- src/project_manager/ros_build_system.cpp | 44 ++++++++++++++++++++++++ src/project_manager/ros_build_system.h | 10 ++++++ 2 files changed, 54 insertions(+) diff --git a/src/project_manager/ros_build_system.cpp b/src/project_manager/ros_build_system.cpp index 8a604d8c..ef666ac6 100644 --- a/src/project_manager/ros_build_system.cpp +++ b/src/project_manager/ros_build_system.cpp @@ -21,5 +21,49 @@ void ROSBuildSystem::triggerParsing() guardParsingRun().markAsSuccess(); } +bool ROSBuildSystem::addFiles(ProjectExplorer::Node *context, const QStringList &filePaths, QStringList *notAdded) +{ + return true; +} + +ProjectExplorer::RemovedFilesFromProject ROSBuildSystem::removeFiles(ProjectExplorer::Node *context, const QStringList &filePaths, QStringList *notRemoved) +{ + return ProjectExplorer::RemovedFilesFromProject::Ok; +} + +bool ROSBuildSystem::deleteFiles(ProjectExplorer::Node *context, const QStringList &filePaths) +{ + return true; +} + +bool ROSBuildSystem::canRenameFile(ProjectExplorer::Node *context, const QString &filePath, const QString &newFilePath) +{ + return true; +} + +bool ROSBuildSystem::renameFile(ProjectExplorer::Node *context, const QString &filePath, const QString &newFilePath) +{ + return true; +} + +bool ROSBuildSystem::addDependencies(ProjectExplorer::Node *context, const QStringList &dependencies) +{ + return true; +} + +bool ROSBuildSystem::supportsAction(ProjectExplorer::Node *context, ProjectExplorer::ProjectAction action, const ProjectExplorer::Node *node) const +{ + static const std::set possible_actions = { + ProjectAction::AddNewFile, + ProjectAction::AddExistingFile, + ProjectAction::AddExistingDirectory, + ProjectAction::RemoveFile, + ProjectAction::EraseFile, + ProjectAction::Rename, + }; + + return possible_actions.count(action); +} + } // namespace Internal } // namespace ROSProjectManager diff --git a/src/project_manager/ros_build_system.h b/src/project_manager/ros_build_system.h index e43888ef..8689f087 100644 --- a/src/project_manager/ros_build_system.h +++ b/src/project_manager/ros_build_system.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace ROSProjectManager { namespace Internal { @@ -19,6 +20,15 @@ class ROSBuildSystem : public ProjectExplorer::BuildSystem explicit ROSBuildSystem(ROSBuildConfiguration *bc); void triggerParsing() final; + + virtual bool addFiles(ProjectExplorer::Node *context, const QStringList &filePaths, QStringList *notAdded = nullptr) final; + virtual ProjectExplorer::RemovedFilesFromProject removeFiles(ProjectExplorer::Node *context, const QStringList &filePaths, + QStringList *notRemoved = nullptr) final; + virtual bool deleteFiles(ProjectExplorer::Node *context, const QStringList &filePaths) final; + virtual bool canRenameFile(ProjectExplorer::Node *context, const QString &filePath, const QString &newFilePath) final; + virtual bool renameFile(ProjectExplorer::Node *context, const QString &filePath, const QString &newFilePath) final; + virtual bool addDependencies(ProjectExplorer::Node *context, const QStringList &dependencies) final; + virtual bool supportsAction(ProjectExplorer::Node *context, ProjectExplorer::ProjectAction action, const ProjectExplorer::Node *node) const final; }; } // namespace Internal