Skip to content

Clean up containers packaging, leaning into NuGet's expected patterns #49518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

baronfel
Copy link
Member

NuGet expects folks that want to customize output paths (i.e. non-library packages) to use the TargetsForTfmSpecificContentInPackage extensibility point to create TfmSpecificPackageFile Items with PackagePath metadata.

Instead of our old custom orchestration, we lean into this. I also cleaned up how we determine the dependencies to package for the containerize.dll binary.

This can be tested very easily by running dotnet pack -bl on the packaging.csproj project itself (or dotnet build, because we have GeneratePackageOnBuild set for this project).

NuGet expects folks that want to customize output paths (i.e. non-library
packages) to use the TargetsForTfmSpecificContentInPackage extensibility
point to create TfmSpecificPackageFile Items with PackagePath metadata.

Instead of our old custom orchestration, we lean into this. I also cleaned up
how we determine the dependencies to package for the containerize.dll
binary.
@baronfel baronfel requested review from a team and Copilot June 21, 2025 18:26
Copy link
Contributor

@Copilot Copilot AI left a comment

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 cleans up the packaging logic by leveraging NuGet’s expected patterns for custom output paths and streamlines dependency determination for the containerize binary. Key changes include:

  • Adding the TargetsForTfmSpecificContentInPackage property to drive packaging for TFM-specific content.
  • Updating ProjectReference target definitions to use the new SdkTargetFramework and introducing explicit OutputItemType attributes.
  • Refactoring packaging targets (PreparePackageReleaseNotesFromFile and AddItemsForPackaging) to generate package files using TfmSpecificPackageFile items.
Comments suppressed due to low confidence (3)

src/Containers/packaging/package.csproj:29

  • Ensure that replacing $(TargetFramework) with $(SdkTargetFramework) is intentional and that all dependent tasks and project references are updated accordingly to avoid framework mismatches.
                          SetTargetFramework="TargetFramework=$(SdkTargetFramework)"

src/Containers/packaging/package.csproj:45

  • [nitpick] Verify that the naming 'ContainerizeBinaryOutput' for the output item type is consistent with other similar identifiers in the project to maintain clarity.
                          OutputItemType="ContainerizeBinaryOutput"

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.

1 participant