Skip to content

[msbuild] Add AppManifestEntry build items. Fixes #12788 - #26240

Open
rolfbjarne wants to merge 6 commits into
mainfrom
dev/rolf/issue-12788-app-manifest-entry
Open

[msbuild] Add AppManifestEntry build items. Fixes #12788#26240
rolfbjarne wants to merge 6 commits into
mainfrom
dev/rolf/issue-12788-app-manifest-entry

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Add support for adding, overriding, and removing Info.plist entries using typed AppManifestEntry MSBuild items.

The new item supports boolean, string, string-array, and removal operations. App manifest entry metadata is included in incremental build fingerprints using collision-safe hashing.

Includes task-level and end-to-end coverage, localized diagnostics, and build item documentation.

Fixes #12788
Fixes #5916

🤖 Pull request created by Copilot

Allow projects to add, override, and remove Info.plist entries using typed MSBuild items.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 41397aea-ecce-4a13-83fa-453adc477ec7
Hash length-prefixed AppManifestEntry metadata so arbitrary keys and values reliably invalidate incremental builds.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 41397aea-ecce-4a13-83fa-453adc477ec7
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds typed AppManifestEntry MSBuild items to allow projects to add/override/remove Info.plist entries without generating separate partial plists, while ensuring incremental builds correctly rebuild when these items change.

Changes:

  • Introduces AppManifestEntry processing in CompileAppManifest (supports Remove/Boolean/String/StringArray) and wires it into the build targets with highest precedence.
  • Makes incremental build fingerprints collision-safe by hashing item metadata with explicit length boundaries.
  • Adds localized diagnostics, task-level tests, and an end-to-end .NET build test + build-items documentation.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/ComputeHashForItemsTaskTests.cs Adds a regression test ensuring hash input boundary collisions don’t produce equal hashes.
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/CompileAppManifestTaskTests.cs Adds task-level coverage for applying/removing manifest entries and validating diagnostics.
tests/dotnet/UnitTests/PartialAppManifestTest.cs End-to-end test verifying AppManifestEntry affects output and participates in incremental rebuilds.
tests/dotnet/MyPartialAppManifestApp/shared.csproj Adds AppManifestEntry items and properties used by the end-to-end test.
msbuild/Xamarin.Shared/Xamarin.Shared.targets Wires @(AppManifestEntry) into _CompileAppManifest and into incremental input fingerprints via hashing.
msbuild/Xamarin.MacDev.Tasks/Tasks/ComputeHashForItems.cs Updates hashing to include explicit boundaries between metadata values to avoid collisions.
msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifest.cs Implements AppManifestEntries support and applies entries after partial plist merge (highest precedence).
msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx Adds localized error messages for invalid AppManifestEntry usage.
docs/building-apps/build-items.md Documents the new AppManifestEntry build item format and supported types.

Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/ComputeHashForItems.cs
@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne
rolfbjarne marked this pull request as ready for review July 27, 2026 18:11
@rolfbjarne
rolfbjarne requested a review from mauroa as a code owner July 27, 2026 18:11
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/ComputeHashForItems.cs
Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifest.cs
Reuse typed plist item parsing for app manifest entries and custom entitlements, and restore the reusable hash buffer.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 41397aea-ecce-4a13-83fa-453adc477ec7
@rolfbjarne
rolfbjarne requested a review from dalexsoto as a code owner August 3, 2026 11:49
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Parse AppManifestEntry booleans with the same strict logic as CustomEntitlements.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 41397aea-ecce-4a13-83fa-453adc477ec7
Use the shared strict boolean parser directly instead of passing the same delegate from every caller.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 41397aea-ecce-4a13-83fa-453adc477ec7
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 54e745e6cbed4bdec444500d76910e5a795cbe72 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #54e745e] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 203 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 19 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 54e745e6cbed4bdec444500d76910e5a795cbe72 [PR build]

@rolfbjarne rolfbjarne added the ready-to-review This PR is ready to review/merge. label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot ready-to-review This PR is ready to review/merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to set UILaunchStoryboardName in Info.plist from MSBuild [Feature Request] Add support for Attributes to build Info.plist

4 participants