#include "project/SourceGroupJava.h" #include "data/indexer/IndexerCommandJava.h" #include "settings/SourceGroupSettingsJava.h" #include "utility/file/FileManager.h" #include "utility/logging/logging.h" std::set SourceGroupJava::filterToContainedFilePaths(const std::set& filePaths) const { std::set containedFilePaths; const std::set allSourceFilePaths = getAllSourceFilePaths(); for (const FilePath& filePath : filePaths) { if (allSourceFilePaths.find(filePath) != allSourceFilePaths.end()) { containedFilePaths.insert(filePath); } } return containedFilePaths; } std::set SourceGroupJava::getAllSourceFilePaths() const { FileManager fileManager; fileManager.update( getAllSourcePaths(), getSourceGroupSettingsJava()->getExcludeFiltersExpandedAndAbsolute(), getSourceGroupSettingsJava()->getSourceExtensions() ); return fileManager.getAllSourceFilePaths(); } std::vector> SourceGroupJava::getIndexerCommands(const std::set& filesToIndex) const { const std::wstring languageStandard = getSourceGroupSettingsJava()->getJavaStandard(); std::vector classPath = getClassPath(); std::vector> indexerCommands; for (const FilePath& sourcePath: getAllSourceFilePaths()) { if (filesToIndex.find(sourcePath) != filesToIndex.end()) { indexerCommands.push_back(std::make_shared( sourcePath, languageStandard, classPath )); } } return indexerCommands; } std::shared_ptr SourceGroupJava::getSourceGroupSettings() { return getSourceGroupSettingsJava(); } std::shared_ptr SourceGroupJava::getSourceGroupSettings() const { return getSourceGroupSettingsJava(); } std::vector SourceGroupJava::getClassPath() const { LOG_INFO("Retrieving classpath for indexer commands"); std::vector classPath = doGetClassPath(); LOG_INFO("Found " + std::to_string(classPath.size()) + " paths for classpath."); return classPath; }