forked from qt-creator/qt-creator
Python: split buildsystem and project into separate files
Change-Id: Ic226ff6685cb6657a5e83258aab151754d80b3bf Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
50
src/plugins/python/pythonbuildsystem.h
Normal file
50
src/plugins/python/pythonbuildsystem.h
Normal file
@@ -0,0 +1,50 @@
|
||||
// Copyright (C) 2023 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <projectexplorer/buildsystem.h>
|
||||
|
||||
namespace Python::Internal {
|
||||
|
||||
class PythonBuildSystem : public ProjectExplorer::BuildSystem
|
||||
{
|
||||
public:
|
||||
explicit PythonBuildSystem(ProjectExplorer::Target *target);
|
||||
|
||||
bool supportsAction(ProjectExplorer::Node *context,
|
||||
ProjectExplorer::ProjectAction action,
|
||||
const ProjectExplorer::Node *node) const override;
|
||||
bool addFiles(ProjectExplorer::Node *,
|
||||
const Utils::FilePaths &filePaths,
|
||||
Utils::FilePaths *) override;
|
||||
ProjectExplorer::RemovedFilesFromProject removeFiles(ProjectExplorer::Node *,
|
||||
const Utils::FilePaths &filePaths,
|
||||
Utils::FilePaths *) override;
|
||||
bool deleteFiles(ProjectExplorer::Node *, const Utils::FilePaths &) override;
|
||||
bool renameFile(ProjectExplorer::Node *,
|
||||
const Utils::FilePath &oldFilePath,
|
||||
const Utils::FilePath &newFilePath) override;
|
||||
QString name() const override { return QLatin1String("python"); }
|
||||
|
||||
void parse();
|
||||
bool save();
|
||||
|
||||
bool writePyProjectFile(const Utils::FilePath &filePath, QString &content,
|
||||
const QStringList &rawList, QString *errorMessage);
|
||||
|
||||
void triggerParsing() final;
|
||||
|
||||
private:
|
||||
struct FileEntry {
|
||||
QString rawEntry;
|
||||
Utils::FilePath filePath;
|
||||
};
|
||||
QList<FileEntry> processEntries(const QStringList &paths) const;
|
||||
|
||||
QList<FileEntry> m_files;
|
||||
QList<FileEntry> m_qmlImportPaths;
|
||||
};
|
||||
|
||||
|
||||
} // namespace Python::Internal
|
||||
Reference in New Issue
Block a user