Skip to content

Expose application artifacts#25723

Open
Redth wants to merge 19 commits into
mainfrom
dev/redth/apple-artifacts-plan
Open

Expose application artifacts#25723
Redth wants to merge 19 commits into
mainfrom
dev/redth/apple-artifacts-plan

Conversation

@Redth

@Redth Redth commented Jun 17, 2026

Copy link
Copy Markdown
Member

Apple platform builds and publishes now expose final artifacts through the shared @(ApplicationArtifact) item group. This gives custom targets and CI a stable way to discover .app, .ipa, .pkg, and .xcarchive outputs without parsing scalar properties, while leaving room for other platforms to use the same item group name.

Changes

  • Add @(ApplicationArtifact) collectors for app bundles, IPA packages, PKG installers, and Xcode archives.
  • Route Publish through GetApplicationArtifacts after _PrePublish, so publish-created artifacts run the same metadata extension path before Publish returns @(ApplicationArtifact).
  • Add GetApplicationArtifactsDependsOn so later SDK layers such as .NET MAUI can enrich @(ApplicationArtifact) metadata before GetApplicationArtifacts or Publish returns.
  • Make Build a mandatory GetApplicationArtifacts dependency outside the overridable GetApplicationArtifactsDependsOn property, so overwriting the property cannot skip platform artifact population.
  • Keep GetApplicationArtifactsDependsOn as a post-build extension point only; Build produces and collects platform artifacts before extension targets enrich the existing @(ApplicationArtifact) items.
  • Clarify that extension targets should update platform-created @(ApplicationArtifact) items when adding metadata, and only add new items for additional artifacts.
  • Limit platform metadata to PackageFormat, IsDirectory, PlatformName, and BundleIdentifier.
  • Update unit test assertions and in-repo build item/property/target docs for the new contract.
  • Use dotnet build ... -getTargetResult examples for querying GetApplicationArtifacts and Publish results from the command line.
  • Add direct item-query tests for IPA, PKG, app bundle, xcarchive outputs, extension metadata, publish-target metadata augmentation, overwritten GetApplicationArtifactsDependsOn behavior, and the direct target dependency graph.

Validation

  • xmllint --noout msbuild/Xamarin.Shared/Xamarin.Shared.targets msbuild/Xamarin.Shared/Xamarin.iOS.Common.targets
  • git diff --check
  • make -C tests/dotnet/UnitTests build
  • dotnet test DotNetUnitTests.csproj --no-build --filter "FullyQualifiedName~PostBuildTest.GetApplicationArtifactsTargetDependenciesTest" --logger "console;verbosity=minimal"
  • Attempted filtered extension-order tests locally; execution is blocked by missing Xcode/runtime/workload setup in this checkout.

Redth and others added 14 commits June 16, 2026 16:16
Add public MSBuild item groups for final MaciOS build and publish artifacts so custom targets and CI can consume app bundles, IPA files, PKG installers, and Xcode archives with metadata.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collapse MaciOS artifact and published artifact item groups into ApplePackageOutput, matching AndroidPackageOutput naming and reducing metadata to the package contract.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make ApplePackageOutput Signed reflect app code signing only, and expose separate PackageSigned metadata for .pkg installer package signing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop Signed and PackageSigned from ApplePackageOutput since Apple builds do not emit parallel signed and unsigned package outputs that need to be distinguished.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop AppBundlePath from ApplePackageOutput so the public contract focuses on the final artifact item identity and stable package metadata.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add direct GetApplePackageOutputs coverage using MSBuild item query output for IPA, PKG, app bundle, and xcarchive artifacts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Rename the public artifact item group and query target to ApplicationArtifact and GetApplicationArtifacts so the surface can be shared across platforms.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add GetApplicationArtifactsDependsOn so later SDKs such as MAUI can enrich ApplicationArtifact metadata before GetApplicationArtifacts returns items.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Validate that GetApplicationArtifactsDependsOn extension targets can observe platform-produced ApplicationArtifact items before adding metadata, and verify both app and package artifacts receive the augmented metadata. Restore the injected sample project content after the test to avoid leaving dirty files on failure.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Route Publish through GetApplicationArtifacts after _PrePublish so targets appended with GetApplicationArtifactsDependsOn can augment ApplicationArtifact metadata before Publish returns items. Add publish-target coverage that validates a MAUI-like extension sees platform artifacts before updating metadata.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document that GetApplicationArtifactsDependsOn extension targets should update platform-produced ApplicationArtifact items when adding metadata, while only adding new items for additional artifacts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make Build a mandatory GetApplicationArtifacts dependency instead of part of the overridable GetApplicationArtifactsDependsOn property. Extension targets still run after platform artifacts are produced, and tests now overwrite the property to prove Build cannot be removed while metadata augmentation still applies to GetApplicationArtifacts and Publish.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update ApplicationArtifact target-result examples to use dotnet build with -getTargetResult for GetApplicationArtifacts and Publish.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve conflict in Xamarin.Shared.targets by keeping the ApplicationArtifact query target and the new PrepareAssemblies targets from main.

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

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@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.

