Skip to content

Feature/directory build props - #92

Merged
ByronMayne merged 3 commits into
masterfrom
feature/directory-build-props
Jul 20, 2026
Merged

Feature/directory build props#92
ByronMayne merged 3 commits into
masterfrom
feature/directory-build-props

Conversation

@ByronMayne

@ByronMayne ByronMayne commented Jul 20, 2026

Copy link
Copy Markdown
Owner

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.

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.
Copilot AI review requested due to automatic review settings July 20, 2026 14:21
@ByronMayne
ByronMayne merged commit 2158365 into master Jul 20, 2026
4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.props to centrally manage and pin package versions (notably Microsoft.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.

Comment thread src/Directory.Build.props
<IncludeBuildOutput>false</IncludeBuildOutput>
<GitVersionTargetFramework>net8.0</GitVersionTargetFramework>
<NoWarn>$(NoWarn);NU5128</NoWarn>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
Comment thread src/AutoFactories.sln
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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants