Repository navigation
Commit 15786e4
authored
refactor Visual Studio file importing (#8803)
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.
1. We didn't collect all properties and metadata in the variables map.
2. We didn't evaluate all conditions as we encountered them.
3. We didn't handle paths properly.
4. We didn't support self-referencing properties.
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.1 parent 746b3a7 commit 15786e4
131 files changed
Lines changed: 9217 additions & 975 deletions
File tree
- lib
- oss-fuzz
- test
- cli
- props-dirs
- ProjA
- ProjB
- common
- slnx-folders
- vcxproj-unicode
- vcxproj_choose
- vcxproj_directory_build_disabled
- vcxproj_directory_build_path
- vcxproj_discover_choose
- vcxproj_discover_property_path
- Debug
- vcxproj_duplicate_import
- vcxproj_forced_includes
- vcxproj_import_condition
- vcxproj_import_graph
- vcxproj_import_wildcard
- ImportBefore
- vcxproj_include_dir_macro
- RealInc
- vcxproj_item_absolute_drive_path
- vcxproj_item_condition
- vcxproj_item_macro_path_case_builtin
- vcxproj_item_macro_path_case_invariant
- SameCaseDir
- vcxproj_item_macro_path_case_variant
- DebugCaseDir
- ReleaseCaseDir
- vcxproj_item_macro_path_env
- EnvLibRoot
- vcxproj_item_macro_path_hyphen
- HyphenDir
- vcxproj_item_macro_path_invariant
- ExternalLibRoot
- vcxproj_item_macro_path_missing_config
- DebugDir
- vcxproj_item_macro_path
- SomeDir
- vcxproj_metadata_self_reference_case
- vcxproj_property_order
- vcxproj_split_configs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
615 | 615 | | |
616 | 616 | | |
617 | 617 | | |
618 | | - | |
| 618 | + | |
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
| |||
819 | 819 | | |
820 | 820 | | |
821 | 821 | | |
822 | | - | |
| 822 | + | |
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
| |||
0 commit comments