Skip to content

[Xamarin.Android.Build.Tasks] Split ABI values in MSBuild - #13482

Merged
simonrozsival merged 2 commits into
mainfrom
simonrozsival-splitproperty-to-xml
Nov 11, 2026
Merged

simonrozsival merged 2 commits into
mainfrom
simonrozsival-splitproperty-to-xml

Conversation

@simonrozsival

Copy link
Copy Markdown
Member

_DefineBuildTargetAbis uses <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; armeabi now 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).
  • A standalone 32-case differential comparison matched the original task in 23 cases; the other 9 were the intentional whitespace differences. An additional probe of the built SDK target checked wildcard literals, escaped delimiters, existing items, empty input, and XA0115.

Windows/.NET Framework MSBuild was not tested.

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]>
Copilot AI balanced review requested due to automatic review settings November 11, 2026 10:59
The documentation change is not needed for this target replacement.

Co-authored-by: Copilot App <[email protected]>

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 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 armeabi values 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))" />
@simonrozsival simonrozsival added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Nov 11, 2026
@simonrozsival

Copy link
Copy Markdown
Member Author

/review

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Android PR Reviewer completed successfully!

Generated by Android PR Reviewer for #13482

@github-actions github-actions Bot 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.

✅ 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))" />

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.

🤖 💡 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}

@simonrozsival
simonrozsival merged commit 787ac4a into main Nov 11, 2026
40 checks passed
@simonrozsival
simonrozsival deleted the simonrozsival-splitproperty-to-xml branch November 11, 2026 17:11
@jonathanpeppers

Copy link
Copy Markdown
Member

/backport to release/11.0.1xx

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/11.0.1xx (link to workflow run)

@github-actions

Copy link
Copy Markdown
Contributor

@jonathanpeppers backporting to release/11.0.1xx failed, the patch most likely resulted in conflicts. Please backport manually!

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

Link to workflow output

jonathanpeppers added a commit that referenced this pull request Nov 20, 2026
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]>
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