#include "SourceGroupJava.h" #include "IndexerCommandJava.h" #include "FileManager.h" #include "logging.h" #include "SourceGroupSettings.h" #include "SourceGroupSettingsWithExcludeFilters.h" #include "SourceGroupSettingsWithJavaStandard.h" #include "SourceGroupSettingsWithSourceExtensions.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(), dynamic_cast(getSourceGroupSettings().get())->getExcludeFiltersExpandedAndAbsolute(), dynamic_cast(getSourceGroupSettings().get())->getSourceExtensions() ); return fileManager.getAllSourceFilePaths(); } std::vector> SourceGroupJava::getIndexerCommands(const std::set& filesToIndex) const { const std::wstring languageStandard = dynamic_cast(getSourceGroupSettings().get())->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::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; }