autofac / Autofac

An addictive .NET IoC container
https://autofac.org
MIT License
4.48k stars 836 forks source link

Convert strongly-typed resource generation to MSBuild #1354

Closed tillig closed 1 year ago

tillig commented 1 year ago

This updates core Autofac to use the cross-platform VS + VS Code capable .resx => .Designer.cs generation. It sets MSBuild as the mechanism for generating the resources and adds a dependency to the build to ensure OmniSharp (VS Code) will generate the same way VS does. If VS detects it needs to run a build, it will; and the outcome will be the same in both VS and VS Code.

.Designer.cs files are removed and .gitignored so they can always be generated into the obj folder. Note you can't generate into subfolders of obj without manually creating those file paths, which I didn't do. Luckily, all of our .resx files have different names, so there were no conflicts and everything can be generated into the same obj folder (but in different namespaces as needed).

This is slightly different than the Autofac.Mef updates I recently made, in that we no longer need the weird <Compile Remove> directive - I learned a bit more since then and found how to make it better. I have a blog article that talks about it. I'll have to go back and fix the MEF library after this.

codecov[bot] commented 1 year ago

Codecov Report

Base: 77.99% // Head: 77.99% // No change to project coverage :thumbsup:

Coverage data is based on head (302964e) compared to base (58e297d). Patch has no changes to coverable lines.

:exclamation: Current head 302964e differs from pull request most recent head a7addde. Consider uploading reports for the commit a7addde to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1354 +/- ## ======================================== Coverage 77.99% 77.99% ======================================== Files 195 195 Lines 5590 5590 Branches 1119 1119 ======================================== Hits 4360 4360 Misses 716 716 Partials 514 514 ``` Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autofac). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=autofac)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

tillig commented 1 year ago

Looks awesome! I can't approve my own PR so I'll just click the "MAKE IT GO" button. :)