diff --git a/bin/test/data/log/test_log.txt b/bin/test/data/log/test_log.txt index 1f63597e..223d417e 100644 --- a/bin/test/data/log/test_log.txt +++ b/bin/test/data/log/test_log.txt @@ -1,5 +1,177 @@ ConfigManager.cpp WARNING: value path/to/nowhere is not present in config. ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. +ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config. Token.cpp ERROR: Location Id was not referenced by this Token. Node.cpp WARNING: Cannot change NodeType after it was already set from namespace to class Edge.cpp ERROR: Nodes are not plain copies. @@ -48,7 +220,20 @@ Edge.cpp ERROR: Nodes are not plain copies. NetworkProtocolHelper.cpp ERROR: Failed to parse message, invalid type token NetworkProtocolHelper.cpp ERROR: Failed to parse setActiveToken message, invalid token count Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_settings.xml +ConfigManager.cpp WARNING: value Bool is not present in config. +ConfigManager.cpp WARNING: value Int is not present in config. +ConfigManager.cpp WARNING: value Float is not present in config. +ConfigManager.cpp WARNING: value String is not present in config. Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_settings.xml +ConfigManager.cpp WARNING: value Bool is not present in config. +ConfigManager.cpp WARNING: value Int is not present in config. +ConfigManager.cpp WARNING: value Float is not present in config. +ConfigManager.cpp WARNING: value String is not present in config. +ConfigManager.cpp WARNING: value Bool is not present in config. +ConfigManager.cpp WARNING: value Int is not present in config. +ConfigManager.cpp WARNING: value Float is not present in config. +ConfigManager.cpp WARNING: value String is not present in config. +ConfigManager.cpp WARNING: value NewBool is not present in config. INFO: file: file.cpp < 0:0 0:0> TextAccess.cpp ERROR: Could not open file file.cpp INFO: typedef: type -> int @@ -150,7 +335,3 @@ TextAccess.cpp WARNING: Line numbers start with one, is 0 TextAccess.cpp WARNING: Line numbers start with one, is 0 TokenLocationCollection.cpp ERROR: Can't create TokenLocation with wrong boundaries. TokenLocationCollection.cpp ERROR: Can't create TokenLocation with wrong boundaries. -SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\bin\test\data/vsSolutionParserTestSuite/..\src\lib\utility\solution\SolutionParserCMake.cpp" -SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\bin\test\data/vsSolutionParserTestSuite/..\src\lib\utility\solution\SolutionParserCMake.h" -SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageShowFile.h" -SolutionParserVisualStudio.cpp WARNING: boost::filesystem::canonical: No such file or directory: "C:\Users\Manuel\FH\MSc\Masterproject\Project\src\lib\utility\messaging\type\MessageShowSnippets.h" diff --git a/deployment/windows/CoatiSetup/CoatiSetup/CoatiSetup.vdproj b/deployment/windows/CoatiSetup/CoatiSetup/CoatiSetup.vdproj index 948f0d76..a9b0ab93 100644 --- a/deployment/windows/CoatiSetup/CoatiSetup/CoatiSetup.vdproj +++ b/deployment/windows/CoatiSetup/CoatiSetup/CoatiSetup.vdproj @@ -3428,14 +3428,14 @@ "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:Coati" "ProductCode" = "8:{2A3B2FF5-A114-4CAB-88FB-DE8942D5B8EB}" - "PackageCode" = "8:{5D9BE539-F957-474F-BAA8-12F8EF1CC46A}" + "PackageCode" = "8:{C87131CC-CFB6-458C-BDD9-281ECEC192EF}" "UpgradeCode" = "8:{CFF09D53-87AF-4241-960D-98C21ED9D358}" "AspNetVersion" = "8:4.0.30319.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:TRUE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:0.1" + "ProductVersion" = "8:0.4" "Manufacturer" = "8:Coati Software" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:www.coati.io/support" diff --git a/deployment/windows/CoatiSetup/SetupCreateStartMenuShortcutLib/CreateStartMenuShortcut.cs b/deployment/windows/CoatiSetup/SetupCreateStartMenuShortcutLib/CreateStartMenuShortcut.cs index b4a32ec3..8fe3d832 100644 --- a/deployment/windows/CoatiSetup/SetupCreateStartMenuShortcutLib/CreateStartMenuShortcut.cs +++ b/deployment/windows/CoatiSetup/SetupCreateStartMenuShortcutLib/CreateStartMenuShortcut.cs @@ -42,7 +42,7 @@ namespace SetupCreateStartMenuShortcutLib } IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutAddress + _appShortcutName); - shortcut.Description = "Fast source code reading and navigation"; + shortcut.Description = "Fast source code navigation and visualization"; shortcut.TargetPath = app; shortcut.WorkingDirectory = appDirectory; shortcut.IconLocation = appDirectory + "data\\gui\\icon\\coati.ico"; diff --git a/deployment/windows/CoatiSetup/SetupRemoveCacheFiles/SetupRemoveCacheFiles.cs b/deployment/windows/CoatiSetup/SetupRemoveCacheFiles/SetupRemoveCacheFiles.cs index e7b017db..604df73e 100644 --- a/deployment/windows/CoatiSetup/SetupRemoveCacheFiles/SetupRemoveCacheFiles.cs +++ b/deployment/windows/CoatiSetup/SetupRemoveCacheFiles/SetupRemoveCacheFiles.cs @@ -35,7 +35,7 @@ namespace SetupRemoveCacheFiles { try { - string appDataCoatiPath = Environment.GetEnvironmentVariable("APPDATA") + "\\..\\local\\Coati Software\\Coati\\"; + string appDataCoatiPath = Environment.GetEnvironmentVariable("APPDATA") + "\\..\\local\\Coati Software"; // \\Coati\\"; Directory.Delete(appDataCoatiPath, true); } diff --git a/script/setup.sh b/script/setup.sh index a18bd5bb..fe78d3bd 100755 --- a/script/setup.sh +++ b/script/setup.sh @@ -67,3 +67,5 @@ if [ $PLATFORM == "Linux" ] || [ $PLATFORM == "MacOS" ]; then fi echo -e $SUCCESS "setup complete" + +sleep 5 diff --git a/src/lib/component/controller/IDECommunicationController.cpp b/src/lib/component/controller/IDECommunicationController.cpp index 3913f619..1e2ae6fa 100644 --- a/src/lib/component/controller/IDECommunicationController.cpp +++ b/src/lib/component/controller/IDECommunicationController.cpp @@ -92,7 +92,7 @@ void IDECommunicationController::handleCreateProjectMessage(const NetworkProtoco std::vector includePaths = parser.getIncludePaths(); std::vector projectItems = parser.getProjectItems(); - std::vector projectFPs; + /*std::vector projectFPs; std::vector includeFPs; for (unsigned int i = 0; i < projectItems.size(); i++) @@ -103,7 +103,7 @@ void IDECommunicationController::handleCreateProjectMessage(const NetworkProtoco for (unsigned int i = 0; i < includePaths.size(); i++) { includeFPs.push_back(FilePath(includePaths[i])); - } + }*/ /*ProjectSettings* projSettings = ProjectSettings::getInstance().get(); projSettings->clear(); diff --git a/src/lib/utility/solution/SolutionParserVisualStudio.cpp b/src/lib/utility/solution/SolutionParserVisualStudio.cpp index d8fb6c07..c26eb27d 100644 --- a/src/lib/utility/solution/SolutionParserVisualStudio.cpp +++ b/src/lib/utility/solution/SolutionParserVisualStudio.cpp @@ -73,6 +73,34 @@ std::vector SolutionParserVisualStudio::getProjectFiles() } std::vector SolutionParserVisualStudio::getProjectItems() +{ + std::vector projectItems = findProjectItems(); + + projectItems = makePathsCanonical(projectItems); + + return projectItems; +} + +std::vector SolutionParserVisualStudio::getIncludePaths() +{ + std::vector includePaths = findIncludePaths(); + + includePaths = makePathsCanonical(includePaths); + + return includePaths; +} + +std::vector SolutionParserVisualStudio::getProjectItemsNonCanonical() +{ + return findProjectItems(); +} + +std::vector SolutionParserVisualStudio::getIncludePathsNonCanonical() +{ + return findIncludePaths(); +} + +std::vector SolutionParserVisualStudio::findProjectItems() { std::vector projectItems; @@ -81,6 +109,12 @@ std::vector SolutionParserVisualStudio::getProjectItems() std::vector relativeProjectPaths; + std::vector validFileExtensions; + validFileExtensions.push_back(".c"); + validFileExtensions.push_back(".cpp"); + validFileExtensions.push_back(".h"); + validFileExtensions.push_back(".hpp"); + for (unsigned int i = 0; i < projectFilesNames.size(); i++) { size_t pos = projectFilesNames[i].find_last_of("/"); @@ -157,7 +191,10 @@ std::vector SolutionParserVisualStudio::getProjectItems() filePath = relativeProjectPaths[i] + "/" + filePath; } - projectItems.push_back(filePath); + if (checkValidFileExtension(filePath, validFileExtensions)) + { + projectItems.push_back(filePath); + } } } } @@ -167,17 +204,22 @@ std::vector SolutionParserVisualStudio::getProjectItems() projectItems = resolveEnvironmentVariables(projectItems); projectItems = makePathsAbsolute(projectItems); - projectItems = makePathsCanonical(projectItems); return projectItems; } -std::vector SolutionParserVisualStudio::getIncludePaths() +std::vector SolutionParserVisualStudio::findIncludePaths() { std::vector includePaths; std::vector projectFiles = getProjectFiles(); + std::vector validExtensions; + validExtensions.push_back(".c"); + validExtensions.push_back(".cpp"); + validExtensions.push_back(".h"); + validExtensions.push_back(".hpp"); + for (unsigned int i = 0; i < projectFiles.size(); i++) { TiXmlDocument doc; @@ -195,7 +237,9 @@ std::vector SolutionParserVisualStudio::getIncludePaths() for (unsigned int j = 0; j < nodes.size(); j++) { - includePaths.push_back(nodes[j]->GetText()); + std::string path = nodes[j]->GetText(); + + includePaths.push_back(path); } } @@ -206,11 +250,25 @@ std::vector SolutionParserVisualStudio::getIncludePaths() includePaths = resolveEnvironmentVariables(includePaths); includePaths = makePathsAbsolute(includePaths); - includePaths = makePathsCanonical(includePaths); return includePaths; } +bool SolutionParserVisualStudio::checkValidFileExtension(const std::string& file, const std::vector& validExtensions) +{ + for (unsigned int i = 0; i < validExtensions.size(); i++) + { + size_t pos = file.find(validExtensions[i]); + + if (pos != std::string::npos) + { + return true; + } + } + + return false; +} + std::vector SolutionParserVisualStudio::getProjectBlocks(const std::string& solution) const { std::vector blocks; @@ -596,6 +654,7 @@ std::vector SolutionParserVisualStudio::makePathsCanonical(const st } catch (std::exception& e) { + std::string what = e.what(); LOG_WARNING_STREAM(<< e.what()); } } diff --git a/src/lib/utility/solution/SolutionParserVisualStudio.h b/src/lib/utility/solution/SolutionParserVisualStudio.h index ef8b8e49..028a9a45 100644 --- a/src/lib/utility/solution/SolutionParserVisualStudio.h +++ b/src/lib/utility/solution/SolutionParserVisualStudio.h @@ -18,7 +18,15 @@ public: virtual std::vector getProjectItems(); virtual std::vector getIncludePaths(); + std::vector getProjectItemsNonCanonical(); // for testing purposes, paths returned are non canonical, don't use if you don't know what that means + std::vector getIncludePathsNonCanonical(); // for testing purposes, paths returned are non canonical, don't use if you don't know what that means + private: + std::vector findProjectItems(); + std::vector findIncludePaths(); + + bool checkValidFileExtension(const std::string& file, const std::vector& validExtensions); + std::vector getProjectBlocks(const std::string& solution) const; std::string getProjectFilePath(const std::string& projectBlock) const; diff --git a/src/lib_gui/qt/window/QtProjectSetupScreen.cpp b/src/lib_gui/qt/window/QtProjectSetupScreen.cpp new file mode 100644 index 00000000..dd70fc92 --- /dev/null +++ b/src/lib_gui/qt/window/QtProjectSetupScreen.cpp @@ -0,0 +1,368 @@ +#include "qt/window/QtProjectSetupScreen.h" + +#include +#include +#include +#include +#include + +#include "utility/messaging/type/MessageLoadProject.h" +#include "utility/utility.h" + +#include "settings/ProjectSettings.h" + +QtTextLine::QtTextLine(QWidget *parent) + : QWidget(parent) +{ + QBoxLayout* layout = new QHBoxLayout(); + layout->setSpacing(0); + layout->setContentsMargins(1, 1, 1, 1); + layout->setAlignment(Qt::AlignTop); + + setLayout(layout); + + m_data = new QtLineEdit(this); + m_data->setAttribute(Qt::WA_MacShowFocusRect, 0); + m_data->setObjectName("locationField"); + + m_button = new QPushButton("..."); + m_button->setObjectName("moreButton"); + + layout->addWidget(m_data); + layout->addWidget(m_button); + + connect(m_button, SIGNAL(clicked()), this, SLOT(handleButtonPress())); +} + +QString QtTextLine::getText() +{ + return m_data->text(); +} + +void QtTextLine::setText(QString text) +{ + m_data->setText(text); +} + +void QtTextLine::clearText() +{ + m_data->clear(); +} + +void QtTextLine::handleButtonPress() +{ + QString file = QFileDialog::getExistingDirectory(this, tr("Select Directory"), ""); + if (!file.isEmpty()) + { + m_data->setText(file); + } +} + +QtProjectSetupScreen::QtProjectSetupScreen(QWidget *parent) + : QtSettingsWindow(parent) + , m_frameworkPaths(nullptr) +{ +} + +QSize QtProjectSetupScreen::sizeHint() const +{ + return QSize(600,600); +} + +void QtProjectSetupScreen::clear() +{ + m_projectName->clear(); + m_projectFileLocation->clearText(); + + m_language->setCurrentIndex(0); + m_cppStandard->setCurrentIndex(0); + m_cStandard->setCurrentIndex(0); + + m_sourcePaths->clear(); + m_includePaths->clear(); + + if (m_frameworkPaths) + { + m_frameworkPaths->clear(); + } +} + +void QtProjectSetupScreen::setup() +{ + setupForm(); + + QPushButton* preferencesButton = new QPushButton("Preferences"); + preferencesButton->setObjectName("windowButton"); + connect(preferencesButton, SIGNAL(clicked()), this, SLOT(handlePreferencesButtonPress())); + + m_buttonsLayout->insertWidget(2, preferencesButton); + m_buttonsLayout->insertStretch(3); +} + +void QtProjectSetupScreen::loadEmpty() +{ + updateTitle("NEW PROJECT"); + updateDoneButton("Create"); + + clear(); +} + +void QtProjectSetupScreen::loadProjectSettings() +{ + updateTitle("EDIT PROJECT"); + updateDoneButton("Save"); + + ProjectSettings* projSettings = ProjectSettings::getInstance().get(); + + m_projectName->setText(QString::fromStdString(projSettings->getFilePath().withoutExtension().fileName())); + m_projectFileLocation->setText(QString::fromStdString(projSettings->getFilePath().parentDirectory().str())); + + if (projSettings->getLanguage().length() > 0) + { + m_language->setCurrentText(QString::fromStdString(projSettings->getLanguage())); + } + if (projSettings->getStandard().length() > 0) + { + if (m_language->currentIndex() == 0) // c++ + { + m_cppStandard->setCurrentText(QString::fromStdString(projSettings->getStandard())); + } + else if (m_language->currentIndex() == 1) // c + { + m_cStandard->setCurrentText(QString::fromStdString(projSettings->getStandard())); + } + } + + m_sourcePaths->setList(projSettings->getSourcePaths()); + m_includePaths->setList(projSettings->getHeaderSearchPaths()); + + if (m_frameworkPaths) + { + m_frameworkPaths->setList(projSettings->getFrameworkSearchPaths()); + } +} + +void QtProjectSetupScreen::setPresets(const std::string& name, const std::string& location, + const std::vector& sourceFiles, const std::vector& includePaths) +{ + m_projectName->setText(QString::fromStdString(name)); + m_projectFileLocation->setText(QString::fromStdString(location)); + + std::vector sourceFilePaths; + for (unsigned int i = 0; i < sourceFiles.size(); i++) + { + sourceFilePaths.push_back(FilePath(sourceFiles[i])); + } + + std::vector includePathsPaths; + for (unsigned int i = 0; i < includePaths.size(); i++) + { + includePathsPaths.push_back(FilePath(includePaths[i])); + } + + m_sourcePaths->setList(sourceFilePaths); + m_includePaths->setList(includePathsPaths); +} + +void QtProjectSetupScreen::populateForm(QFormLayout* layout) +{ + int minimumWidthForSecondCol = 360; + + QLabel* nameLabel = new QLabel("Name"); + m_projectName = new QLineEdit(); + m_projectName->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); + m_projectName->setMinimumWidth(minimumWidthForSecondCol); + m_projectName->setAttribute(Qt::WA_MacShowFocusRect, 0); + layout->addRow(nameLabel, m_projectName); + + QLabel* locationLabel = new QLabel("Location"); + m_projectFileLocation = new QtTextLine(this); + m_projectFileLocation->setMinimumWidth(minimumWidthForSecondCol); + layout->addRow(locationLabel, m_projectFileLocation); + + QLabel* languageLabel = new QLabel("Language"); + m_language = new QComboBox(); + m_language->insertItem(0, "C++"); + m_language->insertItem(1, "C"); + connect(m_language, SIGNAL(currentIndexChanged(int)), this, SLOT(handleSelectionChanged(int))); + layout->addRow(languageLabel, m_language); + + m_cppStandardLabel = new QLabel("Standard"); + + m_cppStandard = new QComboBox(); + m_cppStandard->insertItem(0, "1z"); + m_cppStandard->insertItem(1, "14"); + m_cppStandard->insertItem(2, "1y"); + m_cppStandard->insertItem(3, "11"); + m_cppStandard->insertItem(4, "0x"); + m_cppStandard->insertItem(5, "03"); + m_cppStandard->insertItem(6, "98"); + layout->addRow(m_cppStandardLabel, m_cppStandard); + + + m_cStandardLabel = new QLabel("Standard"); + + m_cStandard = new QComboBox(); + m_cStandard->insertItem(0, "1x"); + m_cStandard->insertItem(1, "11"); + m_cStandard->insertItem(2, "9x"); + m_cStandard->insertItem(3, "99"); + m_cStandard->insertItem(4, "90"); + m_cStandard->insertItem(5, "89"); + layout->addRow(m_cStandardLabel, m_cStandard); + m_cStandardLabel->hide(); + m_cStandard->hide(); + + QPushButton* helpButton; + + QWidget* sourcePathsWidget = createLabelWithHelpButton("Analyzed Paths", &helpButton); + connect(helpButton, SIGNAL(clicked()), this, SLOT(handleSourcePathHelpPress())); + m_sourcePaths = new QtDirectoryListBox(this); + m_sourcePaths->setMinimumWidth(minimumWidthForSecondCol); + layout->addRow(sourcePathsWidget, m_sourcePaths); + + QWidget* includePathsWidget = createLabelWithHelpButton("Header\nSearch Paths", &helpButton); + connect(helpButton, SIGNAL(clicked()), this, SLOT(handleIncludePathHelpPress())); + m_includePaths = new QtDirectoryListBox(this); + m_includePaths->setMinimumWidth(minimumWidthForSecondCol); + layout->addRow(includePathsWidget, m_includePaths); + + if (QSysInfo::macVersion() != QSysInfo::MV_None) + { + QWidget* frameworkPathsWidget = createLabelWithHelpButton("Framework\nSearch Paths", &helpButton); + connect(helpButton, SIGNAL(clicked()), this, SLOT(handleFrameworkPathHelpPress())); + m_frameworkPaths = new QtDirectoryListBox(this); + m_frameworkPaths->setMinimumWidth(minimumWidthForSecondCol); + layout->addRow(frameworkPathsWidget, m_frameworkPaths); + } +} + +void QtProjectSetupScreen::handleCancelButtonPress() +{ + emit canceled(); +} + +void QtProjectSetupScreen::handleUpdateButtonPress() +{ + if (m_projectName->text().isEmpty()) + { + QMessageBox msgBox; + msgBox.setText("Please enter a project name."); + msgBox.exec(); + return; + } + + if (m_projectFileLocation->getText().isEmpty()) + { + QMessageBox msgBox; + msgBox.setText("Please define the location of the project file."); + msgBox.exec(); + return; + } + + if (!m_sourcePaths->getList().size()) + { + QMessageBox msgBox; + msgBox.setText("Please add at least one source path to your project."); + msgBox.exec(); + return; + } + + + std::shared_ptr projectSettings = ProjectSettings::getInstance(); + + std::string newLanguage = m_language->currentText().toStdString(); + + std::string newStandard = ""; + if (m_cppStandard->isVisible()) + { + newStandard = m_cppStandard->currentText().toStdString(); + } + else if (m_cStandard->isVisible()) + { + newStandard = m_cStandard->currentText().toStdString(); + } + + std::vector newSourcePaths = m_sourcePaths->getList(); + std::vector newHeaderSearchPaths = m_includePaths->getList(); + std::vector newFrameworkPaths = m_frameworkPaths ? m_frameworkPaths->getList() : std::vector(); + + bool somethingChanged = !( + newLanguage == projectSettings->getLanguage() && + newStandard == projectSettings->getStandard() && + utility::isPermutation(newSourcePaths, projectSettings->getSourcePaths()) && + utility::isPermutation(newHeaderSearchPaths, projectSettings->getHeaderSearchPaths()) && + utility::isPermutation(newFrameworkPaths, projectSettings->getFrameworkSearchPaths()) + ); + + projectSettings->clear(); + projectSettings->setLanguage(newLanguage); + projectSettings->setStandard(newStandard); + projectSettings->setSourcePaths(newSourcePaths); + projectSettings->setHeaderSearchPaths(newHeaderSearchPaths); + projectSettings->setFrameworkSearchPaths(newFrameworkPaths); + + std::string projectFilePath = + m_projectFileLocation->getText().toStdString() + "/" + m_projectName->text().toStdString() + ".coatiproject"; + + projectSettings->save(projectFilePath); + + if (m_title->text() == "NEW PROJECT") + { + MessageLoadProject(projectFilePath, false).dispatch(); + } + else if (somethingChanged) + { + MessageLoadProject(projectFilePath, true).dispatch(); + } + emit finished(); +} + +void QtProjectSetupScreen::handleSourcePathHelpPress() +{ + showHelpMessage( + "Analyzed Paths define the source files and directories that will be analysed by Coati. Usually these are the source " + "and header files of your project or a subset of them." + ); +} + +void QtProjectSetupScreen::handleIncludePathHelpPress() +{ + showHelpMessage( + "Header Search Paths define where additional headers, that your project depends on, are found. Usually they are " + "header files of frameworks or libraries that your project uses. These files won't be analysed, but Coati needs " + "them for correct analysis.\n\n" + "Please note that you can define Header Search Paths for all your projects in Coati's preferences." + ); +} + +void QtProjectSetupScreen::handleFrameworkPathHelpPress() +{ + showHelpMessage( + "Framework Search Paths define where MacOS framework containers, that your project depends on, are found.\n\n" + "Please note that you can define Framework Search Paths for all your projects in Coati's preferences." + ); +} + +void QtProjectSetupScreen::handlePreferencesButtonPress() +{ + emit showPreferences(); +} + +void QtProjectSetupScreen::handleSelectionChanged(int index) +{ + if (index != 0) + { + m_cStandardLabel->show(); + m_cStandard->show(); + m_cppStandardLabel->hide(); + m_cppStandard->hide(); + } + else + { + m_cppStandardLabel->show(); + m_cppStandard->show(); + m_cStandardLabel->hide(); + m_cStandard->hide(); + } +} diff --git a/src/test/VsSolutionParserTestSuite.h b/src/test/VsSolutionParserTestSuite.h index d98f85d5..8f9fc8ad 100644 --- a/src/test/VsSolutionParserTestSuite.h +++ b/src/test/VsSolutionParserTestSuite.h @@ -45,7 +45,7 @@ public: { SolutionParserVisualStudio parser; parser.openSolutionFile("data/vsSolutionParserTestSuite/Coati.sln"); - std::vector includePaths = parser.getIncludePaths(); + std::vector includePaths = parser.getIncludePathsNonCanonical(); TS_ASSERT_EQUALS(23, includePaths.size()); } @@ -54,8 +54,8 @@ public: { SolutionParserVisualStudio parser; parser.openSolutionFile("data/vsSolutionParserTestSuite/Coati.sln"); - std::vector projectItems = parser.getProjectItems(); + std::vector projectItems = parser.getProjectItemsNonCanonical(); - TS_ASSERT_EQUALS(447, projectItems.size()); + TS_ASSERT_EQUALS(450, projectItems.size()); } }; \ No newline at end of file