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
@@ -0,0 +1,41 @@
#ifndef TASK_EXECUTE_CUSTOM_COMMANDS_H
#define TASK_EXECUTE_CUSTOM_COMMANDS_H
#include <vector>
#include "FilePath.h"
#include "Task.h"
#include "TimeStamp.h"
#include "MessageIndexingInterrupted.h"
#include "MessageListener.h"
class DialogView;
class IndexerCommandProvider;
class TaskExecuteCustomCommands
: public Task
, public MessageListener<MessageIndexingInterrupted>
{
public:
TaskExecuteCustomCommands(
std::unique_ptr<IndexerCommandProvider> indexerCommandProvider,
std::shared_ptr<DialogView> dialogView,
const FilePath& projectDirectory);
private:
void doEnter(std::shared_ptr<Blackboard> blackboard) override;
TaskState doUpdate(std::shared_ptr<Blackboard> blackboard) override;
void doExit(std::shared_ptr<Blackboard> blackboard) override;
void doReset(std::shared_ptr<Blackboard> blackboard) override;
void handleMessage(MessageIndexingInterrupted* message) override;
std::unique_ptr<IndexerCommandProvider> m_indexerCommandProvider;
std::shared_ptr<DialogView> m_dialogView;
const FilePath m_projectDirectory;
TimeStamp m_start;
bool m_interrupted = false;
};
#endif // TASK_EXECUTE_CUSTOM_COMMANDS_H