Repository navigation
[release/11.0.1xx] [Xamarin.Android.Build.Tasks] Move simple task logic to targets - #13733
Merged
jonathanpeppers merged 1 commit intoNov 23, 2026
Conversation
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]>
Contributor
There was a problem hiding this comment.
🟡 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
AndroidErrorandAndroidWarningcalls, 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
7 tasks
Member
Author
|
@dalexsoto review |
jonathanpeppers
enabled auto-merge (squash)
November 23, 2026 21:23
simonrozsival
approved these changes
Nov 23, 2026
jonathanpeppers
deleted the
jonathanpeppers-backport-simple-task-logic-to-targets
branch
November 23, 2026 22:40
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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
-mtinfrastructure.Conflict resolutions
Keep
StripNativeLibrariesin 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 andlibarchive-dso-stub.soexclusion, 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
SplitPropertyregistration. Add only the EnglishXA0101resource and accessor, before the existingXA0104entry.Keep the focused build tests for diagnostics and runtime library filtering, including a release-specific Mono stub case.
Keep the existing
_CheckProjectItemsMSBuild target name (Xamarin.Android.Common.targets,Microsoft.Android.Sdk.BuildOrder.targets,InvalidConfigTests.cs). It is a target, not the deleted task, andmainkeeps 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:CheckOuteranddotnet 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 byMSB4062: the checkout lacksxa-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.mdworkflow documentation, and in particular should include: