Skip to content

[release/11.0.1xx] [Xamarin.Android.Build.Tasks] Split ABI values in MSBuild - #13689

Merged
jonathanpeppers merged 1 commit into
release/11.0.1xxfrom
jonathanpeppers-backport-splitproperty-xml
Nov 20, 2026
Merged

jonathanpeppers merged 1 commit into
release/11.0.1xxfrom
jonathanpeppers-backport-splitproperty-xml

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

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.

Validation:

  • git merge-base HEAD origin/release/11.0.1xx before cherry-picking: passed; both HEAD and the release branch were 93e2c07df2cce9f11405b2d100c371f5d4b3e89a.
  • git diff --cached --check and XML parsing of Xamarin.Android.Common.targets: passed.
  • git grep -n SplitProperty: no tracked references remain.
  • & 'C:\Users\jopepper\.copilot\session-state\bff4c1b5-ee54-4130-a061-b4c808220546\files\check-splitproperty.ps1' -Repository (Get-Location).Path: passed eight checks using dotnet-local.cmd msbuild <case>.proj -t:Check -v:quiet -nodeReuse:false. The script extracts the actual target. Cases: comma, semicolon, mixed/empty separators, whitespace, empty input, pre-existing ABI items, armeabi, and whitespace before armeabi. The last two produced the expected XA0115 error.
  • .\build.cmd Prepare: failed inside the build with MSB3027/MSB3021, because an existing system MSBuild node locked Xamarin.Android.Tools.AndroidSdk.dll. The wrapper returned 0 despite the failure.
  • .\dotnet-local.cmd msbuild Microsoft.Android.slnx -t:Prepare -nodeReuse:false -v:minimal -bl:C:\Users\jopepper\.copilot\session-state\bff4c1b5-ee54-4130-a061-b4c808220546\files\splitproperty-prepare.binlog: failed with the same file lock. The existing node was not stopped.
  • .\dotnet-local.cmd build Microsoft.Android.slnx -c Debug -nodeReuse:false -v:quiet -bl:C:\Users\jopepper\.copilot\session-state\bff4c1b5-ee54-4130-a061-b4c808220546\files\splitproperty-build.binlog: passed, 0 errors, 137 warnings.
  • .\dotnet-local.cmd test bin\TestDebug\net10.0\Xamarin.Android.Build.Tests.dll --filter "Name~ChangeSupportedAbis|Name~AbiNameInIntermediateOutputPath" -v:minimal --logger "trx;LogFileName=splitproperty-focused.trx" --results-directory C:\Users\jopepper\.copilot\session-state\bff4c1b5-ee54-4130-a061-b4c808220546\files: four tests failed with NETSDK1147 before testing the change; the local Android workload was not configured. An earlier attempt before the product build finished had no test DLL, and an initial filter invocation had a Windows shell quoting error.
  • .\dotnet-local.cmd build Microsoft.Android.slnx -t:BuildExtraApiLevels -c Debug -nodeReuse:false -v:quiet -bl:C:\Users\jopepper\.copilot\session-state\bff4c1b5-ee54-4130-a061-b4c808220546\files\splitproperty-extra-apis.binlog: stopped on request. No further SDK setup or integration test runs were done.

Full validation will run in CI.


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 SplitProperty with MSBuild string splitting and remove the task registration and SPL documentation entry. Preserve release-only task registrations.

(cherry picked from commit 787ac4a)

Co-authored-by: Copilot App <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 20, 2026 17:12
@jonathanpeppers

Copy link
Copy Markdown
Member Author

Closing: this PR was opened by mistake. The backport commit stays local until the user asks for a PR.

@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-backport-splitproperty-xml branch November 20, 2026 17:13

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

Checked-in target-level regression tests are missing for comma/semicolon parsing, whitespace normalization, empty entries, and XA0115 rejection of x86; armeabi, while the session-local validation script will not run in CI.

1 open issue
What changed in this PR

Backports #13482 to release/11.0.1xx, simplifying ABI parsing in the .NET for Android build targets by replacing SplitProperty with MSBuild string splitting.

Changes:

  • Preserves comma and semicolon separators while normalizing whitespace, so x86; armeabi triggers XA0115.
  • Removes the obsolete task and its registration while retaining CheckProjectItems.
  • Removes the task’s SPL diagnostic-prefix documentation.
File Description
src/​Xamarin.Android.Build.Tasks/​Xamarin.Android.Common.targets Replaces the task invocation with MSBuild splitting and removes its registration.
src/​Xamarin.Android.Build.Tasks/​Tasks/​SplitProperty.cs Deletes the obsolete splitting task.
Documentation/​docs-mobile/​messages/​index.md Removes the obsolete SPL entry.

Review effort: Balanced

<Output TaskParameter="Output" ItemName="_BuildTargetAbis" />
</SplitProperty>
<ItemGroup Condition="'@(_BuildTargetAbis)' == ''">
<_BuildTargetAbis Include="$(AndroidSupportedAbis.Split(',;', StringSplitOptions.RemoveEmptyEntries))" />
@jonathanpeppers
jonathanpeppers restored the jonathanpeppers-backport-splitproperty-xml branch November 20, 2026 17:17
@jonathanpeppers

Copy link
Copy Markdown
Member Author

Reopened: this PR was closed in error.

@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto review

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed c21ce9c1 against release/11.0.1xx at cad3870a. This is a static, read-only review.

LGTM. This is a faithful backport of #13482. The _DefineBuildTargetAbis change (Xamarin.Android.Common.targets:2534-2536) matches main exactly. The only release-specific differences are the deleted task's AndroidTask base and keeping the release-only CheckProjectItems <UsingTask>.

  • $(AndroidSupportedAbis.Split(',;', StringSplitOptions.RemoveEmptyEntries)) late-binds to string.Split(char[], StringSplitOptions), and the item Include then splits the ;-joined result. So _BuildTargetAbis gets the same values, order and duplicates as the old SplitProperty output for comma, semicolon, mixed and empty input.
  • The only behaviour change is the intended one: entries are trimmed and whitespace-only entries are dropped. So x86; armeabi now correctly reports XA0115, and armeabi-v7a now reaches the XA1025 check.
  • No SplitProperty or SPL references remain.
  • The commits that have since landed on release/11.0.1xx (the GetAppSettingsDirectory removal, #13683 and #13690) don't overlap these hunks.

On the bot's testing comment: target-level tests for comma and whitespace parsing would be a nice follow-up on main. But main shipped this exact change without them, and the existing ABI build tests already cover _DefineBuildTargetAbis with semicolon and single-ABI values, so I don't think they should block the backport.

@jonathanpeppers
jonathanpeppers merged commit 114dc5e into release/11.0.1xx Nov 20, 2026
45 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers-backport-splitproperty-xml branch November 20, 2026 21:50
jonathanpeppers added a commit that referenced this pull request Nov 24, 2026
Allow AppendCustomMetadataToItemGroup, RuntimeIdentifierToAbi, and ProcessRuntimePackLibraryDirectories to run in-process in multithreaded MSBuild. Keep the release branch XML replacement for SplitProperty from #13689.

Bring over the MT task base and exception path handling, MSBuild 18.9.6, task authoring analyzer, documentation, and tests. Preserve the release branch dependency versions and references.

(cherry picked from commit 4ffbe4d)

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants