Add common Apple application artifact metadata#26110
Conversation
Read authoritative application metadata from the final app manifest and stamp every produced Apple ApplicationArtifact before consumer extension targets run. Cover generated and custom manifests across Apple platforms and document the shared metadata contract. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c04e140a-a614-44c9-a88a-d4f186b13b9f
There was a problem hiding this comment.
Pull request overview
This PR adds a common “application identity + version” metadata contract to Apple @(ApplicationArtifact) items by reading final values back from the built app bundle’s Info.plist, and updates tests/docs to validate and describe the new behavior.
Changes:
- Extend
ReadAppManifestto outputCFBundleNameandCFBundleShortVersionString. - Add an internal MSBuild target to stamp
@(ApplicationArtifact)items withApplicationId,ApplicationTitle,ApplicationName,ApplicationDisplayVersion, andApplicationVersion. - Add/extend test coverage and documentation for the new artifact metadata contract (including custom manifests and
GenerateApplicationManifest=falsescenarios).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/ReadAppManifestTaskTests.cs | Adds unit coverage for reading the new plist fields from ReadAppManifest. |
| tests/dotnet/UnitTests/PostBuildTest.cs | Adds cross-platform post-build tests/assertions for the new @(ApplicationArtifact) metadata. |
| tests/dotnet/MySimpleAppWithArtifactMetadata/shared.csproj | Updates the test project to allow injecting custom manifests and gates MAUI-style augmentation checks. |
| tests/dotnet/MySimpleAppWithArtifactMetadata/InfoWithoutDisplayName.plist | New plist fixture covering missing CFBundleDisplayName fallback behavior. |
| tests/dotnet/MySimpleAppWithArtifactMetadata/Info.plist | New plist fixture covering unresolved placeholder values and explicit overrides. |
| msbuild/Xamarin.Shared/Xamarin.Shared.targets | Wires new ReadAppManifest outputs and adds the artifact metadata stamping target. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/ReadAppManifest.cs | Adds task outputs for CFBundleName and CFBundleShortVersionString. |
| dotnet/SingleProject.md | Documents that final outputs expose common metadata via @(ApplicationArtifact) and how ApplicationName is derived. |
| docs/building-apps/build-properties.md | Clarifies that Apple builds populate the common metadata before extensibility targets run. |
| docs/building-apps/build-items.md | Documents the new @(ApplicationArtifact) metadata fields and their precedence behavior. |
rolfbjarne
left a comment
There was a problem hiding this comment.
Looks great, just a couple of minor things!
Use the existing manifest helpers and standard DependsOn property pattern, avoid expanding the artifact item list for the empty check, and keep common metadata assertions on the supported GetApplicationArtifacts and Publish result surfaces. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: c04e140a-a614-44c9-a88a-d4f186b13b9f
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #052fd17] 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 macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Summary
Adds producer-owned common application metadata to every Apple
@(ApplicationArtifact)item.ReadAppManifestwithCFBundleNameandCFBundleShortVersionString.Info.plist, so custom manifest values win..app,.ipa,.pkg, and.xcarchiveartifacts withApplicationId,ApplicationTitle,ApplicationName,ApplicationDisplayVersion, andApplicationVersionwhile retaining existing Apple metadata.GetApplicationArtifactsDependsOnextensions, preserving their ability to override producer metadata.GenerateApplicationManifest=false,GetApplicationArtifacts, andPublish.Follow-up to #25723. Coordinated with dotnet/maui#35973 and dotnet/android#12123.
Validation
ReadAppManifestTaskTests: 3 passed, 0 failed.ApplicationArtifactMetadataTest: 7 passed, 0 failed.git diff --check: passed.yamllintis not installed.The tvOS device IPA test could not run in this environment because no matching provisioning profile is installed. The other four environment failures from the combined artifact run were rerun successfully with
ProductBuildPath=/usr/bin/productbuild.