refactor Visual Studio file importing - #8803
Open
IOBYTE wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After many aborted attempts to add new features to the Visual Studio importers I came to the realization that the existing code was fundamentally flawed in 4 ways.
This PR collects all properties and metadata and simplifies them.
It simplifies and evaluates conditions when encountered.
It handles file paths properly by making them all absolute internally.
It handles self-referencing properties.
This is all done just like Visual studio and verified using MSBuild log files.
importVcxproj now only supports reading real files. The testVcxprojUnicode test in testimportproject.cpp passed a tinyxml2::XMLDocument to importVcxproj and
that required many hacks to make work. That test was moved to a real file in test/cli.
New tests were added for props files and for ForcedIncludeFiles. Support for many missing XML elements were added. The code is now simpler and just works with a lot more properties.
This refactor is about a 75% solution. Support for more uncommon Visual Studio stuff can be added later. Some things can never be implemented and some things can only be supported with a Visual Studio compiler installed on the machine and adding some way to tell cppcheck where it's installed. That's probably not worth the effort.
We still just ignore stuff that we can't handle. I would like to add support for generating debug message when we ignore things we don't understand so they can be fixed but that can be implemented later.