Skip to content

Commit

Permalink
Merge pull request unoplatform#15388 from unoplatform/dev/jela/sdk-as…
Browse files Browse the repository at this point in the history
…sets-wask

fix: Don't run PRI workaround for WinUI on the head project
  • Loading branch information
jeromelaban authored Feb 7, 2024
2 parents f274c49 + 1582808 commit db94c92
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/Uno.Sdk/targets/Uno.Common.WinAppSdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
<SupportedOSPlatformVersion Condition=" $(SupportedOSPlatformVersion) == '' ">$(TargetPlatformMinVersion)</SupportedOSPlatformVersion>
<RuntimeIdentifiers Condition=" $(RuntimeIdentifiers) == '' ">win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<EnableCoreMrtTooling Condition=" $(EnableCoreMrtTooling) == '' AND '$(BuildingInsideVisualStudio)' != 'true' ">false</EnableCoreMrtTooling>
<EnableMsixTooling Condition=" $(EnableMsixTooling) == '' ">true</EnableMsixTooling>

<!-- Set EnableMsixTooling to true only for executables - setting this on class libraries prevents assets from being correctly copied to windows target -->
<EnableMsixTooling Condition=" $(EnableMsixTooling) == '' AND ('$(OutputType)' == 'WinExe' OR '$(OutputType)' == 'Exe') ">true</EnableMsixTooling>

<EnableWindowsTargeting Condition=" $(EnableWindowsTargeting) == '' ">true</EnableWindowsTargeting>
</PropertyGroup>

Expand Down
8 changes: 6 additions & 2 deletions src/Uno.Sdk/targets/winappsdk-workaround.targets
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<Project>
<!-- Workaround to avoid including Project XBFs in the PRI file: https://github.com/microsoft/microsoft-ui-xaml/issues/8857 -->
<Target Name="WinUI8857_AdjustGetPackagingOutput1" AfterTargets="GetMrtPackagingOutputs">
<Target Name="WinUI8857_AdjustGetPackagingOutput1"
AfterTargets="GetMrtPackagingOutputs"
Condition="'$(OutputType)' != 'WinExe'">
<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="WinUI8857_AdjustGetPackagingOutput2" BeforeTargets="AddPriPayloadFilesToCopyToOutputDirectoryItems">
<Target Name="WinUI8857_AdjustGetPackagingOutput2"
BeforeTargets="AddPriPayloadFilesToCopyToOutputDirectoryItems"
Condition="'$(OutputType)' != 'WinExe'">
<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')" />
Expand Down

0 comments on commit db94c92

Please sign in to comment.