clang-power-tools
clang-power-tools copied to clipboard
Use Microsoft.Build.Evaluation.Project to parse and evaluate MSVC++ project files
Not sure if it's been considered before, but MSBuild has a managed code API for parsing MSVC++ project files that would ease the amount of work that the Powershell scripts have to do. The main benefit of using this is that you will get the exact same evaluation and transformation of build variables that you get when normally compiling in Visual Studio. I believe this would fix most of the bugs people have with certain variables not expanding correctly, or not being able to have variables for each source file.
Take a look at the documentation:
https://docs.microsoft.com/en-us/dotnet/api/microsoft.build.evaluation.project?view=netframework-4.7.2
You just load a Project file and then iterate over the project items. No need to mess with the XML directly.
Hi,
Of course we considered it 😀
This would not be easy to do, as it would involve a complete rewrite of our PowerShell script.
Not to mention that we would need to re-test everything 😱
We always considered this path as Plan B. When our current strategy breaks down, we'll revisit the issue.
If you want to fork the project and try out this experiment, we will gladly accept the patch, if it proves-out to be working and supports all current scenarios 😉 Seriously !
Thanks.