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

Make NuGetizer targets buildTransitive to fix SponsorLink #353

Merged
merged 1 commit into from
Mar 20, 2023

Conversation

kzu
Copy link
Member

@kzu kzu commented Mar 20, 2023

For development-dependency packages, no assets flow across project references, including build targets and package dependencies. This is problematic for SponsorLink since it needs targets to properly surface build properties to the analyzer that performs the checks.

By making NuGetizer build targets transitive, we fix the project to project (P2P) scenario where one project installs NuGetizer and referencing projects start failing the SponsorLink check because the SL targets are missing. (since the package dependency on SL isn't surfaced in that case).

By also including the SL targets in our package and conditionally importing them if they haven't already been imported, we further remove the changes that the missing dependency causes failures.

This might not be the optimal way to solve this, but it's the only one that works consistently. This obviously causes P2P references to a project consuming NuGetizer to also become nugetized themselves. This should be a minor issue, however.

@kzu kzu added the enhancement New feature or request label Mar 20, 2023
For development-dependency packages, no assets flow across project
references, including build targets and package dependencies.
This is problematic for SponsorLink since it needs targets to properly
surface build properties to the analyzer that performs the checks.

By making NuGetizer build targets transitive, we fix the project to
project (P2P) scenario where one project installs NuGetizer and
referencing projects start failing the SponsorLink check because the
SL targets are missing. (since the package dependency on SL isn't
surfaced in that case).

By also including the SL targets in our package and conditionally
importing them if they haven't already been imported, we further
remove the changes that the missing dependency causes failures.

This might not be the optimal way to solve this, but it's the only
one that works consistently. This obviously causes P2P references
to a project consuming NuGetizer to *also* become nugetized
themselves. This should be a minor issue, however.
@kzu kzu enabled auto-merge (rebase) March 20, 2023 18:24
@kzu kzu merged commit 36042e0 into main Mar 20, 2023
@kzu kzu deleted the dev/TransitiveBuild branch March 20, 2023 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant