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

Allow opting out of transitive private assets package reference packing #37

Closed
kzu opened this issue Dec 3, 2020 · 0 comments
Closed
Labels
enhancement New feature or request

Comments

@kzu
Copy link
Member

kzu commented Dec 3, 2020

Currently, you can pack an entire graph of transitive dependencies along with your package by simply adding PrivateAssets=all on the PackageReference:

  <ItemGroup>
    <PackageReference Include="NuGetizer" Version="0.5.0" />
    <PackageReference Include="Scriban" Version="3.0.4" PrivateAssets="all" />
  </ItemGroup>

There is currently no way of stopping the transitivity, however. You'd have to manually add each dependency and set Pack=false on it to stop this behavior.

We should support a new PackTransitive=false attribute to opt-out of this behavior. I'd still keep the transitive packing on by default since that's the most common approach when doing private assets for a dependency (in my experience, i.e. tools or msbuild tasks).

@kzu kzu added the enhancement New feature or request label Dec 4, 2020
@kzu kzu closed this as completed in ab87442 Dec 4, 2020
kzu added a commit that referenced this issue Dec 4, 2020
Sometimes it may be useful to just pack the top-level dependency from a reference (i.e. you're getting the other deps by some other means, or the environment they run on doesn't require them, such as for Microsoft.Build.Framework, say).

This allows just setting PackTransitive=false to stop the transitivity.

Fixes #37
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

No branches or pull requests

1 participant