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:
@@ -10,6 +10,8 @@ std::string languageTypeToString(LanguageType t)
|
||||
return "C++";
|
||||
case LANGUAGE_JAVA:
|
||||
return "Java";
|
||||
case LANGUAGE_CUSTOM:
|
||||
return "Custom";
|
||||
case LANGUAGE_UNKNOWN:
|
||||
break;
|
||||
}
|
||||
@@ -30,6 +32,10 @@ LanguageType stringToLanguageType(std::string s)
|
||||
{
|
||||
return LANGUAGE_JAVA;
|
||||
}
|
||||
else if (s == "Custom")
|
||||
{
|
||||
return LANGUAGE_CUSTOM;
|
||||
}
|
||||
return LANGUAGE_UNKNOWN;
|
||||
}
|
||||
|
||||
@@ -57,6 +63,8 @@ LanguageType getLanguageTypeForSourceGroupType(SourceGroupType t)
|
||||
return LANGUAGE_JAVA;
|
||||
case SOURCE_GROUP_JAVA_SONARGRAPH:
|
||||
return LANGUAGE_JAVA;
|
||||
case SOURCE_GROUP_CUSTOM_COMMAND:
|
||||
return LANGUAGE_CUSTOM;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ enum LanguageType
|
||||
LANGUAGE_CPP,
|
||||
LANGUAGE_C,
|
||||
LANGUAGE_JAVA,
|
||||
LANGUAGE_CUSTOM,
|
||||
LANGUAGE_UNKNOWN
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,11 @@ class ProjectSettings
|
||||
: public Settings
|
||||
{
|
||||
public:
|
||||
static const std::wstring PROJECT_FILE_EXTENSION;
|
||||
static const std::wstring BOOKMARK_DB_FILE_EXTENSION;
|
||||
static const std::wstring INDEX_DB_FILE_EXTENSION;
|
||||
static const std::wstring TEMP_INDEX_DB_FILE_EXTENSION;
|
||||
|
||||
static const size_t VERSION;
|
||||
static LanguageType getLanguageOfProject(const FilePath& filePath);
|
||||
|
||||
@@ -31,6 +36,10 @@ public:
|
||||
FilePath getProjectFilePath() const;
|
||||
void setProjectFilePath(std::wstring projectName, const FilePath& projectFileLocation);
|
||||
|
||||
FilePath getDBFilePath() const;
|
||||
FilePath getTempDBFilePath() const;
|
||||
FilePath getBookmarkDBFilePath() const;
|
||||
|
||||
std::wstring getProjectName() const;
|
||||
FilePath getProjectDirectoryPath() const;
|
||||
|
||||
|
||||
@@ -88,6 +88,11 @@ void SourceGroupSettings::setStatus(SourceGroupStatusType status)
|
||||
m_status = status;
|
||||
}
|
||||
|
||||
const ProjectSettings* SourceGroupSettings::getProjectSettings() const
|
||||
{
|
||||
return m_projectSettings;
|
||||
}
|
||||
|
||||
FilePath SourceGroupSettings::getProjectDirectoryPath() const
|
||||
{
|
||||
return m_projectSettings->getProjectDirectoryPath();
|
||||
|
||||
@@ -5,14 +5,15 @@
|
||||
#include <vector>
|
||||
|
||||
#include "LanguageType.h"
|
||||
#include "SourceGroupSettingsBase.h"
|
||||
#include "SourceGroupStatusType.h"
|
||||
#include "SourceGroupType.h"
|
||||
|
||||
class ConfigManager;
|
||||
class FilePath;
|
||||
class ProjectSettings;
|
||||
|
||||
class SourceGroupSettings
|
||||
: virtual public SourceGroupSettingsBase
|
||||
{
|
||||
public:
|
||||
static const size_t s_version;
|
||||
@@ -40,7 +41,9 @@ public:
|
||||
SourceGroupStatusType getStatus() const;
|
||||
void setStatus(SourceGroupStatusType status);
|
||||
|
||||
const ProjectSettings* getProjectSettings() const override;
|
||||
FilePath getProjectDirectoryPath() const;
|
||||
|
||||
FilePath makePathExpandedAndAbsolute(const FilePath& path) const;
|
||||
std::vector<FilePath> makePathsExpandedAndAbsolute(const std::vector<FilePath>& paths) const;
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifndef SOURCE_GROUP_SETTINGS_BASE_H
|
||||
#define SOURCE_GROUP_SETTINGS_BASE_H
|
||||
|
||||
class ProjectSettings;
|
||||
|
||||
class SourceGroupSettingsBase
|
||||
{
|
||||
public:
|
||||
virtual ~SourceGroupSettingsBase() = default;
|
||||
|
||||
virtual const ProjectSettings* getProjectSettings() const = 0;
|
||||
};
|
||||
|
||||
#endif // SOURCE_GROUP_SETTINGS_BASE_H
|
||||
@@ -51,11 +51,6 @@ bool SourceGroupSettingsCEmpty::equals(std::shared_ptr<SourceGroupSettings> othe
|
||||
);
|
||||
}
|
||||
|
||||
const ProjectSettings* SourceGroupSettingsCEmpty::getProjectSettings() const
|
||||
{
|
||||
return m_projectSettings;
|
||||
}
|
||||
|
||||
std::vector<std::wstring> SourceGroupSettingsCEmpty::getDefaultSourceExtensions() const
|
||||
{
|
||||
return { L".c" };
|
||||
|
||||
@@ -27,7 +27,6 @@ public:
|
||||
bool equals(std::shared_ptr<SourceGroupSettings> other) const override;
|
||||
|
||||
private:
|
||||
const ProjectSettings* getProjectSettings() const override;
|
||||
std::vector<std::wstring> getDefaultSourceExtensions() const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -51,14 +51,9 @@ bool SourceGroupSettingsCppEmpty::equals(std::shared_ptr<SourceGroupSettings> ot
|
||||
);
|
||||
}
|
||||
|
||||
const ProjectSettings* SourceGroupSettingsCppEmpty::getProjectSettings() const
|
||||
{
|
||||
return m_projectSettings;
|
||||
}
|
||||
|
||||
std::vector<std::wstring> SourceGroupSettingsCppEmpty::getDefaultSourceExtensions() const
|
||||
{
|
||||
return {
|
||||
return {
|
||||
L".cpp",
|
||||
L".cxx",
|
||||
L".cc"
|
||||
|
||||
@@ -27,7 +27,6 @@ public:
|
||||
bool equals(std::shared_ptr<SourceGroupSettings> other) const override;
|
||||
|
||||
private:
|
||||
const ProjectSettings* getProjectSettings() const override;
|
||||
std::vector<std::wstring> getDefaultSourceExtensions() const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
#include "SourceGroupSettingsCustomCommand.h"
|
||||
|
||||
#include "ConfigManager.h"
|
||||
#include "FilePath.h"
|
||||
|
||||
SourceGroupSettingsCustomCommand::SourceGroupSettingsCustomCommand(
|
||||
const std::string& id, const ProjectSettings* projectSettings
|
||||
)
|
||||
: SourceGroupSettings(id, SOURCE_GROUP_CUSTOM_COMMAND, projectSettings)
|
||||
{
|
||||
}
|
||||
|
||||
std::shared_ptr<SourceGroupSettings> SourceGroupSettingsCustomCommand::createCopy() const
|
||||
{
|
||||
return std::make_shared<SourceGroupSettingsCustomCommand>(*this);
|
||||
}
|
||||
|
||||
void SourceGroupSettingsCustomCommand::load(std::shared_ptr<const ConfigManager> config)
|
||||
{
|
||||
SourceGroupSettings::load(config);
|
||||
|
||||
const std::string key = s_keyPrefix + getId();
|
||||
|
||||
SourceGroupSettingsWithSourceExtensions::load(config, key);
|
||||
SourceGroupSettingsWithSourcePaths::load(config, key);
|
||||
SourceGroupSettingsWithExcludeFilters::load(config, key);
|
||||
|
||||
setCustomCommand(config->getValueOrDefault(key + "/custom_command", std::wstring()));
|
||||
}
|
||||
|
||||
void SourceGroupSettingsCustomCommand::save(std::shared_ptr<ConfigManager> config)
|
||||
{
|
||||
SourceGroupSettings::save(config);
|
||||
|
||||
const std::string key = s_keyPrefix + getId();
|
||||
|
||||
SourceGroupSettingsWithSourceExtensions::save(config, key);
|
||||
SourceGroupSettingsWithSourcePaths::save(config, key);
|
||||
SourceGroupSettingsWithExcludeFilters::save(config, key);
|
||||
|
||||
config->setValue(key + "/custom_command", getCustomCommand());
|
||||
}
|
||||
|
||||
bool SourceGroupSettingsCustomCommand::equals(std::shared_ptr<SourceGroupSettings> other) const
|
||||
{
|
||||
std::shared_ptr<SourceGroupSettingsCustomCommand> otherCustom =
|
||||
std::dynamic_pointer_cast<SourceGroupSettingsCustomCommand>(other);
|
||||
|
||||
return (
|
||||
otherCustom &&
|
||||
SourceGroupSettings::equals(other) &&
|
||||
SourceGroupSettingsWithSourceExtensions::equals(otherCustom) &&
|
||||
SourceGroupSettingsWithSourcePaths::equals(otherCustom) &&
|
||||
SourceGroupSettingsWithExcludeFilters::equals(otherCustom)
|
||||
);
|
||||
}
|
||||
|
||||
const std::wstring& SourceGroupSettingsCustomCommand::getCustomCommand() const
|
||||
{
|
||||
return m_customCommand;
|
||||
}
|
||||
|
||||
void SourceGroupSettingsCustomCommand::setCustomCommand(const std::wstring& customCommand)
|
||||
{
|
||||
m_customCommand = customCommand;
|
||||
}
|
||||
|
||||
std::vector<std::wstring> SourceGroupSettingsCustomCommand::getDefaultSourceExtensions() const
|
||||
{
|
||||
return {};
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
#ifndef SOURCE_GROUP_SETTINGS_CUSTOM_COMMAND_H
|
||||
#define SOURCE_GROUP_SETTINGS_CUSTOM_COMMAND_H
|
||||
|
||||
#include "SourceGroupSettings.h"
|
||||
#include "SourceGroupSettingsWithExcludeFilters.h"
|
||||
#include "SourceGroupSettingsWithSourceExtensions.h"
|
||||
#include "SourceGroupSettingsWithSourcePaths.h"
|
||||
|
||||
class SourceGroupSettingsCustomCommand
|
||||
: public SourceGroupSettings
|
||||
, public SourceGroupSettingsWithExcludeFilters
|
||||
, public SourceGroupSettingsWithSourceExtensions
|
||||
, public SourceGroupSettingsWithSourcePaths
|
||||
{
|
||||
public:
|
||||
SourceGroupSettingsCustomCommand(const std::string& id, const ProjectSettings* projectSettings);
|
||||
|
||||
std::shared_ptr<SourceGroupSettings> createCopy() const override;
|
||||
|
||||
void load(std::shared_ptr<const ConfigManager> config) override;
|
||||
void save(std::shared_ptr<ConfigManager> config) override;
|
||||
|
||||
bool equals(std::shared_ptr<SourceGroupSettings> other) const override;
|
||||
|
||||
const std::wstring& getCustomCommand() const;
|
||||
void setCustomCommand(const std::wstring& customCommand);
|
||||
|
||||
private:
|
||||
std::vector<std::wstring> getDefaultSourceExtensions() const override;
|
||||
|
||||
std::wstring m_customCommand;
|
||||
};
|
||||
|
||||
#endif // SOURCE_GROUP_SETTINGS_CUSTOM_COMMAND_H
|
||||
@@ -65,8 +65,3 @@ void SourceGroupSettingsCxxCdb::setCompilationDatabasePath(const FilePath& compi
|
||||
{
|
||||
m_compilationDatabasePath = compilationDatabasePath;
|
||||
}
|
||||
|
||||
const ProjectSettings* SourceGroupSettingsCxxCdb::getProjectSettings() const
|
||||
{
|
||||
return m_projectSettings;
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@ public:
|
||||
void setCompilationDatabasePath(const FilePath& compilationDatabasePath);
|
||||
|
||||
private:
|
||||
const ProjectSettings* getProjectSettings() const override;
|
||||
|
||||
FilePath m_compilationDatabasePath;
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ void SourceGroupSettingsCxxCodeblocks::load(std::shared_ptr<const ConfigManager>
|
||||
SourceGroupSettingsWithExcludeFilters::load(config, key);
|
||||
SourceGroupSettingsWithIndexedHeaderPaths::load(config, key);
|
||||
SourceGroupSettingsWithSourceExtensions::load(config, key);
|
||||
|
||||
|
||||
setCodeblocksProjectPath(config->getValueOrDefault(key + "/codeblocks_project_path", FilePath(L"")));
|
||||
}
|
||||
|
||||
@@ -74,11 +74,6 @@ void SourceGroupSettingsCxxCodeblocks::setCodeblocksProjectPath(const FilePath&
|
||||
m_codeblocksProjectPath = compilationDatabasePath;
|
||||
}
|
||||
|
||||
const ProjectSettings* SourceGroupSettingsCxxCodeblocks::getProjectSettings() const
|
||||
{
|
||||
return m_projectSettings;
|
||||
}
|
||||
|
||||
std::vector<std::wstring> SourceGroupSettingsCxxCodeblocks::getDefaultSourceExtensions() const
|
||||
{
|
||||
return {
|
||||
|
||||
@@ -31,7 +31,6 @@ public:
|
||||
void setCodeblocksProjectPath(const FilePath& compilationDatabasePath);
|
||||
|
||||
private:
|
||||
const ProjectSettings* getProjectSettings() const override;
|
||||
std::vector<std::wstring> getDefaultSourceExtensions() const override;
|
||||
|
||||
FilePath m_codeblocksProjectPath;
|
||||
|
||||
@@ -44,8 +44,3 @@ bool SourceGroupSettingsCxxSonargraph::equals(std::shared_ptr<SourceGroupSetting
|
||||
SourceGroupSettingsWithSonargraphProjectPath::equals(otherCxxSonargraph)
|
||||
);
|
||||
}
|
||||
|
||||
const ProjectSettings* SourceGroupSettingsCxxSonargraph::getProjectSettings() const
|
||||
{
|
||||
return m_projectSettings;
|
||||
}
|
||||
|
||||
@@ -21,9 +21,6 @@ public:
|
||||
void save(std::shared_ptr<ConfigManager> config) override;
|
||||
|
||||
bool equals(std::shared_ptr<SourceGroupSettings> other) const override;
|
||||
|
||||
private:
|
||||
const ProjectSettings* getProjectSettings() const override;
|
||||
};
|
||||
|
||||
#endif // SOURCE_GROUP_SETTINGS_CXX_SONARGRAPH_H
|
||||
|
||||
@@ -41,8 +41,3 @@ bool SourceGroupSettingsJavaEmpty::equals(std::shared_ptr<SourceGroupSettings> o
|
||||
SourceGroupSettingsWithClasspath::equals(otherJava)
|
||||
);
|
||||
}
|
||||
|
||||
const ProjectSettings* SourceGroupSettingsJavaEmpty::getProjectSettings() const
|
||||
{
|
||||
return m_projectSettings;
|
||||
}
|
||||
|
||||
@@ -19,9 +19,6 @@ public:
|
||||
void save(std::shared_ptr<ConfigManager> config) override;
|
||||
|
||||
bool equals(std::shared_ptr<SourceGroupSettings> other) const override;
|
||||
|
||||
private:
|
||||
const ProjectSettings* getProjectSettings() const override;
|
||||
};
|
||||
|
||||
#endif // SOURCE_GROUP_SETTINGS_JAVA_EMPTY_H
|
||||
|
||||
@@ -90,8 +90,3 @@ void SourceGroupSettingsJavaGradle::setShouldIndexGradleTests(bool value)
|
||||
{
|
||||
m_shouldIndexGradleTests = value;
|
||||
}
|
||||
|
||||
const ProjectSettings* SourceGroupSettingsJavaGradle::getProjectSettings() const
|
||||
{
|
||||
return m_projectSettings;
|
||||
}
|
||||
|
||||
@@ -29,8 +29,6 @@ public:
|
||||
void setShouldIndexGradleTests(bool value);
|
||||
|
||||
private:
|
||||
const ProjectSettings* getProjectSettings() const override;
|
||||
|
||||
FilePath m_gradleProjectFilePath;
|
||||
FilePath m_gradleDependenciesDirectory;
|
||||
bool m_shouldIndexGradleTests;
|
||||
|
||||
@@ -90,8 +90,3 @@ void SourceGroupSettingsJavaMaven::setShouldIndexMavenTests(bool value)
|
||||
{
|
||||
m_shouldIndexMavenTests = value;
|
||||
}
|
||||
|
||||
const ProjectSettings* SourceGroupSettingsJavaMaven::getProjectSettings() const
|
||||
{
|
||||
return m_projectSettings;
|
||||
}
|
||||
|
||||
@@ -29,8 +29,6 @@ public:
|
||||
void setShouldIndexMavenTests(bool value);
|
||||
|
||||
private:
|
||||
const ProjectSettings* getProjectSettings() const override;
|
||||
|
||||
FilePath m_mavenProjectFilePath;
|
||||
FilePath m_mavenDependenciesDirectory;
|
||||
bool m_shouldIndexMavenTests;
|
||||
|
||||
@@ -44,8 +44,3 @@ bool SourceGroupSettingsJavaSonargraph::equals(std::shared_ptr<SourceGroupSettin
|
||||
SourceGroupSettingsWithSonargraphProjectPath::equals(otherJavaSonargraph)
|
||||
);
|
||||
}
|
||||
|
||||
const ProjectSettings* SourceGroupSettingsJavaSonargraph::getProjectSettings() const
|
||||
{
|
||||
return m_projectSettings;
|
||||
}
|
||||
|
||||
@@ -21,9 +21,6 @@ public:
|
||||
void save(std::shared_ptr<ConfigManager> config) override;
|
||||
|
||||
bool equals(std::shared_ptr<SourceGroupSettings> other) const override;
|
||||
|
||||
private:
|
||||
const ProjectSettings* getProjectSettings() const override;
|
||||
};
|
||||
|
||||
#endif // SOURCE_GROUP_SETTINGS_JAVA_SONARGRAPH_H
|
||||
|
||||
@@ -5,10 +5,12 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "SourceGroupSettingsBase.h"
|
||||
|
||||
class ConfigManager;
|
||||
class ProjectSettings;
|
||||
|
||||
class SourceGroupSettingsWithCStandard
|
||||
: virtual public SourceGroupSettingsBase
|
||||
{
|
||||
public:
|
||||
static std::wstring getDefaultCStandardStatic();
|
||||
@@ -28,7 +30,6 @@ protected:
|
||||
void save(std::shared_ptr<ConfigManager> config, const std::string& key);
|
||||
|
||||
private:
|
||||
virtual const ProjectSettings* getProjectSettings() const = 0;
|
||||
std::wstring getDefaultCStandard() const;
|
||||
|
||||
std::wstring m_cStandard;
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
#include <vector>
|
||||
|
||||
#include "FilePath.h"
|
||||
#include "SourceGroupSettingsBase.h"
|
||||
|
||||
class ConfigManager;
|
||||
class ProjectSettings;
|
||||
|
||||
class SourceGroupSettingsWithClasspath
|
||||
: virtual public SourceGroupSettingsBase
|
||||
{
|
||||
public:
|
||||
SourceGroupSettingsWithClasspath();
|
||||
@@ -30,8 +31,6 @@ protected:
|
||||
void save(std::shared_ptr<ConfigManager> config, const std::string& key);
|
||||
|
||||
private:
|
||||
virtual const ProjectSettings* getProjectSettings() const = 0;
|
||||
|
||||
std::vector<FilePath> m_classpath;
|
||||
bool m_useJreSystemLibrary;
|
||||
};
|
||||
|
||||
@@ -5,10 +5,12 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "SourceGroupSettingsBase.h"
|
||||
|
||||
class ConfigManager;
|
||||
class ProjectSettings;
|
||||
|
||||
class SourceGroupSettingsWithCppStandard
|
||||
: virtual public SourceGroupSettingsBase
|
||||
{
|
||||
public:
|
||||
static std::wstring getDefaultCppStandardStatic();
|
||||
@@ -28,7 +30,6 @@ protected:
|
||||
void save(std::shared_ptr<ConfigManager> config, const std::string& key);
|
||||
|
||||
private:
|
||||
virtual const ProjectSettings* getProjectSettings() const = 0;
|
||||
std::wstring getDefaultCppStandard() const;
|
||||
|
||||
std::wstring m_cppStandard;
|
||||
|
||||
@@ -5,10 +5,12 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "SourceGroupSettingsBase.h"
|
||||
|
||||
class ConfigManager;
|
||||
class ProjectSettings;
|
||||
|
||||
class SourceGroupSettingsWithCxxCrossCompilationOptions
|
||||
: virtual public SourceGroupSettingsBase
|
||||
{
|
||||
public:
|
||||
static std::vector<std::wstring> getAvailableArchTypes();
|
||||
@@ -43,8 +45,6 @@ protected:
|
||||
void save(std::shared_ptr<ConfigManager> config, const std::string& key);
|
||||
|
||||
private:
|
||||
virtual const ProjectSettings* getProjectSettings() const = 0;
|
||||
|
||||
bool m_targetOptionsEnabled;
|
||||
std::wstring m_targetArch;
|
||||
std::wstring m_targetVendor;
|
||||
|
||||
@@ -5,28 +5,29 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "SourceGroupSettingsBase.h"
|
||||
|
||||
class ConfigManager;
|
||||
class FilePathFilter;
|
||||
class ProjectSettings;
|
||||
|
||||
class SourceGroupSettingsWithExcludeFilters
|
||||
: virtual public SourceGroupSettingsBase
|
||||
{
|
||||
public:
|
||||
SourceGroupSettingsWithExcludeFilters();
|
||||
virtual ~SourceGroupSettingsWithExcludeFilters() = default;
|
||||
|
||||
|
||||
bool equals(std::shared_ptr<SourceGroupSettingsWithExcludeFilters> other) const;
|
||||
|
||||
std::vector<std::wstring> getExcludeFilterStrings() const;
|
||||
std::vector<FilePathFilter> getExcludeFiltersExpandedAndAbsolute() const;
|
||||
void setExcludeFilterStrings(const std::vector<std::wstring>& excludeFilters);
|
||||
|
||||
|
||||
protected:
|
||||
void load(std::shared_ptr<const ConfigManager> config, const std::string& key);
|
||||
void save(std::shared_ptr<ConfigManager> config, const std::string& key);
|
||||
|
||||
private:
|
||||
virtual const ProjectSettings* getProjectSettings() const = 0;
|
||||
std::vector<FilePathFilter> getFiltersExpandedAndAbsolute(const std::vector<std::wstring>& filterStrings) const;
|
||||
|
||||
std::vector<std::wstring> m_excludeFilters;
|
||||
|
||||
@@ -5,11 +5,13 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "SourceGroupSettingsBase.h"
|
||||
|
||||
class ConfigManager;
|
||||
class FilePath;
|
||||
class ProjectSettings;
|
||||
|
||||
class SourceGroupSettingsWithIndexedHeaderPaths
|
||||
: virtual public SourceGroupSettingsBase
|
||||
{
|
||||
public:
|
||||
SourceGroupSettingsWithIndexedHeaderPaths();
|
||||
@@ -26,8 +28,6 @@ protected:
|
||||
void save(std::shared_ptr<ConfigManager> config, const std::string& key);
|
||||
|
||||
private:
|
||||
virtual const ProjectSettings* getProjectSettings() const = 0;
|
||||
|
||||
std::vector<FilePath> m_indexedHeaderPaths;
|
||||
};
|
||||
|
||||
|
||||
@@ -5,10 +5,12 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "SourceGroupSettingsBase.h"
|
||||
|
||||
class ConfigManager;
|
||||
class ProjectSettings;
|
||||
|
||||
class SourceGroupSettingsWithJavaStandard
|
||||
: virtual public SourceGroupSettingsBase
|
||||
{
|
||||
public:
|
||||
static std::wstring getDefaultJavaStandardStatic();
|
||||
@@ -28,7 +30,6 @@ protected:
|
||||
void save(std::shared_ptr<ConfigManager> config, const std::string& key);
|
||||
|
||||
private:
|
||||
virtual const ProjectSettings* getProjectSettings() const = 0;
|
||||
std::wstring getDefaultJavaStandard() const;
|
||||
|
||||
std::wstring m_javaStandard;
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "SourceGroupSettingsBase.h"
|
||||
#include "FilePath.h"
|
||||
|
||||
class ConfigManager;
|
||||
class ProjectSettings;
|
||||
|
||||
class SourceGroupSettingsWithSonargraphProjectPath
|
||||
: virtual public SourceGroupSettingsBase
|
||||
{
|
||||
public:
|
||||
SourceGroupSettingsWithSonargraphProjectPath();
|
||||
@@ -26,8 +27,6 @@ protected:
|
||||
void save(std::shared_ptr<ConfigManager> config, const std::string& key);
|
||||
|
||||
private:
|
||||
virtual const ProjectSettings* getProjectSettings() const = 0;
|
||||
|
||||
FilePath m_sonargraphProjectPath;
|
||||
};
|
||||
|
||||
|
||||
@@ -5,27 +5,28 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "SourceGroupSettingsBase.h"
|
||||
|
||||
class ConfigManager;
|
||||
class FilePath;
|
||||
class ProjectSettings;
|
||||
|
||||
class SourceGroupSettingsWithSourceExtensions
|
||||
: virtual public SourceGroupSettingsBase
|
||||
{
|
||||
public:
|
||||
SourceGroupSettingsWithSourceExtensions();
|
||||
virtual ~SourceGroupSettingsWithSourceExtensions() = default;
|
||||
|
||||
|
||||
bool equals(std::shared_ptr<SourceGroupSettingsWithSourceExtensions> other) const;
|
||||
|
||||
std::vector<std::wstring> getSourceExtensions() const;
|
||||
void setSourceExtensions(const std::vector<std::wstring>& sourceExtensions);
|
||||
|
||||
|
||||
protected:
|
||||
void load(std::shared_ptr<const ConfigManager> config, const std::string& key);
|
||||
void save(std::shared_ptr<ConfigManager> config, const std::string& key);
|
||||
|
||||
private:
|
||||
virtual const ProjectSettings* getProjectSettings() const = 0;
|
||||
virtual std::vector<std::wstring> getDefaultSourceExtensions() const = 0;
|
||||
|
||||
std::vector<std::wstring> m_sourceExtensions;
|
||||
|
||||
@@ -5,16 +5,18 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "SourceGroupSettingsBase.h"
|
||||
|
||||
class ConfigManager;
|
||||
class FilePath;
|
||||
class ProjectSettings;
|
||||
|
||||
class SourceGroupSettingsWithSourcePaths
|
||||
: virtual public SourceGroupSettingsBase
|
||||
{
|
||||
public:
|
||||
SourceGroupSettingsWithSourcePaths();
|
||||
virtual ~SourceGroupSettingsWithSourcePaths() = default;
|
||||
|
||||
|
||||
bool equals(std::shared_ptr<SourceGroupSettingsWithSourcePaths> other) const;
|
||||
|
||||
std::vector<FilePath> getSourcePaths() const;
|
||||
@@ -26,8 +28,6 @@ protected:
|
||||
void save(std::shared_ptr<ConfigManager> config, const std::string& key);
|
||||
|
||||
private:
|
||||
virtual const ProjectSettings* getProjectSettings() const = 0;
|
||||
|
||||
std::vector<FilePath> m_sourcePaths;
|
||||
};
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ std::string sourceGroupTypeToString(SourceGroupType v)
|
||||
return "Java Source Group from Gradle";
|
||||
case SOURCE_GROUP_JAVA_SONARGRAPH:
|
||||
return "Java from Sonargraph";
|
||||
case SOURCE_GROUP_CUSTOM_COMMAND:
|
||||
return "Custom Command Source Group";
|
||||
case SOURCE_GROUP_UNKNOWN:
|
||||
break;
|
||||
}
|
||||
@@ -54,6 +56,8 @@ std::string sourceGroupTypeToProjectSetupString(SourceGroupType v)
|
||||
return "Java Source Group from Gradle";
|
||||
case SOURCE_GROUP_JAVA_SONARGRAPH:
|
||||
return "Java from Sonargraph";
|
||||
case SOURCE_GROUP_CUSTOM_COMMAND:
|
||||
return "Custom Command Source Group";
|
||||
case SOURCE_GROUP_UNKNOWN:
|
||||
break;
|
||||
}
|
||||
@@ -102,6 +106,10 @@ SourceGroupType stringToSourceGroupType(const std::string& v)
|
||||
{
|
||||
return SOURCE_GROUP_JAVA_SONARGRAPH;
|
||||
}
|
||||
else if (v == sourceGroupTypeToString(SOURCE_GROUP_CUSTOM_COMMAND))
|
||||
{
|
||||
return SOURCE_GROUP_CUSTOM_COMMAND;
|
||||
}
|
||||
|
||||
return SOURCE_GROUP_UNKNOWN;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ enum SourceGroupType
|
||||
SOURCE_GROUP_JAVA_MAVEN,
|
||||
SOURCE_GROUP_JAVA_GRADLE,
|
||||
SOURCE_GROUP_JAVA_SONARGRAPH,
|
||||
SOURCE_GROUP_CUSTOM_COMMAND,
|
||||
SOURCE_GROUP_UNKNOWN
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user