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
+26 -3
View File
@@ -1,11 +1,11 @@
#include "ProjectSettings.h"
#include "Project.h"
#include "SettingsMigrationDeleteKey.h"
#include "SettingsMigrationLambda.h"
#include "SettingsMigrationMoveKey.h"
#include "SourceGroupSettingsCEmpty.h"
#include "SourceGroupSettingsCppEmpty.h"
#include "SourceGroupSettingsCustomCommand.h"
#include "SourceGroupSettingsCxxCdb.h"
#include "SourceGroupSettingsCxxCodeblocks.h"
#include "SourceGroupSettingsCxxSonargraph.h"
@@ -17,6 +17,11 @@
#include "utilityString.h"
#include "utilityUuid.h"
const std::wstring ProjectSettings::PROJECT_FILE_EXTENSION = L".srctrlprj";
const std::wstring ProjectSettings::BOOKMARK_DB_FILE_EXTENSION = L".srctrlbm";
const std::wstring ProjectSettings::INDEX_DB_FILE_EXTENSION = L".srctrldb";
const std::wstring ProjectSettings::TEMP_INDEX_DB_FILE_EXTENSION = L".srctrldb_tmp";
const size_t ProjectSettings::VERSION = 7;
LanguageType ProjectSettings::getLanguageOfProject(const FilePath& filePath)
@@ -115,7 +120,22 @@ FilePath ProjectSettings::getProjectFilePath() const
void ProjectSettings::setProjectFilePath(std::wstring projectName, const FilePath& projectFileLocation)
{
setFilePath(projectFileLocation.getConcatenated(L"/" + projectName + Project::PROJECT_FILE_EXTENSION));
setFilePath(projectFileLocation.getConcatenated(L"/" + projectName + PROJECT_FILE_EXTENSION));
}
FilePath ProjectSettings::getDBFilePath() const
{
return getFilePath().replaceExtension(INDEX_DB_FILE_EXTENSION);
}
FilePath ProjectSettings::getTempDBFilePath() const
{
return getFilePath().replaceExtension(TEMP_INDEX_DB_FILE_EXTENSION);
}
FilePath ProjectSettings::getBookmarkDBFilePath() const
{
return getFilePath().replaceExtension(BOOKMARK_DB_FILE_EXTENSION);
}
std::wstring ProjectSettings::getProjectName() const
@@ -172,6 +192,9 @@ std::vector<std::shared_ptr<SourceGroupSettings>> ProjectSettings::getAllSourceG
case SOURCE_GROUP_JAVA_SONARGRAPH:
settings = std::make_shared<SourceGroupSettingsJavaSonargraph>(id, this);
break;
case SOURCE_GROUP_CUSTOM_COMMAND:
settings = std::make_shared<SourceGroupSettingsCustomCommand>(id, this);
break;
default:
continue;
}
@@ -356,7 +379,7 @@ SettingsMigrator ProjectSettings::getMigrations() const
case LANGUAGE_JAVA:
languageName = "java";
break;
case LANGUAGE_UNKNOWN:
default:
continue;
}