ProjectExplorer: Promote CppProjectUpdaterInterface

... to ProjectExplorer::ProjectUpdaterInterface and generalize it
regarding language, but create a convience function for the C++
case, as that's the only user right now.

Also add the self-registering factory boilerplate and adapt all
buildsystems.

Change-Id: If928512609d41c25fad2aa58633c8bffabc4c48f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2023-10-19 10:42:45 +02:00
parent 0fa16f8489
commit b89baec2c1
23 changed files with 165 additions and 96 deletions

View File

@@ -14,7 +14,7 @@
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/kitaspects.h>
#include <projectexplorer/kitmanager.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectupdater.h>
#include <projectexplorer/taskhub.h>
#include <projectexplorer/toolchain.h>
@@ -177,6 +177,7 @@ void MachineFileManager::cleanupMachineFiles()
MesonBuildSystem::MesonBuildSystem(MesonBuildConfiguration *bc)
: BuildSystem(bc)
, m_parser(MesonToolKitAspect::mesonToolId(bc->kit()), bc->environment(), project())
, m_cppCodeModelUpdater(ProjectUpdaterFactory::createCppProjectUpdater())
{
qCDebug(mesonBuildSystemLog) << "Init";
connect(bc->target(), &ProjectExplorer::Target::kitChanged, this, [this] {
@@ -239,8 +240,8 @@ void MesonBuildSystem::parsingCompleted(bool success)
if (success) {
setRootProjectNode(m_parser.takeProjectNode());
if (kit() && buildConfiguration()) {
ProjectExplorer::KitInfo kitInfo{kit()};
m_cppCodeModelUpdater.update(
KitInfo kitInfo{kit()};
m_cppCodeModelUpdater->update(
{project(),
QtSupport::CppKitInfo(kit()),
buildConfiguration()->environment(),

View File

@@ -6,13 +6,13 @@
#include "mesonprojectparser.h"
#include "kitdata.h"
#include <cppeditor/cppprojectupdater.h>
#include <projectexplorer/buildsystem.h>
#include <projectexplorer/target.h>
#include <utils/filesystemwatcher.h>
namespace ProjectExplorer { class ProjectUpdater; }
namespace MesonProjectManager::Internal {
class MesonBuildConfiguration;
@@ -62,7 +62,7 @@ private:
ProjectExplorer::BuildSystem::ParseGuard m_parseGuard;
MesonProjectParser m_parser;
CppEditor::CppProjectUpdater m_cppCodeModelUpdater;
std::unique_ptr<ProjectExplorer::ProjectUpdater> m_cppCodeModelUpdater;
QStringList m_pendingConfigArgs;
Utils::FileSystemWatcher m_IntroWatcher;
KitData m_kitData;