Skip to content

Commit

Permalink
Merge pull request #2837 from PrismLibrary/winappsdk-workaround
Browse files Browse the repository at this point in the history
add winappsdk workaround targets
  • Loading branch information
dansiegel committed Mar 6, 2023
2 parents 8fcc856 + 004013f commit 7e97462
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@
<_PackageFiles Include="$(IntermediateOutputPath)\readme.txt" PackagePath="" />
</ItemGroup>
</Target>

<Import Project="$(MSBuildThisFileDirectory)winappsdk-workaround.targets"
Condition=" '$(IsUnoProject)' " />
</Project>
21 changes: 21 additions & 0 deletions src/winappsdk-workaround.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project>
<!-- Workaround to avoid including Uno.Toolkit.UI XBFs in the PRI file -->
<Target Name="AdjustGetPackagingOutput1" AfterTargets="GetMrtPackagingOutputs">
<Message Importance="high" Text="Applying NuGet packaging workaround for dependent PRI files exclusion" />
<ItemGroup>
<_OtherPriFiles Include="@(PackagingOutputs)" Condition="'%(Extension)' == '.pri' and ('%(PackagingOutputs.ReferenceSourceTarget)' == 'ProjectReference' or '%(PackagingOutputs.NugetSourceType)'=='Package')" />
<PackagingOutputs Remove="@(_OtherPriFiles)" />
</ItemGroup>
</Target>

<Target Name="AdjustGetPackagingOutput2" BeforeTargets="AddPriPayloadFilesToCopyToOutputDirectoryItems">
<Message Importance="high" Text="Applying NuGet packaging workaround for dependent PRI files exclusion" />
<ItemGroup>
<_OtherPriFiles1 Include="@(_ReferenceRelatedPaths)" Condition="'%(Extension)' == '.pri' and ('%(_ReferenceRelatedPaths.ReferenceSourceTarget)' == 'ProjectReference' or '%(_ReferenceRelatedPaths.NugetSourceType)'=='Package')" />
<_ReferenceRelatedPaths Remove="@(_OtherPriFiles1)" />

<_OtherPriFiles2 Include="@(ReferenceCopyLocalPaths)" Condition="'%(Extension)' == '.pri' and ('%(ReferenceCopyLocalPaths.ReferenceSourceTarget)' == 'ProjectReference' or '%(ReferenceCopyLocalPaths.NugetSourceType)'=='Package')" />
<ReferenceCopyLocalPaths Remove="@(_OtherPriFiles2)" />
</ItemGroup>
</Target>
</Project>

1 comment on commit 7e97462

@MarkBQE
Copy link

@MarkBQE MarkBQE commented on 7e97462 Mar 7, 2023

Choose a reason for hiding this comment

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

@dansiegel @jeromelaban Merge pull request #2837 crashes the WinUi3 app (9.0.119-pre) with the following error. Reverting to 9.078-pre works as expected

image

Please sign in to comment.