Skip to content
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

FUTDC detects changes to Pack items #9437

Merged

Conversation

drewnoakes
Copy link
Member

@drewnoakes drewnoakes commented Apr 5, 2024

Fixes #9433

When a project specifies GeneratePackageOnBuild, additional items must become inputs to the FUTDC. Without this, it's possible to change a Content item, for example, that has Pack="true" metadata, and not have those changes included in the generated NuGet package during builds.

This change includes all the items that NuGet would include in the package as inputs to the FUTDC.

Note that ideally we would only include these items when GeneratePackageOnBuild was true, however we force the property to false during design-time builds in GeneratePackageOnBuildDesignTimeBuildPropertyProvider, so instead we add these items unconditionally. It's possible that this could trigger a few extra builds for some uncommon project configurations, but that seems unlikely and is better than failing to build correctly.

Microsoft Reviewers: Open in CodeFlow

When a project specifies `GeneratePackageOnBuild`, additional items become inputs to the FUTDC. Without this, it's possible to change a `Content` item, for example, that has `Pack="true"` metadata, and not have those changes included in the generated NuGet package during builds.

This change includes all the items that NuGet would include in the package as inputs to the FUTDC.

Note that ideally we would only include these items when `GeneratePackageOnBuild` was `true`, however we force the property to `false` during design-time builds in `GeneratePackageOnBuildDesignTimeBuildPropertyProvider`, so instead we add these items unconditionally. It's possible that this could trigger a few extra builds for some uncommon project configurations, but that seems unlikely and is better than failing to build correctly.
@drewnoakes drewnoakes added the Feature-Up-to-date Build up-to-date check that avoids shelling out to MSBuild unless necessary. label Apr 5, 2024
@drewnoakes drewnoakes requested a review from a team as a code owner April 5, 2024 01:29
Copy link

@jacdavis jacdavis left a comment

Choose a reason for hiding this comment

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

:shipit:

@drewnoakes drewnoakes merged commit f1caaff into dotnet:main Apr 5, 2024
5 checks passed
@drewnoakes drewnoakes deleted the fix-9433-futdc-checks-packed-items branch April 5, 2024 21:24
@dotnet-policy-service dotnet-policy-service bot added this to the 17.10 milestone Apr 5, 2024
@drewnoakes drewnoakes modified the milestones: 17.10, 17.11 May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature-Up-to-date Build up-to-date check that avoids shelling out to MSBuild unless necessary.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FUTDC doesn't check packed items when GeneratePackageOnBuild is true
3 participants