Skip to content

Commit

Permalink
Only merge PRIs from references if the project is producing an execut…
Browse files Browse the repository at this point in the history
…able (#4124)

(cherry picked from commit ecc2c50)
  • Loading branch information
evelynwu-msft committed Feb 1, 2024
1 parent fbac361 commit 589a4b6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dev/MRTCore/packaging/MrtCore.PriGen.targets
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@
<AppxGeneratePriEnabled Condition="'$(AppxGeneratePriEnabled)' == ''">true</AppxGeneratePriEnabled>
<AppxGetPackagePropertiesEnabled Condition="'$(AppxGetPackagePropertiesEnabled)' == ''">true</AppxGetPackagePropertiesEnabled>

<!-- Only application projects should have the PRIs from references merged into the project's own PRI -->
<ShouldComputeInputPris Condition="'$(ShouldComputeInputPris)' == '' AND ('$(OutputType)' == 'WinExe' OR '$(OutputType)' == 'Exe')">true</ShouldComputeInputPris>
<ShouldComputeInputPris Condition="'$(ShouldComputeInputPris)' == ''">false</ShouldComputeInputPris>

<!--
For Centennial apps, we want the resources of the unpackaged app to appear in the root namespace of the app. So, set the value
of PrependPriInitialPath to false.
Expand Down Expand Up @@ -650,9 +654,8 @@

<!--
Get list of PRI files from the payload.
In Microsoft.AppxPackage.Targets, this is run only if $(AppxPackage) is 'true' but here, of course, that shouldn't be the case.
-->
<Target Name="_GetPriFilesFromPayload">
<Target Name="_GetPriFilesFromPayload" Condition="'$(ShouldComputeInputPris)' == 'true'">

<ItemGroup>
<_PriFilesFromPayloadRaw Include="@(PackagingOutputs)"
Expand All @@ -676,9 +679,8 @@

<!--
Compute final list of input PRI files.
In Microsoft.AppxPackage.Targets, this is run only if $(AppxPackage) is 'true' but here, of course, that shouldn't be the case.
-->
<Target Name="_ComputeInputPriFiles">
<Target Name="_ComputeInputPriFiles" Condition="'$(ShouldComputeInputPris)' == 'true'">

<ItemGroup>
<_PriFile Include="@(_PriFilesFromPayload)" />
Expand Down

0 comments on commit 589a4b6

Please # to comment.