Skip to content

Commit ec664c9

Browse files
committed
Never pack NuGetizer transitively
This stops inference from collecting transitive dependency files from NuGetizer and packing them too alongisde the consuming project. This is currently an issue since due to being a development dependency, NuGetizer will by default install with a `PrivateAssets=all` value, which for packing purposes means "pack everything this dependency brings, transitively, into this package output", since that's the most common scenario. But for build-only packages like NuGetizer, it doesn't make sense. Especially for non-build transitive assets such as analyzer's localization files (i.e. SponsorLink in NuGetizer's case). So we default this to the most obvious value now.
1 parent 36042e0 commit ec664c9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/NuGetizer.Tasks/NuGetizer.Inference.targets

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,14 @@ Copyright (c) .NET Foundation. All rights reserved.
190190
_SetPackTargetFramework;
191191
InferPackageContents
192192
</GetPackageContentsDependsOn>
193-
194193
</PropertyGroup>
195194

195+
<ItemGroup>
196+
<!-- NuGetizer should never pack transitively (i.e. SponsorLink assets), even
197+
when PrivateAssets=all is used due to being a development dependency now. -->
198+
<PackageReference Update="NuGetizer" PackTransitively="false" />
199+
</ItemGroup>
200+
196201
<Target Name="_SetDefaultPackageReferencePack" Condition="'$(PackFolder)' == 'build' or '$(PackFolder)' == 'buildTransitive'"
197202
BeforeTargets="InferPrimaryOutputDependencies;InferPackageContents">
198203
<ItemGroup>

0 commit comments

Comments
 (0)