Skip to content

Commit

Permalink
[msbuild] Fix BundleResource defaults for iOS and MacCatalyst (#23835)
Browse files Browse the repository at this point in the history
Fixes: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2172694
Fixes: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2172757

This PR #21350 added the new `PrivacyInfo.xcprivacy` to our default templates (new requirement from Apple) when building from Windows we try to bundle this resource and unfortunately we are missing the required Link metadata when this is done from single project triggering a condition where the path is incorrectly calculated when zipped in windows and once the zip archive is transfered to the mac host it is unable to unarchive the file. To fix this we simply unify the logic with what the macios SDK currently does [1] this ensures the right bundling happens.

[1]: https://github.com/xamarin/xamarin-macios/blob/main/dotnet/targets/Microsoft.Sdk.DefaultItems.template.props#L77
  • Loading branch information
dalexsoto authored Jul 25, 2024
1 parent d54c8fa commit db7dd11
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<BundleResource
Include="$(iOSProjectFolder)Resources\**"
Exclude="$(_SingleProjectiOSExcludes)"
Link="$([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)'))"
IsDefaultItem="true"
/>
<ImageAsset
Expand Down Expand Up @@ -101,6 +102,7 @@
<BundleResource
Include="$(MacCatalystProjectFolder)Resources\**"
Exclude="$(_SingleProjectMacCatalystExcludes)"
Link="$([MSBuild]::MakeRelative ('$(MSBuildProjectDirectory)', '%(FullPath)'))"
IsDefaultItem="true"
/>
<ImageAsset
Expand Down

0 comments on commit db7dd11

Please sign in to comment.