Repository navigation
[Xamarin.Android.Build.Tasks] Split ABI values in MSBuild - #13482
Conversation
Context: #3190 The `_DefineBuildTargetAbis` target invokes `<SplitProperty/>` only to turn `$(AndroidSupportedAbis)` into `@(_BuildTargetAbis)`. MSBuild already supports splitting the comma- and semicolon-separated values, so remove the task and construct the items directly. Item construction trims whitespace and drops whitespace-only entries. For example, `x86; armeabi` now reports XA0115 instead of letting the unsupported `armeabi` value slip through. Co-authored-by: Copilot App <[email protected]>
The documentation change is not needed for this target replacement. Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The ABI whitespace normalization and XA0115 behavior lack checked-in regression tests, leaving splitting and validation regressions undetected by CI.
1 open issue
What changed in this PR
This PR simplifies ABI parsing in the .NET for Android build targets by replacing the SplitProperty task with MSBuild’s string-splitting function.
Changes:
- Preserve comma and semicolon delimiters while trimming whitespace and dropping whitespace-only entries.
- Remove the unused task, its registration, and its diagnostic-prefix documentation.
- Document that whitespace-padded
armeabivalues now trigger XA0115.
| File | Description |
|---|---|
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets |
Replace task-based ABI splitting with an MSBuild expression. |
src/Xamarin.Android.Build.Tasks/Tasks/SplitProperty.cs |
Delete the obsolete splitting task. |
Documentation/docs-mobile/messages/xa0115.md |
Clarify whitespace handling for unsupported ABI values. |
Documentation/docs-mobile/messages/index.md |
Remove the obsolete SPL diagnostic prefix. |
Review effort: Balanced
| <Output TaskParameter="Output" ItemName="_BuildTargetAbis" /> | ||
| </SplitProperty> | ||
| <ItemGroup Condition="'@(_BuildTargetAbis)' == ''"> | ||
| <_BuildTargetAbis Include="$(AndroidSupportedAbis.Split(',;', StringSplitOptions.RemoveEmptyEntries))" /> |
|
/review |
|
✅ Android PR Reviewer completed successfully!
|
There was a problem hiding this comment.
✅ LGTM
Findings: 0 errors, 0 warnings, 1 non-blocking inline suggestion.
The replacement is appropriately scoped: the task, its registration and its documented exception prefix are removed consistently. The existing-item guard is preserved, and I found no correctness regression in the changed code.
Independent validation: standalone probes of the replacement expression passed on .NET 8 and .NET 10 MSBuild for comma/semicolon/mixed delimiters, empty input, whitespace normalization, existing items, wildcard literals and escaped semicolons. A separate x86; armeabi probe produced the expected XA0115. These were isolated MSBuild probes, not a full Android SDK build; Windows/.NET Framework MSBuild was not exercised locally.
CI: all 40 head-commit GitHub checks report success, including the aggregate dotnet-android check for Azure build 1675131. Direct Azure build/timeline inspection was unavailable because az devops invoke requires authentication in this environment.
Generated by Android PR Reviewer for #13482 · copilot · gpt61 · 61.3 AIC · ⌖ 7.41 AIC · ⊞ 19.5K
Comment /review to run again
| <Output TaskParameter="Output" ItemName="_BuildTargetAbis" /> | ||
| </SplitProperty> | ||
| <ItemGroup Condition="'@(_BuildTargetAbis)' == ''"> | ||
| <_BuildTargetAbis Include="$(AndroidSupportedAbis.Split(',;', StringSplitOptions.RemoveEmptyEntries))" /> |
There was a problem hiding this comment.
🤖 💡 Testing — Consider committing a parameterized regression test that invokes _DefineBuildTargetAbis for comma-separated, semicolon-separated and mixed input, empty/whitespace-only entries, and a pre-populated _BuildTargetAbis. Include x86; armeabi expecting XA0115 to lock in the intentional whitespace change. The standalone probes described in the PR are useful, but they are not retained in the suite, and IncrementalBuildDifferentDevice supplies only one ABI per build, so it would not catch losing one of the delimiters in a future refactor.
{Rule: Regression coverage for behavior changes}
|
/backport to release/11.0.1xx |
|
Started backporting to |
|
@jonathanpeppers backporting to git am output$ git cherry-pick 787ac4a80aaa17fb4b188265a12854a58accb963
Auto-merging Documentation/docs-mobile/messages/index.md
CONFLICT (modify/delete): src/Xamarin.Android.Build.Tasks/Tasks/SplitProperty.cs deleted in 787ac4a80 ([Xamarin.Android.Build.Tasks] Split ABI values in MSBuild (#13482)) and modified in HEAD. Version HEAD of src/Xamarin.Android.Build.Tasks/Tasks/SplitProperty.cs left in tree.
Auto-merging src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
CONFLICT (content): Merge conflict in src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
error: could not apply 787ac4a80... [Xamarin.Android.Build.Tasks] Split ABI values in MSBuild (#13482)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: [Xamarin.Android.Build.Tasks] Split ABI values in MSBuild
Using index info to reconstruct a base tree...
M Documentation/docs-mobile/messages/index.md
M src/Xamarin.Android.Build.Tasks/Tasks/SplitProperty.cs
M src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
Falling back to patching base and 3-way merge...
Auto-merging Documentation/docs-mobile/messages/index.md
CONFLICT (modify/delete): src/Xamarin.Android.Build.Tasks/Tasks/SplitProperty.cs deleted in [Xamarin.Android.Build.Tasks] Split ABI values in MSBuild and modified in HEAD. Version HEAD of src/Xamarin.Android.Build.Tasks/Tasks/SplitProperty.cs left in tree.
Auto-merging src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
CONFLICT (content): Merge conflict in src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 [Xamarin.Android.Build.Tasks] Split ABI values in MSBuild
Error: The process '/usr/bin/git' failed with exit code 128 |
Backport of #13482. Use MSBuild string splitting instead of `SplitProperty` to produce `_BuildTargetAbis`. Comma and semicolon separators remain supported. MSBuild trims ABI names, so `x86; armeabi` reports XA0115. Cherry-picked `787ac4a80aaa17fb4b188265a12854a58accb963` with `-x`. Resolved the modify/delete conflict by deleting the release branch's `AndroidTask` version of `SplitProperty.cs`. Removed only its `<UsingTask>` registration, retained the release-only `CheckProjectItems` registration, and applied the source `ItemGroup` in `_DefineBuildTargetAbis`. Removed the `SPL` documentation entry. No multithreaded task or `-mt` changes were included. The source commit has no test changes. (cherry picked from commit 787ac4a) Co-authored-by: Šimon Rozsíval <[email protected]> Co-authored-by: Copilot App <[email protected]>

_DefineBuildTargetAbisuses<SplitProperty/>only to split$(AndroidSupportedAbis). Use MSBuild's string-splitting function instead, and remove the task and its registration. Comma and semicolon delimiters remain supported (context: #3190).MSBuild trims whitespace around the resulting ABI names and drops whitespace-only entries. Consequently,
x86; armeabinow reports XA0115 instead of bypassing the unsupported-ABI check.Validation
make prepare— passed.make leeroy— passed, including local workload configuration../dotnet-local.sh test bin/TestDebug/net11.0/Xamarin.Android.Build.Tests.dll --filter "Name~IncrementalBuildDifferentDevice" --logger "console;verbosity=normal"— passed (CoreCLR and NativeAOT; 2 tests).Windows/.NET Framework MSBuild was not tested.