Skip to content

Remove obsolete SetAndroidSupportedAbis usage from test code#11390

Merged
jonathanpeppers merged 2 commits into
mainfrom
copilot/remove-obsolete-setandroidsupportedabis
May 18, 2026
Merged

Remove obsolete SetAndroidSupportedAbis usage from test code#11390
jonathanpeppers merged 2 commits into
mainfrom
copilot/remove-obsolete-setandroidsupportedabis

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 18, 2026

Migrate all 49 call sites of the deprecated SetAndroidSupportedAbis extension methods to SetRuntimeIdentifiers and remove the obsolete method definitions.

Changes

  • Call site migration across 18 test files using pattern-appropriate replacements:
    • Single-ABI variables (DeviceAbi, abi, supportedAbi) → new[] { variable }
    • Semicolon-separated strings (supportedAbis) → variable.Split (';')
    • Already-array variables (abis, Abis) → passed directly
    • Literal params/collection expressions → new[] { ... }
  • Removed both [Obsolete] SetAndroidSupportedAbis overloads from ProjectExtensions.cs

Example

// Before
proj.SetAndroidSupportedAbis ("armeabi-v7a;arm64-v8a");
proj.SetAndroidSupportedAbis (DeviceAbi);
proj.SetAndroidSupportedAbis ("armeabi-v7a", "arm64-v8a", "x86", "x86_64");

// After
proj.SetRuntimeIdentifiers (supportedAbis.Split (';'));
proj.SetRuntimeIdentifiers (new[] { DeviceAbi });
proj.SetRuntimeIdentifiers (new[] { "armeabi-v7a", "arm64-v8a", "x86", "x86_64" });

No behavioral change — SetAndroidSupportedAbis was already a trivial wrapper around SetRuntimeIdentifiers.

…and remove obsolete methods

Agent-Logs-Url: https://github.com/dotnet/android/sessions/bf2f73b1-2c2b-4c71-bac8-b0236134e8c2

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove obsolete SetAndroidSupportedAbis usage from test code Remove obsolete SetAndroidSupportedAbis usage from test code May 18, 2026
Copilot AI requested a review from jonathanpeppers May 18, 2026 14:20
@jonathanpeppers jonathanpeppers marked this pull request as ready for review May 18, 2026 15:10
Copilot AI review requested due to automatic review settings May 18, 2026 15:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Mechanical refactor that removes the obsolete SetAndroidSupportedAbis test helper extension and migrates all call sites to the existing SetRuntimeIdentifiers API. Since SetAndroidSupportedAbis was already a thin wrapper around SetRuntimeIdentifiers, there is no behavioral change.

Changes:

  • Deleted both [Obsolete] SetAndroidSupportedAbis overloads from ProjectExtensions.cs.
  • Migrated 49 call sites across 18 test files, using new[] { ... } for single-ABI/params cases, .Split(';') for semicolon-delimited strings, and passing arrays directly otherwise.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Utilities/ProjectExtensions.cs Removes obsolete params/string overloads.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AotTests.cs Migrates 3 call sites.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs Migrates 2 call sites.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs Migrates single-ABI call.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/EnvironmentContentTests.cs Migrates string-ABI calls via Split.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs Migrates 4 call sites.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs Migrates string-ABI call via Split.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs Migrates 2 call sites.
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs Migrates single-literal call.
tests/MSBuildDeviceIntegration/Tests/AotProfileTests.cs Migrates DeviceAbi call.
tests/MSBuildDeviceIntegration/Tests/BundleToolTests.cs Migrates Abis array call.
tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs Migrates 3 call sites.
tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs Migrates 13 call sites.
tests/MSBuildDeviceIntegration/Tests/InstallTests.cs Migrates 8 call sites.
tests/MSBuildDeviceIntegration/Tests/MarshalMethodsGCHangTests.cs Migrates DeviceAbi call.
tests/MSBuildDeviceIntegration/Tests/MonoAndroidExportTest.cs Migrates 2 call sites.
tests/MSBuildDeviceIntegration/Tests/PerformanceTest.cs Migrates DeviceAbi call.
tests/MSBuildDeviceIntegration/Tests/SystemApplicationTests.cs Migrates DeviceAbi call.

Copy link
Copy Markdown
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

Test failures unrelated.

@jonathanpeppers jonathanpeppers merged commit ba6ee4e into main May 18, 2026
6 of 7 checks passed
@jonathanpeppers jonathanpeppers deleted the copilot/remove-obsolete-setandroidsupportedabis branch May 18, 2026 17:45
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.

[fix-finder] Remove obsolete SetAndroidSupportedAbis usage from test code

3 participants