Chore: Directory.Build.props/Directory.Packages.props CPM#339
Conversation
There was a problem hiding this comment.
Pull request overview
This PR consolidates .NET build configuration and NuGet dependencies across the repository by introducing centralized MSBuild properties (Directory.Build.props) and Central Package Management (Directory.Packages.props), with scoped overrides for test/ and individual sampleapps/ projects.
Changes:
- Add repo-wide
Directory.Build.propsandDirectory.Packages.propsto centralize TargetFramework/LangVersion and package versions. - Add scoped
Directory.Build.props/Directory.Packages.propsundersrc/,test/, andsampleapps/to reduce repeated per-project boilerplate. - Remove per-project package version pins and duplicated build properties in affected
.csprojfiles.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| Directory.Build.props | Introduces global MSBuild properties (TFM, LangVersion, CPM enablement). |
| Directory.Packages.props | Adds master Central Package Management package versions/properties. |
| src/Directory.Build.props | Centralizes common library packaging metadata, signing, and SourceLink for src/ projects. |
| src/AWS.Messaging/AWS.Messaging.csproj | Removes duplicated metadata/signing/package versions in favor of centralized props/CPM. |
| src/AWS.Messaging.Telemetry.OpenTelemetry/AWS.Messaging.Telemetry.OpenTelemetry.csproj | Removes duplicated metadata/signing/package versions in favor of centralized props/CPM. |
| src/AWS.Messaging.Lambda/AWS.Messaging.Lambda.csproj | Removes duplicated metadata/signing/package versions in favor of centralized props/CPM. |
| test/Directory.Build.props | Adds shared test-project properties (not packable, nullable, signing). |
| test/Directory.Packages.props | Adds test-scoped CPM versions and imports master versions. |
| test/AWS.Messaging.UnitTests/AWS.Messaging.UnitTests.csproj | Removes local package versions/properties in favor of CPM + test props. |
| test/AWS.Messaging.Tests.LambdaFunctions/AWS.Messaging.Tests.LambdaFunctions.csproj | Removes local package versions/properties in favor of CPM + test props. |
| test/AWS.Messaging.Tests.Common/AWS.Messaging.Tests.Common.csproj | Removes local package versions/properties in favor of CPM + test props. |
| test/AWS.Messaging.IntegrationTests/AWS.Messaging.IntegrationTests.csproj | Removes local package versions/properties in favor of CPM + test props. |
| test/AWS.Messaging.Benchmarks/AWS.Messaging.Benchmarks.csproj | Removes local package versions/properties in favor of CPM + test props. |
| sampleapps/Directory.Build.props | Adds shared sample-app properties (nullable + implicit usings) and imports global props. |
| sampleapps/SubscriberService/SubscriberService.csproj | Removes local package versions/properties in favor of CPM + sampleapps props. |
| sampleapps/SubscriberService/Directory.Packages.props | Adds sample-scoped CPM overrides and imports master versions. |
| sampleapps/PublisherAPI/PublisherAPI.csproj | Removes local package versions/properties in favor of CPM + sampleapps props. |
| sampleapps/PublisherAPI/Directory.Packages.props | Adds sample-scoped CPM overrides and imports master versions. |
| sampleapps/PollyIntegration/PollyIntegration.csproj | Removes local package versions/properties in favor of CPM + sampleapps props. |
| sampleapps/PollyIntegration/Directory.Packages.props | Adds sample-scoped CPM overrides and imports master versions. |
| sampleapps/LambdaMessaging/LambdaMessaging.csproj | Removes local package versions/properties in favor of CPM + sampleapps props. |
| sampleapps/LambdaMessaging/Directory.Packages.props | Adds sample-scoped CPM overrides and imports master versions. |
| sampleapps/AppHost/AppHost.csproj | Removes local package versions/properties in favor of CPM + sampleapps props. |
| sampleapps/AppHost/Directory.Packages.props | Adds sample-scoped CPM overrides and imports master versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <TargetFramework>net8.0</TargetFramework> | ||
| <LangVersion>12</LangVersion> | ||
| <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> | ||
| <CentralPackageFloatingVersionsEnabled>true</CentralPackageFloatingVersionsEnabled> |
There was a problem hiding this comment.
i think this is safe to ignore
There was a problem hiding this comment.
Well copilot is right, technically it's a bad practice since you don't have explicit version on package release and execution of same pipeline is not strictly reproducible. I have enabled it to have 1:1 behavior for now but it should eventually get removed and replaced with fixed versions.
| <Project> | ||
| <!-- Central Package Management - Master File --> | ||
| <PropertyGroup> | ||
| <MicrosoftExtensionsVersion>8.0.*</MicrosoftExtensionsVersion> |
There was a problem hiding this comment.
this is fine i think. the existing code has
<PackageReference Include="AWSSDK.EventBridge" Version="4.0.5.16" />
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.3.23" />
<PackageReference Include="AWSSDK.SimpleNotificationService" Version="4.0.2.17" />
<PackageReference Include="AWSSDK.SQS" Version="4.0.2.15" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.*" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.*" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.*" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.*" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.*" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
thanks for the PR @JanHyka ! |
| @@ -0,0 +1,25 @@ | |||
| { | |||
There was a problem hiding this comment.
we don't need a change file for this change. We are not introducing a customer facing change.
Issue #, if available:
n/a
Description of changes:
Current repository has several gaps across solutions:
Changes:
Purpose of change: cleanup, consolidation, preparation to ease migrate to .NET10/LangVersion 14 within next months (.NET8 LTS expires Nov 2026)
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.