Make NuGetizer targets buildTransitive to fix SponsorLink #353
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.