Skip to content

Commit 17ea021

Browse files
Fix Markdown package by removing extra resources in PRI generation step
Fix thanks to Scott Banning
1 parent 2a0f678 commit 17ea021

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Markdown/Microsoft.Toolkit.Uwp.UI.Controls.Markdown.csproj

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,20 @@
4646
<Message Text="CSFiles: @(GeneratedCSFiles->'&quot;%(Identity)&quot;')" />
4747
<Exec Command="for %%f in (@(GeneratedCSFiles->'&quot;%(Identity)&quot;')) do echo #pragma warning disable &gt; %%f.temp &amp;&amp; type %%f &gt;&gt; %%f.temp &amp;&amp; move /y %%f.temp %%f &gt; NUL" />
4848
</Target>
49+
50+
<!--
51+
Required workaround for ProjectReference inclusion of the Controls package
52+
The UWP project system is including the Controls resources in the pri file because
53+
it doesn't know it'll be an independent package later during packing.
54+
Therefore, we need to remove these extra resources in the PRI pipeline so the
55+
Markdown pri file is properly generated and doesn't include duplicate references to Control resources.
56+
-->
57+
<Target Name="RemoveUnwantedPri" AfterTargets="GetPackagingOutputs">
58+
<!--<Message Text="Files Before: @(PackagingOutputs)" Importance="high" />-->
59+
<ItemGroup>
60+
<PackagingOutputs Remove="@(PackagingOutputs)" Condition="'%(PackagingOutputs.Filename)%(PackagingOutputs.Extension)' == 'Microsoft.Toolkit.Uwp.UI.Controls.pri'" />
61+
<PackagingOutputs Remove="@(PackagingOutputs)" Condition="$([System.String]::new('%(PackagingOutputs.TargetPath)').StartsWith('Microsoft.Toolkit.Uwp.UI.Controls\'))" />
62+
</ItemGroup>
63+
<!--<Message Text="Files After: @(PackagingOutputs)" Importance="high" />-->
64+
</Target>
4965
</Project>

0 commit comments

Comments
 (0)