forked from qt-creator/qt-creator
ProjectExplorer: Give build systems a name
... and make it accessible through a variable. Fixes: QTCREATORBUG-26147 Change-Id: I0601c09a74360b91fe8421876207a8f4ae9d75b6 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -44,6 +44,7 @@ public:
|
||||
|
||||
private:
|
||||
void triggerParsing() final;
|
||||
QString name() const final { return QLatin1String("autotools"); }
|
||||
|
||||
/**
|
||||
* Is invoked when the makefile parsing by m_makefileParserThread has
|
||||
|
@@ -67,6 +67,7 @@ public:
|
||||
const Utils::FilePaths &filePaths, Utils::FilePaths *) final;
|
||||
|
||||
Utils::FilePaths filesGeneratedFrom(const Utils::FilePath &sourceFile) const final;
|
||||
QString name() const final { return QLatin1String("cmake"); }
|
||||
|
||||
// Actions:
|
||||
void runCMake();
|
||||
|
@@ -64,6 +64,7 @@ public:
|
||||
~CompilationDatabaseBuildSystem();
|
||||
|
||||
void triggerParsing() final;
|
||||
QString name() const final { return QLatin1String("compilationdb"); }
|
||||
|
||||
void reparseProject();
|
||||
void updateDeploymentData();
|
||||
|
@@ -138,6 +138,7 @@ public:
|
||||
RemovedFilesFromProject removeFiles(Node *, const FilePaths &filePaths, FilePaths *) final;
|
||||
bool renameFile(Node *, const FilePath &oldFilePath, const FilePath &newFilePath) final;
|
||||
bool addFiles(Node *, const FilePaths &filePaths, FilePaths *) final;
|
||||
QString name() const final { return QLatin1String("generic"); }
|
||||
|
||||
FilePath filesFilePath() const { return ::FilePath::fromString(m_filesFileName); }
|
||||
|
||||
|
@@ -48,6 +48,7 @@ public:
|
||||
~MesonBuildSystem() final;
|
||||
|
||||
void triggerParsing() final;
|
||||
QString name() const final { return QLatin1String("meson"); }
|
||||
|
||||
inline const BuildOptionsList &buildOptions() const { return m_parser.buildOptions(); }
|
||||
inline const TargetsList &targets() const { return m_parser.targets(); }
|
||||
|
@@ -82,7 +82,7 @@ private:
|
||||
bool deleteFiles(ProjectExplorer::Node *, const Utils::FilePaths &) override;
|
||||
bool renameFile(ProjectExplorer::Node *,
|
||||
const Utils::FilePath &oldFilePath, const Utils::FilePath &newFilePath) override;
|
||||
|
||||
QString name() const final { return QLatin1String("mimble"); }
|
||||
void triggerParsing() final;
|
||||
|
||||
std::vector<NimbleTask> m_tasks;
|
||||
|
@@ -87,6 +87,7 @@ public:
|
||||
bool deleteFiles(ProjectExplorer::Node *, const Utils::FilePaths &) final;
|
||||
bool renameFile(ProjectExplorer::Node *,
|
||||
const Utils::FilePath &oldFilePath, const Utils::FilePath &newFilePath) final;
|
||||
QString name() const final { return QLatin1String("nim"); }
|
||||
|
||||
void triggerParsing() override;
|
||||
|
||||
|
@@ -101,6 +101,7 @@ public:
|
||||
const Utils::FilePath &newFilePath);
|
||||
virtual bool addDependencies(Node *context, const QStringList &dependencies);
|
||||
virtual bool supportsAction(Node *context, ProjectAction action, const Node *node) const;
|
||||
virtual QString name() const = 0;
|
||||
|
||||
virtual Utils::FilePaths filesGeneratedFrom(const Utils::FilePath &sourceFile) const;
|
||||
virtual QVariant additionalData(Utils::Id id) const;
|
||||
|
@@ -1100,6 +1100,7 @@ public:
|
||||
using BuildSystem::BuildSystem;
|
||||
|
||||
void triggerParsing() final {}
|
||||
QString name() const final { return QLatin1String("test"); }
|
||||
};
|
||||
|
||||
class TestProject : public Project
|
||||
|
@@ -161,6 +161,11 @@ Target::Target(Project *project, Kit *k, _constructor_tag) :
|
||||
|
||||
d->m_macroExpander.registerVariable("sourceDir", tr("Source directory"),
|
||||
[project] { return project->projectDirectory().toUserOutput(); });
|
||||
d->m_macroExpander.registerVariable("BuildSystem:Name", tr("Build system"), [this] {
|
||||
if (const BuildSystem * const bs = buildSystem())
|
||||
return bs->name();
|
||||
return QString();
|
||||
});
|
||||
|
||||
// TODO: Remove in ~4.16.
|
||||
d->m_macroExpander.registerVariable(Constants::VAR_CURRENTPROJECT_NAME,
|
||||
|
@@ -69,6 +69,7 @@ public:
|
||||
bool renameFile(Node *,
|
||||
const Utils::FilePath &oldFilePath,
|
||||
const Utils::FilePath &newFilePath) override;
|
||||
QString name() const override { return QLatin1String("python"); }
|
||||
|
||||
bool saveRawFileList(const QStringList &rawFileList);
|
||||
bool saveRawList(const QStringList &rawList, const QString &fileName);
|
||||
|
@@ -91,9 +91,9 @@ public:
|
||||
Utils::FilePaths *notRemoved = nullptr) final;
|
||||
bool renameFile(ProjectExplorer::Node *context,
|
||||
const Utils::FilePath &oldFilePath, const Utils::FilePath &newFilePath) final;
|
||||
|
||||
Utils::FilePaths filesGeneratedFrom(const Utils::FilePath &sourceFile) const final;
|
||||
QVariant additionalData(Utils::Id id) const final;
|
||||
QString name() const final { return QLatin1String("qbs"); }
|
||||
|
||||
bool isProjectEditable() const;
|
||||
bool addFilesToProduct(const Utils::FilePaths &filePaths,
|
||||
|
@@ -105,6 +105,7 @@ public:
|
||||
const Utils::FilePath &newFilePath) override;
|
||||
bool addDependencies(ProjectExplorer::Node *context,
|
||||
const QStringList &dependencies) override;
|
||||
QString name() const final { return QLatin1String("qmake"); }
|
||||
void triggerParsing() final;
|
||||
|
||||
Utils::FilePaths filesGeneratedFrom(const Utils::FilePath &file) const final;
|
||||
|
@@ -59,6 +59,7 @@ public:
|
||||
const Utils::FilePaths &filePaths) override;
|
||||
bool renameFile(ProjectExplorer::Node *context,
|
||||
const Utils::FilePath &oldFilePath, const Utils::FilePath &newFilePath) override;
|
||||
QString name() const override { return QLatin1String("qml"); }
|
||||
|
||||
QmlProject *qmlProject() const;
|
||||
|
||||
|
Reference in New Issue
Block a user