Skip to content

Add common Apple application artifact metadata#26110

Open
Redth wants to merge 2 commits into
mainfrom
redth-application-artifact-metadata
Open

Add common Apple application artifact metadata#26110
Redth wants to merge 2 commits into
mainfrom
redth-application-artifact-metadata

Conversation

@Redth

@Redth Redth commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

Adds producer-owned common application metadata to every Apple @(ApplicationArtifact) item.

  • Extends ReadAppManifest with CFBundleName and CFBundleShortVersionString.
  • Reads metadata from the final compiled app bundle Info.plist, so custom manifest values win.
  • Preserves unresolved or localized plist references as written instead of selecting a locale.
  • Stamps .app, .ipa, .pkg, and .xcarchive artifacts with ApplicationId, ApplicationTitle, ApplicationName, ApplicationDisplayVersion, and ApplicationVersion while retaining existing Apple metadata.
  • Runs before downstream GetApplicationArtifactsDependsOn extensions, preserving their ability to override producer metadata.
  • Documents the common metadata contract and adds task/post-build coverage across Apple platforms, output formats, generated/custom manifests, GenerateApplicationManifest=false, GetApplicationArtifacts, and Publish.

Follow-up to #25723. Coordinated with dotnet/maui#35973 and dotnet/android#12123.

Validation

  • ReadAppManifestTaskTests: 3 passed, 0 failed.
  • ApplicationArtifactMetadataTest: 7 passed, 0 failed.
  • Desktop package/extension/Publish metadata tests: 6 passed, 0 failed.
  • Final git diff --check: passed.
  • XML validation for the changed targets, project, and plist fixtures: passed.
  • The relevant MSBuild/product components compiled successfully; the broader top-level build later stopped in unrelated DevOps YAML validation because yamllint is 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.

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
Copilot AI review requested due to automatic review settings July 15, 2026 16:54
@Redth
Redth requested review from mauroa and rolfbjarne as code owners July 15, 2026 16:54

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

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 ReadAppManifest to output CFBundleName and CFBundleShortVersionString.
  • Add an internal MSBuild target to stamp @(ApplicationArtifact) items with ApplicationId, ApplicationTitle, ApplicationName, ApplicationDisplayVersion, and ApplicationVersion.
  • Add/extend test coverage and documentation for the new artifact metadata contract (including custom manifests and GenerateApplicationManifest=false scenarios).

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.

Comment thread msbuild/Xamarin.Shared/Xamarin.Shared.targets Outdated

@rolfbjarne rolfbjarne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great, just a couple of minor things!

Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/ReadAppManifest.cs Outdated
Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/ReadAppManifest.cs Outdated
Comment thread msbuild/Xamarin.Shared/Xamarin.Shared.targets Outdated
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
@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: 052fd1787b9d48c7ed719a164b925595db25802b [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne self-assigned this Jul 16, 2026
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [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
✅ 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. [attempt 2] 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. 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. [attempt 2] Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 052fd1787b9d48c7ed719a164b925595db25802b [PR build]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants