Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit c1d35b0

Browse files
committed
Include KeyOutput too in case the other output group is empty
Depending on the type of project, sometimes the BuiltProjectOutputGroupOutput is empty (i.e. in our tasks it was), but the key output was properly populated. Add both and ensure no duplicate PackageFiles are created after the inference is done.
1 parent b79c3e4 commit c1d35b0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.Inference.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Copyright (c) .NET Foundation. All rights reserved.
5353
</PropertyGroup>
5454

5555
<ItemGroup>
56-
<_InferredPackageFile Include="@(BuiltProjectOutputGroupOutput -> '%(FinalOutputPath)')"
56+
<_InferredPackageFile Include="@(BuiltProjectOutputGroupOutput -> '%(FinalOutputPath)');@(BuiltProjectOutputGroupKeyOutput -> '%(FinalOutputPath)')"
5757
Condition="'$(IncludeOutputsInPackage)' == 'true' and '$(IsPackagingProject)' != 'true'">
5858
<!-- Packaging projects don't contribute primary output -->
5959
<Kind>$(PrimaryOutputKind)</Kind>
@@ -154,7 +154,7 @@ Copyright (c) .NET Foundation. All rights reserved.
154154
NOTE: if PackageId is empty, we won't generate a manifest and it means the files need to be packed with the
155155
current project.
156156
-->
157-
<PackageFile Include="@(_InferredPackageFile)">
157+
<PackageFile Include="@(_InferredPackageFile -> Distinct())">
158158
<Source>Implicit</Source>
159159
<PackageId Condition="'$(IsPackable)' == 'true'">$(PackageId)</PackageId>
160160
<Platform>$(Platform)</Platform>

0 commit comments

Comments
 (0)