logic: Added SourceGroupCustomCommand to use with SourcetrailDB binaries

* Added new Source Group type SourceGroupCustomCommand to UI and ProjectSettings
* The Source Group executes a specified command on every source file
* The variables $SOURCE_PATH, $PROJECT_PATH, $DB_PATH, $STORAGE_VERSION can be passed
* The commands are executed after all other source groups finished indexing
* The command is executed with working directory set to project directory
* Errors during command execution are shown as status update and in the Status View
* SourceGroupCustomCommand cannot be partially cleared, when one file needs clearing the project must be fully re-indexed
This commit is contained in:
Eberhard Graether
2018-12-11 14:05:26 +01:00
parent 21d947ed6c
commit 6d5a3c047d
101 changed files with 1108 additions and 235 deletions
+9
View File
@@ -12,6 +12,7 @@
class IndexerCommand;
class IndexerCommandProvider;
class FilePath;
class FilePathFilter;
class SourceGroupSettings;
class SourceGroup
@@ -20,6 +21,8 @@ public:
virtual ~SourceGroup() = default;
virtual bool prepareIndexing();
virtual bool allowsPartialClearing() const;
virtual std::set<FilePath> filterToContainedFilePaths(const std::set<FilePath>& filePaths) const = 0;
virtual std::set<FilePath> getAllSourceFilePaths() const = 0;
virtual std::shared_ptr<IndexerCommandProvider> getIndexerCommandProvider(const std::set<FilePath>& filesToIndex) const;
@@ -34,6 +37,12 @@ public:
protected:
virtual std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() = 0;
virtual std::shared_ptr<const SourceGroupSettings> getSourceGroupSettings() const = 0;
std::set<FilePath> filterToContainedFilePaths(
const std::set<FilePath>& filePaths,
const std::set<FilePath>& indexedFilePaths,
const std::set<FilePath>& indexedFileOrDirectoryPaths,
const std::vector<FilePathFilter>& excludeFilters) const;
};
#endif // SOURCE_GROUP_H