Skip to content

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 force-pushed the dev/TransitiveBuild branch from 85ede7a to 887e5f5 Compare March 20, 2023 18:24
@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
@devlooped devlooped locked and limited conversation to collaborators Nov 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants