Skip to content

Chore: Directory.Build.props/Directory.Packages.props CPM#339

Open
JanHyka wants to merge 9 commits into
aws:devfrom
JanHyka:janhyka/chore_cpm
Open

Chore: Directory.Build.props/Directory.Packages.props CPM#339
JanHyka wants to merge 9 commits into
aws:devfrom
JanHyka:janhyka/chore_cpm

Conversation

@JanHyka

@JanHyka JanHyka commented May 11, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:

n/a

Description of changes:

Current repository has several gaps across solutions:

  1. Inconsolidated package versions
  2. Repeated boilerplate in projects setup
  3. Assembly signing missing in certain test projects
  4. LangVersion set to 10 in core projects (probably artifact after migration .NET6 -> .NET8)

Changes:

  1. Introduce Central Package Management (sampleapps keep their private dependencies locally due to being standalone apps) with folder cascade Directory.Packages.Props
  2. Introduce centralized project settings via folder cascade Directory.Build.Props and move repeated blocks there
  3. Enable assembly signing in missing test projects (pls validate, while it seems the settings were forgotten there still might be explicit reason for not signing specific test projects (Lambda core package is signed but test is not, as opposed to others))
  4. Repository wide control of .NET version and Lang Version (.NET 8, LangVersion 12 - this updates core projects from LangVersion 10 to LangVersion 12 as LangVersion 10 seems to be artifact of older target framework)

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.

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 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.props and Directory.Packages.props to centralize TargetFramework/LangVersion and package versions.
  • Add scoped Directory.Build.props/Directory.Packages.props under src/, test/, and sampleapps/ to reduce repeated per-project boilerplate.
  • Remove per-project package version pins and duplicated build properties in affected .csproj files.

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.

Comment thread Directory.Build.props
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageFloatingVersionsEnabled>true</CentralPackageFloatingVersionsEnabled>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i think this is safe to ignore

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment thread Directory.Packages.props
<Project>
<!-- Central Package Management - Master File -->
<PropertyGroup>
<MicrosoftExtensionsVersion>8.0.*</MicrosoftExtensionsVersion>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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" />

Comment thread src/Directory.Build.props Outdated
Comment thread src/AWS.Messaging.Lambda/AWS.Messaging.Lambda.csproj
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@GarrettBeatty

Copy link
Copy Markdown
Contributor

thanks for the PR @JanHyka !

@GarrettBeatty GarrettBeatty requested a review from philasmar May 11, 2026 15:40
@@ -0,0 +1,25 @@
{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we don't need a change file for this change. We are not introducing a customer facing change.

@GarrettBeatty GarrettBeatty requested a review from philasmar May 12, 2026 18:40
@GarrettBeatty GarrettBeatty added the Release Not Needed Add this label if a PR does not need to be released. label May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Release Not Needed Add this label if a PR does not need to be released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants