Open mairaw opened 5 years ago
It's not possible right now. I'll consider this is a feature request for the scenario.
//cc @anangaur @rrelyea @kathleendollard
If the SourceLink packages are published with DevDependency = true, wouldn’t we auto add the PrivateAssets flag to PackageReference?
If you provide support for this at the NuGet level, we would consider a CLI change to support, so feel free to create that issue as you consider this.
If the SourceLink packages are published with DevDependency = true, wouldn’t we auto add the PrivateAssets flag to PackageReference?
Yes, it will add it PrivateAssets=all
if it's a dev dependency.
The option could be useful for the general scenario.
@tmat can you add devdependency flag to SourceLink packages? I think that would definitely help developers to not auto expose SourceLink as a dependency upwards.
I agree on the general usecase but not sure how critical or costly the issue fix is. I do see, however, more and more people using SourceLink to get the snupkg and source code info generated for their packages automatically.
SourceLink packages have <developmentDependency>true</developmentDependency>
in nuspec.
I think the problem is that it's only picked up when the package is added via UI, or perhaps into a project via dotnet CLI.
But pretty common use case is that the package reference is added manually to Directory.Build.props
file that's in the repo root, so that all projects automatically get it.
BTW there might also be a bit of confusion between @ctaggart's SourceLink packages and ours. The link https://github.com/ctaggart/SourceLink#all-source-files points to @ctaggart's packages.
@KathleenDollard Have you though about supporting adding package references to Directory.Build.props
via CLI?
Original GitHub issue https://github.com/dotnet/docs/issues/5968 from @Meberem
Is there a way to configure the PrivateAssets attirbute that this command creates? I wanted to add https://github.com/ctaggart/SourceLink#all-source-files to a number of projects and making the PrivateAssets flag scriptable would be really handy
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.