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

Support Include/Exclude attributes from Dependency #285

Merged
merged 1 commit into from
Feb 11, 2023
Merged

Conversation

kzu
Copy link
Member

@kzu kzu commented Feb 11, 2023

We currently surface the PackageReference's IncludeAssets/ExcludeAssets as the ultimate dependency Include/Exclude metadata attributes. This is not always what you want, though.

For example: if you need the compile dependency for compiling the project, but only want to surface the dependency as a build dependency, you cannot exclude the compile asset because your project depends on the lib to build.

In order to make this more intuitive and aligned with the other attributes, we introduce PackInclude/PackExclude attributes for that purpose, which map exactly to the .nuspec: https://learn.microsoft.com/en-us/nuget/reference/nuspec#dependencies-element.

Note that the existing behavior will be overriden if those attributes are provided, which provides backwards compatibility.

@kzu kzu added the enhancement New feature or request label Feb 11, 2023
@kzu kzu enabled auto-merge (rebase) February 11, 2023 03:57
We currently surface the PackageReference's IncludeAssets/ExcludeAssets as the ultimate dependency Include/Exclude metadata attributes. This is not always what you want, though.

For example: if you need the compile dependency for compiling the project, but only want to surface the dependency as a build dependency, you cannot exclude the compile asset because your project depends on the lib to build.

In order to make this more intuitive and aligned with the other attributes, we introduce PackInclude/PackExclude attributes for that purpose, which map exactly to the .nuspec: https://learn.microsoft.com/en-us/nuget/reference/nuspec#dependencies-element.

Note that the existing behavior will be overriden if those attributes are provided, which provides backwards compatibility.
@kzu kzu merged commit 5fa3998 into main Feb 11, 2023
@kzu kzu deleted the dev/include-exclude branch February 11, 2023 04:22
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