Repository navigation
[release/11.0.1xx] [Xamarin.Android.Build.Tasks] Split ABI values in MSBuild - #13689
Conversation
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]>
|
Closing: this PR was opened by mistake. The backport commit stays local until the user asks for a PR. |
There was a problem hiding this comment.
🟡 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; armeabitriggers XA0115. - Removes the obsolete task and its registration while retaining
CheckProjectItems. - Removes the task’s
SPLdiagnostic-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))" /> |
|
Reopened: this PR was closed in error. |
|
@dalexsoto review |
dalexsoto
left a comment
There was a problem hiding this comment.
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 tostring.Split(char[], StringSplitOptions), and the itemIncludethen splits the;-joined result. So_BuildTargetAbisgets the same values, order and duplicates as the oldSplitPropertyoutput 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; armeabinow correctly reports XA0115, andarmeabi-v7anow reaches the XA1025 check. - No
SplitPropertyorSPLreferences remain. - The commits that have since landed on
release/11.0.1xx(theGetAppSettingsDirectoryremoval, #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.
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]>

Backport of #13482.
Use MSBuild string splitting instead of
SplitPropertyto produce_BuildTargetAbis. Comma and semicolon separators remain supported. MSBuild trims ABI names, sox86; armeabireports XA0115.Cherry-picked
787ac4a80aaa17fb4b188265a12854a58accb963with-x. Resolved the modify/delete conflict by deleting the release branch'sAndroidTaskversion ofSplitProperty.cs. Removed only its<UsingTask>registration, retained the release-onlyCheckProjectItemsregistration, and applied the sourceItemGroupin_DefineBuildTargetAbis. Removed theSPLdocumentation entry. No multithreaded task or-mtchanges were included. The source commit has no test changes.Validation:
git merge-base HEAD origin/release/11.0.1xxbefore cherry-picking: passed; both HEAD and the release branch were93e2c07df2cce9f11405b2d100c371f5d4b3e89a.git diff --cached --checkand XML parsing ofXamarin.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 usingdotnet-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 beforearmeabi. The last two produced the expected XA0115 error..\build.cmd Prepare: failed inside the build with MSB3027/MSB3021, because an existing system MSBuild node lockedXamarin.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.mdworkflow documentation, and in particular should include: