Skip to content

Commit

Permalink
Merge pull request #2986 from PrismLibrary/dev/ds/winappsdk-workarounds
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel authored Oct 23, 2023
2 parents 91ee9b0 + 4bd9b50 commit 4167e97
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
10 changes: 1 addition & 9 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Project>
<Import Project="winappsdk-workarounds.targets" Condition=" $(IsUnoProject) == 'true' " />
<PropertyGroup>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
</PropertyGroup>
Expand All @@ -11,13 +12,4 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<!-- <Choose>
<When Condition="$(IsUnoProject)">
<ItemGroup>
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" RuntimeFrameworkVersion="10.0.22621.28" />
<FrameworkReference Update="Microsoft.Windows.SDK.NET.Ref" TargetingPackVersion="10.0.22621.28" />
</ItemGroup>
</When>
</Choose> -->

</Project>
1 change: 0 additions & 1 deletion src/Uno/Prism.Uno/PrismApplicationBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Prism.Modularity;
using Prism.Mvvm;
using Prism.Navigation.Regions;
using Uno.Toolkit;
using Application = Microsoft.UI.Xaml.Application;

#nullable enable
Expand Down
27 changes: 27 additions & 0 deletions winappsdk-workarounds.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\net5.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 4167e97

Please sign in to comment.