Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions src/NuGet.Core/NuGet.Build.Tasks.Pack.Library/Pack.targets
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<MSBuild
Condition="'$(IncludeBuildOutput)' == 'true'"
Projects="$(MSBuildProjectFullPath)"
Targets="BuiltProjectOutputGroup;DocumentationProjectOutputGroup"
Targets="BuiltProjectOutputGroup;DocumentationProjectOutputGroup;_AddPriFileToPackBuildOutput"
Properties="TargetFramework=%(_TargetFrameworks.Identity);
BuildProjectReferences=false;">

Expand All @@ -174,15 +174,6 @@ Copyright (c) .NET Foundation. All rights reserved.
ItemName="_TargetPathsToAssemblies" />
</MSBuild>

<!--Projects with target framework like UWP, Win8, wpa81 produce a Pri file
in their bin dir. This Pri file is not included in the BuiltProjectGroupOutput, and
has to be added manually here.-->
<ItemGroup Condition="'$(IncludeProjectPriFile)' == 'true'">
<_TargetPathsToAssemblies Include="$(ProjectPriFullPath)">
<FinalOutputPath>$(ProjectPriFullPath)</FinalOutputPath>
</_TargetPathsToAssemblies>
</ItemGroup>

<MSBuild
Condition="'$(IncludeSymbols)' == 'true' OR '$(IncludeSource)' == 'true'"
Projects="$(MSBuildProjectFullPath)"
Expand All @@ -207,6 +198,18 @@ Copyright (c) .NET Foundation. All rights reserved.
ItemName="_SourceFiles" />
</MSBuild>
</Target>

<!--Projects with target framework like UWP, Win8, wpa81 produce a Pri file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: frameworks

in their bin dir. This Pri file is not included in the BuiltProjectGroupOutput, and
has to be added manually here.-->
<Target Name="_AddPriFileToPackBuildOutput"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you could condition this target on IncludeProjectPriFile and checking if ProjectPriFullPath is non-empty. Not sure it would actually save much for perf however.

Returns="@(_PathToPriFile)">
<ItemGroup Condition="'$(IncludeProjectPriFile)' == 'true'">
<_PathToPriFile Include="$(ProjectPriFullPath)">
<FinalOutputPath>$(ProjectPriFullPath)</FinalOutputPath>
</_PathToPriFile>
</ItemGroup>
</Target>

<!--
============================================================
Expand Down