@Redth Redth marked this pull request as ready for review June 17, 2026 18:23
@Redth Redth requested a review from mauroa as a code owner June 17, 2026 18:23
Copilot AI review requested due to automatic review settings June 17, 2026 18:23
@Redth Redth requested a review from rolfbjarne as a code owner June 17, 2026 18:23
@Redth

Redth commented Jun 17, 2026

Copy link
Copy Markdown
Member Author

Android equivalent: dotnet/android#11674

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

Align GetApplicationArtifacts with Android by routing it through a private application artifact creation target that runs Build plus Apple package/archive producers before user metadata extension targets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

This comment has been minimized.

Redth and others added 2 commits June 17, 2026 16:06
Assert that explicit ApplicationArtifact producer dependencies preserve their existing BuildIpa, CreatePackage, and ArchiveOnBuild gates so GetApplicationArtifacts does not create optional artifacts unless requested.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Route GetApplicationArtifacts directly through mandatory Build before user metadata extension targets, matching the Android contract and removing the private artifact creation wrapper.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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

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

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

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

✅ [PR Build #73624bf] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 73624bf291bcc570e7b6a0dcde057e3207175876 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #73624bf] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 73624bf291bcc570e7b6a0dcde057e3207175876 [PR build]

@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: 73624bf291bcc570e7b6a0dcde057e3207175876 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #73624bf] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 73624bf291bcc570e7b6a0dcde057e3207175876 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [CI Build #73624bf] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

0 tests crashed, 21 tests failed, 199 tests passed.

Failures

❌ dotnettests tests (iOS)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.DotNetProjectTest.BuildProjectsWithExtensions(iOS,...: App extension directory does not exist: /Users/builder/azdo/_work/1/s/macios/tests/dotnet/ExtensionConsumer/iOS/bin/Debug/net1...
    • Xamarin.Tests.DotNetProjectTest.BuildProjectsWithExtensions(iOS,...: App extension directory does not exist: /Users/builder/azdo/_work/1/s/macios/tests/dotnet/ExtensionConsumer/iOS/bin/Debug/net1...
    • Xamarin.Tests.DotNetProjectTest.BuildProjectsWithExtensions(iOS,...: App extension directory does not exist: /Users/builder/azdo/_work/1/s/macios/tests/dotnet/ExtensionConsumer/iOS/bin/Debug/net1...
    • ... and 6 more

Html Report (VSDrops) Download

❌ dotnettests tests (MacCatalyst)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.PostBuildTest.ArchiveTest(MacCatalyst,"maccatalyst...: System.ArgumentNullException : Value cannot be null. (Parameter 'path')
      ParamName: path
    • Xamarin.Tests.PostBuildTest.ArchiveTest(MacCatalyst,"maccatalyst...: System.ArgumentNullException : Value cannot be null. (Parameter 'path')
      ParamName: path
    • Xamarin.Tests.PostBuildTest.BuildPackageTest("MySimpleApp",MacCa...: System.ArgumentNullException : Value cannot be null. (Parameter 'path')
      ParamName: path
    • ... and 5 more

Html Report (VSDrops) Download

❌ dotnettests tests (macOS)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.DotNetProjectTest.BuildProjectsWithExtensions(MacO...: App extension directory does not exist: /Users/builder/azdo/_work/1/s/macios/tests/dotnet/ExtensionConsumer/macOS/bin/Debug/ne...
    • Xamarin.Tests.DotNetProjectTest.BuildProjectsWithExtensions(MacO...: App extension directory does not exist: /Users/builder/azdo/_work/1/s/macios/tests/dotnet/ExtensionConsumer/macOS/bin/Debug/ne...
    • Xamarin.Tests.DotNetProjectTest.BuildProjectsWithExtensions(MacO...: App extension directory does not exist: /Users/builder/azdo/_work/1/s/macios/tests/dotnet/ExtensionConsumer/macOS/bin/Debug/ne...
    • ... and 13 more

Html Report (VSDrops) Download

❌ dotnettests tests (tvOS)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.DotNetProjectTest.BuildProjectsWithExtensions(TVOS...: App extension directory does not exist: /Users/builder/azdo/_work/1/s/macios/tests/dotnet/ExtensionConsumer/tvOS/bin/Debug/net...
    • Xamarin.Tests.DotNetProjectTest.BuildProjectsWithExtensions(TVOS...: App extension directory does not exist: /Users/builder/azdo/_work/1/s/macios/tests/dotnet/ExtensionConsumer/tvOS/bin/Debug/net...
    • Xamarin.Tests.DotNetProjectTest.BuildProjectsWithExtensionsAndFr...: App extension directory does not exist: /Users/builder/azdo/_work/1/s/macios/tests/dotnet/ExtensionConsumerWithFrameworks/tvOS...
    • ... and 4 more

Html Report (VSDrops) Download

❌ linker tests (iOS)

15 tests failed, 0 tests passed.

Failed tests

  • dont link/iOS - simulator/Debug: LaunchTimedOut
  • dont link/iOS - simulator/Release: LaunchTimedOut
  • dont link/iOS - simulator/Debug (PrepareAssemblies, MonoVM, Dynamic Registrar): LaunchTimedOut
  • dont link/iOS - simulator/Debug (PrepareAssemblies, MonoVM, Managed Static Registrar): LaunchTimedOut
  • dont link/iOS - simulator/Release (PrepareAssemblies, MonoVM, Dynamic Registrar): LaunchTimedOut
  • dont link/iOS - simulator/Release (PrepareAssemblies, MonoVM, Managed Static Registrar): LaunchTimedOut
  • link sdk/iOS - simulator/Debug: LaunchTimedOut
  • link sdk/iOS - simulator/Release: LaunchTimedOut
  • link all/iOS - simulator/Debug: LaunchTimedOut
  • link all/iOS - simulator/Release: LaunchTimedOut
  • link all/iOS - simulator/Debug (don't bundle original resources): LaunchTimedOut
  • trimmode copy/iOS - simulator/Debug: LaunchTimedOut
  • trimmode copy/iOS - simulator/Release: LaunchTimedOut
  • trimmode link/iOS - simulator/Debug: LaunchTimedOut
  • trimmode link/iOS - simulator/Release: LaunchTimedOut

Html Report (VSDrops) Download

❌ linker tests (tvOS)

1 tests failed, 14 tests passed.

Failed tests

  • trimmode link/tvOS - simulator/Release: BuildFailure

Html Report (VSDrops) Download

❌ windows tests

1 tests failed, 2 tests passed.

Failed tests

  • Remote .NET tests/Xamarin.Tests.DotNetProjectTest.BuildProjectsWithExtensionsOnRemoteWindows(iOS,"ios-arm64",False): Failed: App extension directory does not exist: C:\AzDO_work\8\s\macios\tests\dotnet\ExtensionConsumer\iOS\bin\Debug\net10.0-ios\ios-arm64\ExtensionConsumer.app\PlugIns\ExtensionProject.appex

Html Report (VSDrops) Download

Successes

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): 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 6 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
✅ monotouch (iOS): All 21 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 24 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 24 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 21 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 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. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 73624bf291bcc570e7b6a0dcde057e3207175876 [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