Feature/directory build props - #92
Merged
Merged
Conversation
This change centralizes dependency version management across the solution, improving consistency and simplifying updates. * Migrates all explicit package versions from individual `.csproj` files to `Directory.Packages.props`. * Updates `Directory.Build.props` to integrate with CPM and adjusts `Nuget.props` import conditions. * Adds `SuppressDependenciesWhenPacking` to optimize NuGet package output. * Updates the solution file to the latest Visual Studio version and corrects the `PackageLicenseFile` reference.
There was a problem hiding this comment.
Pull request overview
This PR centralizes NuGet package version management (including pinning Roslyn to 4.8.0 for older Visual Studio compatibility) and adds/updates build and test artifacts to enforce that pin.
Changes:
- Added
Directory.Packages.propsto centrally manage and pin package versions (notablyMicrosoft.CodeAnalysis.*to 4.8.0). - Updated MSBuild props/projects to rely on central versions and adjusted packaging/solution metadata.
- Added tests intended to enforce the Roslyn version pin and adjusted existing test/source artifacts.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Nuget.props | Updates NuGet metadata (license file name). |
| src/Directory.Packages.props | Adds central package version management and pins Roslyn versions. |
| src/Directory.Build.props | Updates packing/build props (including dependency suppression and Nuget.props import condition). |
| src/AutoFactories/AutoFactoriesAnalyzer.cs | Replaces collection expression with explicit array + ToImmutableArray() for compatibility. |
| src/AutoFactories/AutoFactories.csproj | Moves package references to central versioning and updates Roslyn references. |
| src/AutoFactories.Tests/Visitors/SyntaxHelperTests.cs | Cleans unused usings and fixes minor formatting. |
| src/AutoFactories.Tests/NinjectFactoryTests.PublicClass_SharedFactory.verified.txt | Removes BOM-only content from snapshot output. |
| src/AutoFactories.Tests/NinjectFactoryTests.PublicClass_PersonalFactory.verified.txt | Removes BOM-only content from snapshot output. |
| src/AutoFactories.Tests/NinjectFactoryTests.InternalClass_PersonalFactory.verified.txt | Removes BOM-only content from snapshot output. |
| src/AutoFactories.Tests/NinjectFactoryTests.Class_ExposeAs_ShowsInterface.verified.txt | Removes BOM-only content from snapshot output. |
| src/AutoFactories.Tests/MicrosoftDITests.PublicClass_SharedFactory.verified.txt | Removes BOM-only content from snapshot output. |
| src/AutoFactories.Tests/MicrosoftDITests.PublicClass_PersonalFactory.verified.txt | Removes BOM-only content from snapshot output. |
| src/AutoFactories.Tests/MicrosoftDITests.InternalClass_PersonalFactory.verified.txt | Removes BOM-only content from snapshot output. |
| src/AutoFactories.Tests/MicrosoftDITests.Class_ExposeAs_ShowsInterface.verified.txt | Removes BOM-only content from snapshot output. |
| src/AutoFactories.Tests/GenericFactoryTests.PublicClass_SharedFactory.verified.txt | Removes BOM-only content from snapshot output. |
| src/AutoFactories.Tests/GenericFactoryTests.PublicClass_PersonalFactory.verified.txt | Removes BOM-only content from snapshot output. |
| src/AutoFactories.Tests/GenericFactoryTests.InternalClass_PersonalFactory.verified.txt | Removes BOM-only content from snapshot output. |
| src/AutoFactories.Tests/GenericFactoryTests.Class_ExposeAs_ShowsInterface.verified.txt | Removes BOM-only content from snapshot output. |
| src/AutoFactories.Tests/Dependenices/VisualStudioCompatibility.cs | Adds compatibility-focused tests (Roslyn pin + embedded-resource check). |
| src/AutoFactories.Tests/CodeAnalysisVersionTests.cs | Adds a Roslyn version pin test. |
| src/AutoFactories.Tests/AutoFactories.Tests.csproj | Updates test project package references to use central package versions. |
| src/AutoFactories.sln | Updates solution items and updates Visual Studio version metadata. |
| src/AutoFactories.Ninject/AutoFactories.Ninject.csproj | Updates package refs to use central package versions and improves package description text. |
| src/AutoFactories.Microsoft.DependencyInjection/AutoFactories.Microsoft.DependencyInjection.csproj | Updates GitVersion package reference to use central versions and improves package description text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <IncludeBuildOutput>false</IncludeBuildOutput> | ||
| <GitVersionTargetFramework>net8.0</GitVersionTargetFramework> | ||
| <NoWarn>$(NoWarn);NU5128</NoWarn> | ||
| <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> |
Comment on lines
+3
to
+4
| # Visual Studio Version 18 | ||
| VisualStudioVersion = 18.9.12009.208 insiders |
| <PackageReference Include="Handlebars.Net.Helpers.Humanizer" /> | ||
| <PackageReference Include="Microsoft.CSharp" PrivateAssets="all" /> | ||
| <PackageReference Include="SourceGenerator.Foundations" /> | ||
| <!-- We pin the version [4.7.0] to ensure compatibility with Visual Studio 2022 --> |
| using SGF; | ||
| using System.Reflection; | ||
|
|
||
| namespace AutoFactories.Tests.Dependenices |
Comment on lines
+1
to
+5
| using FluentAssertions; | ||
| using Microsoft.CodeAnalysis.CSharp; | ||
| using SGF; | ||
| using System.Reflection; | ||
|
|
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.
Clamped CSHarp.CodeAnlysis to 4.8.0 to support older versions of Visual Studio and added a unit test to validate that it's clamped.