wpf
wpf copied to clipboard
Fix MilCodeGen
Description
This PR aims to fix MilCodeGen which seems to be very outdated and it doesn't seem like it ever worked in this repo (It probably worked in the internal repo for Microsoft).
Since it does not seem like it ever worked, I did these changes just by deducing how it's supposed to work so this PR might be totally wrong.
I noticed a couple of changes in the generated code other than white-space and license header where I don't know whether the source of truth is the new generated code or the existing generated code (It's mostly comments that differ between both).
This PR unblocks PRs like this one: #5651.
Customer Impact
None.
Regression
No.
Testing
I tested this fix locally using this command build -projects "src\Microsoft.DotNet.Wpf\src\WpfGfx\codegen\mcg\mcg.proj"
and by looking at the changes and doing a normal build afterwards.
Risk
I think the risk is pretty low since it's only used for development in this repo and the worse that can happen is to be unable to run MilCodeGen (It didn't work before this PR so it can only be an improvement). All the generated code is checked out in Git so it's easier to validate that the generated code is good.
You stole my next target 😄
I pushed a bunch of commit to try to reduce the diff but I couldn't reduce it much further because the bulk of the changes in generated code come from whitespace added because of conditional code which adds an empty line (Example: This code generates these whitespaces).
With 308 changed files it's almost impossible to understand what has changed :/
@kant2002 @omariom Sorry about the delay, I forgot about this PR. All the files are generated using MilCodeGen without any modifications by hand so all the changes are necessary.
It looks like a lot of generated files were formatted when adding the files to this repo. For example, TextDecorationCollection from referencesource.microsoft.com is a lot closer to this repo with the changes in this PR than without this PR. TextDecorationCollection in this repo with the changes in this PR vs TextDecorationCollection in this repo without the changes in this PR. TextDecorationCollection did not change since the initial commit of PresentationCore.
I rebased, fixed the conflicts and synced MilCodeGen to the generated code since changes to generated files was merged into main.
@dotnet/wpf-developers: Could this be considered for the next test pass ? MilCodeGen is outdated compared to the generated files in the main branch because generated files get changed manually because we cannot run MilCodeGen.