forked from qt-creator/qt-creator
Nim: Hide NimBuildSystem definition in .cpp
Change-Id: Ib6fe898ccb0c58725c336819e4a02a441a304c3a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -139,6 +139,29 @@ bool NimProjectScanner::renameFile(const QString &, const QString &to)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NimBuildSystem
|
||||||
|
|
||||||
|
class NimBuildSystem final : public BuildSystem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit NimBuildSystem(Target *target);
|
||||||
|
|
||||||
|
bool supportsAction(Node *, ProjectAction action, const Node *node) const final;
|
||||||
|
bool addFiles(Node *node, const FilePaths &filePaths, FilePaths *) final;
|
||||||
|
RemovedFilesFromProject removeFiles(Node *node,
|
||||||
|
const FilePaths &filePaths,
|
||||||
|
FilePaths *) final;
|
||||||
|
bool deleteFiles(Node *, const FilePaths &) final;
|
||||||
|
bool renameFile(Node *, const FilePath &oldFilePath, const FilePath &newFilePath) final;
|
||||||
|
QString name() const final { return QLatin1String("nim"); }
|
||||||
|
|
||||||
|
void triggerParsing() final;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
ParseGuard m_guard;
|
||||||
|
NimProjectScanner m_projectScanner;
|
||||||
|
};
|
||||||
|
|
||||||
NimBuildSystem::NimBuildSystem(Target *target)
|
NimBuildSystem::NimBuildSystem(Target *target)
|
||||||
: BuildSystem(target), m_projectScanner(target->project())
|
: BuildSystem(target), m_projectScanner(target->project())
|
||||||
{
|
{
|
||||||
@@ -219,4 +242,9 @@ bool NimBuildSystem::renameFile(Node *, const FilePath &oldFilePath, const FileP
|
|||||||
return m_projectScanner.renameFile(oldFilePath.toString(), newFilePath.toString());
|
return m_projectScanner.renameFile(oldFilePath.toString(), newFilePath.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BuildSystem *createNimBuildSystem(Target *target)
|
||||||
|
{
|
||||||
|
return new NimBuildSystem(target);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Nim
|
} // namespace Nim
|
||||||
|
|||||||
@@ -47,31 +47,6 @@ private:
|
|||||||
Utils::FileSystemWatcher m_directoryWatcher;
|
Utils::FileSystemWatcher m_directoryWatcher;
|
||||||
};
|
};
|
||||||
|
|
||||||
class NimBuildSystem final : public ProjectExplorer::BuildSystem
|
ProjectExplorer::BuildSystem *createNimBuildSystem(ProjectExplorer::Target *target);
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit NimBuildSystem(ProjectExplorer::Target *target);
|
|
||||||
|
|
||||||
bool supportsAction(ProjectExplorer::Node *,
|
|
||||||
ProjectExplorer::ProjectAction action,
|
|
||||||
const ProjectExplorer::Node *node) const final;
|
|
||||||
bool addFiles(ProjectExplorer::Node *node,
|
|
||||||
const Utils::FilePaths &filePaths, Utils::FilePaths *) final;
|
|
||||||
ProjectExplorer::RemovedFilesFromProject removeFiles(ProjectExplorer::Node *node,
|
|
||||||
const Utils::FilePaths &filePaths,
|
|
||||||
Utils::FilePaths *) override;
|
|
||||||
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;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
ParseGuard m_guard;
|
|
||||||
NimProjectScanner m_projectScanner;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Nim
|
} // namespace Nim
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ NimProject::NimProject(const FilePath &filePath) : Project(Constants::C_NIM_MIME
|
|||||||
// ensure debugging is enabled (Nim plugin translates nim code to C code)
|
// ensure debugging is enabled (Nim plugin translates nim code to C code)
|
||||||
setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
|
setProjectLanguages(Core::Context(ProjectExplorer::Constants::CXX_LANGUAGE_ID));
|
||||||
|
|
||||||
setBuildSystemCreator<NimBuildSystem>();
|
setBuildSystemCreator(&createNimBuildSystem);
|
||||||
}
|
}
|
||||||
|
|
||||||
Tasks NimProject::projectIssues(const Kit *k) const
|
Tasks NimProject::projectIssues(const Kit *k) const
|
||||||
|
|||||||
Reference in New Issue
Block a user