Skip to content

[release/11.0.1xx] [Xamarin.Android.Build.Tasks] Move simple task logic to targets - #13733

Merged
jonathanpeppers merged 1 commit into
release/11.0.1xxfrom
jonathanpeppers-backport-simple-task-logic-to-targets
Nov 23, 2026
Merged

jonathanpeppers merged 1 commit into
release/11.0.1xxfrom
jonathanpeppers-backport-simple-task-logic-to-targets

Conversation

@jonathanpeppers

@jonathanpeppers jonathanpeppers commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Backport of #13287.

Move project item checks, content warnings, and runtime-pack stub filtering into MSBuild targets. This brings the task simplification to the release branch without adding the -mt infrastructure.

Conflict resolutions

  • Keep StripNativeLibraries in assembly resolution. Delete the old runtime-pack task and use MSBuild items in both assembly resolution and the release-only Mono AOT target. Keep the Mono pack filter and libarchive-dso-stub.so exclusion, and retain the runtime-pack directory metadata used by the linker and packaging tasks. Main no longer has the Mono AOT target.

  • Remove the old task registrations and documented prefixes without importing the unrelated SplitProperty registration. Add only the English XA0101 resource and accessor, before the existing XA0104 entry.

  • Keep the focused build tests for diagnostics and runtime library filtering, including a release-specific Mono stub case.

  • Keep the existing _CheckProjectItems MSBuild target name (Xamarin.Android.Common.targets, Microsoft.Android.Sdk.BuildOrder.targets, InvalidConfigTests.cs). It is a target, not the deleted task, and main keeps the same target after [Xamarin.Android.Build.Tasks] Move simple task logic to targets #13287.

Validation

  • git merge-base HEAD origin/release/11.0.1xx — matched the verified starting release commit, 8e578c48bfff490e5f443a1cd57bbe110bcb7fed.
  • git diff --cached --check — passed.
  • git grep -n -w -E 'CheckProjectItems|LogWarningsForFiles|ProcessRuntimePackLibraryDirectories' — no matches (exit 1, as expected).
  • dotnet msbuild .\RuntimePackLibraries.proj -nologo -t:CheckOuter and dotnet msbuild .\RuntimePackLibraries.proj -nologo -t:CheckInner — both passed on the final XML. The isolated project used the item groups from the two edited targets. Initial runs exposed fixture namespace and ordering issues, plus duplicate or spurious directory items; those were corrected before the final run.
  • dotnet build .\src\Xamarin.Android.Build.Tasks\Xamarin.Android.Build.Tasks.csproj --no-dependencies --no-restore -v:minimal — blocked before compilation by MSB4062: the checkout lacks xa-prep-tasks.dll.

Full validation runs in CI. The full repository and SDK builds, Prepare, BuildExtraApiLevels, and device tests were not run locally.


Pull Request
title and
description
should follow the
commit-messages.md workflow documentation, and in particular should include:

  • Useful description of why the change is necessary.
  • Links to issues fixed
  • Unit tests

Replace three custom tasks with MSBuild item operations and file-aware
XA0100 and XA0101 diagnostics. Preserve the release branch's Mono AOT
and runtime-pack library directory discovery for native linking.

(cherry picked from commit d48225b)

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 16:26

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.

🟡 Changes recommended

The added test does not exercise the separate inner-build RID filter, leaving matching, missing, and different RID metadata cases and their resulting directories and RuntimeIdentifier values untested.

1 open issue
1 file not reviewed
  • src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs: Generated file
What changed in this PR

Backports #13287 to release/11.0.1xx, moving simple .NET for Android build checks and runtime-library filtering from custom tasks into MSBuild targets without adding multithreaded task infrastructure.

Changes:

  • Replaces project-item checks and content warnings with file-associated AndroidError and AndroidWarning calls, and localizes XA0101.
  • Moves runtime-pack stub filtering into targets, retaining the release branch’s Mono AOT path.
  • Removes obsolete tasks and registrations, and adds focused diagnostic and filtering tests.
File Description
src/​Xamarin.Android.Build.Tasks/​Xamarin.Android.Common.targets Replaces project-check and content-warning tasks with target logic.
src/​Xamarin.Android.Build.Tasks/​Tests/​Xamarin.Android.Build.Tests/​InvalidConfigTests.cs Tests embedded-library errors and downstream build stopping.
src/​Xamarin.Android.Build.Tasks/​Tests/​Xamarin.Android.Build.Tests/​BuildWithLibraryTests.cs Tests content-warning suppression and promotion to errors.
src/​Xamarin.Android.Build.Tasks/​Tests/​Xamarin.Android.Build.Tests/​BuildTest2.cs Tests runtime-stub filtering and retained libraries.
src/​Xamarin.Android.Build.Tasks/​Tasks/​ProcessRuntimePackLibraryDirectories.cs Removes the runtime-pack filtering task.
src/​Xamarin.Android.Build.Tasks/​Tasks/​LogWarningsForFiles.cs Removes the per-file warning wrapper.
src/​Xamarin.Android.Build.Tasks/​Tasks/​CheckProjectItems.cs Removes the project-item validation task.
src/​Xamarin.Android.Build.Tasks/​Tasks/​AndroidWarning.cs Adds file association to warnings.
src/​Xamarin.Android.Build.Tasks/​Tasks/​AndroidError.cs Adds file association to errors.
src/​Xamarin.Android.Build.Tasks/​Properties/​Resources.resx Adds the localizable XA0101 message.
src/​Xamarin.Android.Build.Tasks/​Properties/​Resources.Designer.cs Adds the XA0101 resource accessor.
src/​Xamarin.Android.Build.Tasks/​Microsoft.Android.Sdk/​targets/​Microsoft.Android.Sdk.AssemblyResolution.targets Filters runtime stubs and records library directories using items.
src/​Xamarin.Android.Build.Tasks/​Microsoft.Android.Sdk/​targets/​Microsoft.Android.Sdk.Aot.targets Adds Mono-specific inner-build library-directory filtering.
Documentation/​docs-mobile/​messages/​index.md Removes obsolete task-prefix documentation.

Review effort: Balanced

@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto review

@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Nov 23, 2026
@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) November 23, 2026 21:23
@jonathanpeppers
jonathanpeppers merged commit 23cc101 into release/11.0.1xx Nov 23, 2026
45 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-backport-simple-task-logic-to-targets branch November 23, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants