MSBuild modernization: Central Package Management and project cleanup#1656
Open
ViktorHofer wants to merge 6 commits intodevlooped:mainfrom
Open
MSBuild modernization: Central Package Management and project cleanup#1656ViktorHofer wants to merge 6 commits intodevlooped:mainfrom
ViktorHofer wants to merge 6 commits intodevlooped:mainfrom
Conversation
Create Directory.Packages.props to centralize all NuGet package versions in a single file, eliminating version duplication across 4 project files. - Add src/Directory.Packages.props with all package versions - Remove Version attributes from PackageReference items in all projects - Suppress NU1507 warning for multiple package sources with CPM Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
NuGetizer is a build-time tool that should not flow as a transitive dependency to package consumers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Directory.Build.props already sets LangVersion=Latest globally. The per-project LangVersion=10.0 overrides were unnecessarily pinning to an older C# version. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Directory.Build.props already sets DebugType=embedded and DebugSymbols=true globally. The per-project overrides to portable were redundant. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace Regex::IsMatch property function calls with simpler String.Contains() for conditional feature detection. Both are functionally equivalent for these patterns but Contains() is more readable and avoids regex overhead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ld.targets Move the duplicated FEATURE_DEFAULT_INTERFACE_IMPLEMENTATIONS conditional from Moq.csproj and Moq.Tests.csproj into Directory.Build.targets, covering all relevant TFMs (netstandard2.1, net6.0, net8.0) in a single location. Placed in .targets (not .props) because TargetFramework is not available in .props for single-targeting projects. Uses Language property for VB delimiter handling. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
Note for reviewer. This PR was created automatically by gh copilot cli to test our new msbuild skills (not yet shipping): https://github.com/ViktorHofer/dotnet-skills |
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.
Summary
Modernizes the MSBuild infrastructure with Central Package Management and removes redundant/duplicated configuration from project files.
Changes
1. Implement Central Package Management
src/Directory.Packages.propscentralizing all 16 package versionsVersionattributes from PackageReference items across all 4 projects2. Add PrivateAssets to NuGetizer
3. Remove hardcoded LangVersion
Moq.csprojandMoq.Tests.csprojpinnedLangVersion=10.0, overriding the globalLatestfromDirectory.Build.props4. Remove redundant DebugSymbols/DebugType from test projects
DebugSymbols=TrueandDebugType=portable, butDirectory.Build.propsalready sets these globally5. Simplify feature flag conditions
Regex::IsMatchproperty function calls with simplerString.Contains()for conditional feature detection inMoq.Tests.csproj6. Centralize FEATURE_DEFAULT_INTERFACE_IMPLEMENTATIONS
Moq.csprojandMoq.Tests.csprojintoDirectory.Build.targets.targets(not.props) becauseTargetFrameworkis not available in.propsfor single-targeting projectsVerification
All changes verified with clean
dotnet build(0 warnings, 0 errors).