2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2020 Alexis Jeandet.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2020-05-01 18:20:56 +02:00
|
|
|
|
2022-10-06 16:58:18 +02:00
|
|
|
#include "mesonactionsmanager.h"
|
|
|
|
|
#include "mesonbuildconfiguration.h"
|
2023-06-09 15:16:33 +02:00
|
|
|
#include "mesonbuildsystem.h"
|
2022-10-06 16:58:18 +02:00
|
|
|
#include "mesonproject.h"
|
|
|
|
|
#include "mesonrunconfiguration.h"
|
|
|
|
|
#include "ninjabuildstep.h"
|
|
|
|
|
#include "toolssettingsaccessor.h"
|
|
|
|
|
#include "toolssettingspage.h"
|
2020-05-01 18:20:56 +02:00
|
|
|
|
2024-01-12 14:04:37 +01:00
|
|
|
#include <debugger/debuggerruncontrol.h>
|
|
|
|
|
|
2023-09-28 08:12:35 +02:00
|
|
|
#include <extensionsystem/iplugin.h>
|
|
|
|
|
|
2022-06-22 15:43:33 +02:00
|
|
|
#include <projectexplorer/projectexplorerconstants.h>
|
2020-05-01 18:20:56 +02:00
|
|
|
#include <projectexplorer/projectmanager.h>
|
|
|
|
|
#include <projectexplorer/runcontrol.h>
|
|
|
|
|
|
2022-05-31 11:16:44 +02:00
|
|
|
#include <utils/fsengine/fileiconprovider.h>
|
|
|
|
|
|
2024-01-12 14:04:37 +01:00
|
|
|
using namespace Debugger;
|
2020-05-01 18:20:56 +02:00
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
using namespace Utils;
|
|
|
|
|
|
2023-01-06 13:56:00 +01:00
|
|
|
namespace MesonProjectManager::Internal {
|
2020-05-01 18:20:56 +02:00
|
|
|
|
2023-09-28 07:56:57 +02:00
|
|
|
class MesonProjectPluginPrivate
|
2020-05-01 18:20:56 +02:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
MesonRunConfigurationFactory m_runConfigurationFactory;
|
|
|
|
|
MesonActionsManager m_actions;
|
|
|
|
|
MachineFileManager m_machineFilesManager;
|
2023-01-06 13:56:00 +01:00
|
|
|
SimpleTargetRunnerFactory m_mesonRunWorkerFactory{{m_runConfigurationFactory.runConfigurationId()}};
|
2024-01-12 14:04:37 +01:00
|
|
|
SimpleDebugRunnerFactory m_mesonDebugRunWorkerFactory{{m_runConfigurationFactory.runConfigurationId()}};
|
2020-05-01 18:20:56 +02:00
|
|
|
};
|
|
|
|
|
|
2023-09-28 08:12:35 +02:00
|
|
|
class MesonProjectPlugin final : public ExtensionSystem::IPlugin
|
2020-05-01 18:20:56 +02:00
|
|
|
{
|
2023-09-28 08:12:35 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "MesonProjectManager.json")
|
2020-05-01 18:20:56 +02:00
|
|
|
|
2023-09-28 08:12:35 +02:00
|
|
|
public:
|
|
|
|
|
~MesonProjectPlugin() final
|
|
|
|
|
{
|
|
|
|
|
delete d;
|
|
|
|
|
}
|
2020-05-01 18:20:56 +02:00
|
|
|
|
2023-09-28 08:12:35 +02:00
|
|
|
private:
|
|
|
|
|
void initialize() final
|
|
|
|
|
{
|
|
|
|
|
d = new MesonProjectPluginPrivate;
|
|
|
|
|
|
2024-01-29 15:47:20 +01:00
|
|
|
setupToolsSettingsPage();
|
|
|
|
|
setupToolsSettingsAccessor();
|
|
|
|
|
|
|
|
|
|
setupMesonBuildConfiguration();
|
|
|
|
|
setupNinjaBuildStep();
|
|
|
|
|
|
2023-09-28 08:12:35 +02:00
|
|
|
ProjectManager::registerProjectType<MesonProject>(Constants::Project::MIMETYPE);
|
|
|
|
|
FileIconProvider::registerIconOverlayForFilename(Constants::Icons::MESON, "meson.build");
|
|
|
|
|
FileIconProvider::registerIconOverlayForFilename(Constants::Icons::MESON, "meson_options.txt");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class MesonProjectPluginPrivate *d = nullptr;
|
|
|
|
|
};
|
2020-05-01 18:20:56 +02:00
|
|
|
|
2023-01-06 13:56:00 +01:00
|
|
|
} // MesonProjectManager::Internal
|
2023-09-28 08:12:35 +02:00
|
|
|
|
|
|
|
|
#include "mesonprojectplugin.moc"
|