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

Mark the NI C# Analyzers package as a development dependency #99

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

nick-beer
Copy link
Collaborator

Justification

This NuGet package only provides analyzers, and so should be marked as a development dependency. This enables tooling to automatically exclude compile time assets, as well as prevent this package from being brought along as a dependency of other packages. See here.

When marked as a development dependency, NuGet.org updates its PackageReference suggestion to include PrivateAssets and IncludeAssets tags - like the following:

<PackageReference Include="xunit.analyzers" Version="1.15.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>

Implementation

Mark developmentDependency = true in the .nuspec file.

Testing

Built the nuget package locally, and verified it is marked as a development dependency:
image

@nick-beer nick-beer requested a review from jryckman as a code owner July 30, 2024 20:00
@jryckman jryckman merged commit 5984f6c into main Jul 31, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants