Skip to content

Commit

Permalink
feat: Ensure that uno.sdk winappsdk apps include all Assets by default
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Mar 27, 2024
1 parent 6a30fc4 commit a607d1b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@
<!-- <WindowsSdkPackageVersion>10.0.22621.28</WindowsSdkPackageVersion> -->
</PropertyGroup>

<Target Name="_UnoValidateSelfAssets"
BeforeTargets="AfterBuild"
Condition="'$(TargetFramework)'=='$(DotNetVersion)-windows10.0.19041'">

<!-- Validates that assets are properly propagated to the output folder, regardless of their "copy to output" value -->
<Error Text="Missing asset $(OutputPath)\Assets\SharedAssets.md"
Condition="!exists('$(OutputPath)\Assets\SharedAssets.md')" />
</Target>

</Project>
7 changes: 7 additions & 0 deletions src/Uno.Sdk/targets/Uno.Common.WinAppSdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
<Manifest Include="$(ApplicationManifest)" Exclude="@(Manifest)" />
</ItemGroup>

<ItemGroup>
<!-- Replicates the original globbing from WinAppSDK (See microsoft.windowsappsdk\1.4.240211001\buildTransitive\Microsoft.WinUI.props)-->
<Content Update="Assets/**/*.*" Condition="'$(EnableDefaultAssets)'=='true'">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<!-- Workaround to avoid including Project XBFs in the PRI file: https://github.com/microsoft/microsoft-ui-xaml/issues/8857 -->
<Import Project="winappsdk-workaround.targets"
Condition=" '$(SingleProject)' != 'true' and '$(DisableWinUI8857_Workaround)' != 'true' "/>
Expand Down
4 changes: 4 additions & 0 deletions src/Uno.Sdk/targets/Uno.SingleProject.WinAppSdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
Condition="Exists('$(ApplicationManifest)')" />
</ItemGroup>

<ItemGroup>
<Content Update="" />
</ItemGroup>

<!-- Using .NET MAUI Workaround for AnyCPU https://github.com/dotnet/maui/blob/37ca0c26e39a40f14b4fd60416b90a1a62e28473/src/Workload/Microsoft.Maui.Sdk/Sdk/Microsoft.Maui.Sdk.Before.targets#L12-L22 -->
<!-- The Windows App SDK does not support AnyCPU without a RID, so make sure we pick the "best" one we can -->
<PropertyGroup>
Expand Down

0 comments on commit a607d1b

Please sign in to comment.