Skip to content

Commit

Permalink
Merge pull request #83 from nventive/dev/rywi/toolkit-err-wrkaround
Browse files Browse the repository at this point in the history
fix: implemented workaround for Uno.Toolkit.UI error
  • Loading branch information
ryanwin98 authored Nov 2, 2023
2 parents 1d312d1 + 841a958 commit b6df421
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/DynamicMvvm.Uno.WinUI/DynamicMvvm.Uno.WinUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@
</ItemGroup>

<Import Project="..\DynamicMvvm.Shared\DynamicMvvm.Shared.projitems" Label="Shared" />
<Import Project="winappsdk-workaround.targets" />
</Project>
27 changes: 27 additions & 0 deletions src/DynamicMvvm.Uno.WinUI/winappsdk-workaround.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project>
<!--
Workaround to avoid including Uno.Toolkit.UI XBFs in the PRI file:
> C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5097,5):
> error MSB3030: Could not copy the file "D:\a\1\s\src\Uno.Toolkit.UI\obj\Uno.Toolkit.WinUI\Release\net7.0-windows10.0.19041\Controls\AutoLayout\AutoLayout.xbf" because it was not found.
> [D:\a\1\s\src\Uno.Toolkit.RuntimeTests\Uno.Toolkit.RuntimeTests.WinUI.csproj]
Just <Import /> this file into the winui project appearing in the `[]` bracket.
-->
<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>

0 comments on commit b6df421

Please sign in to comment.