Repository navigation
[Xamarin.Android.Build.Tasks] Remove orphaned Cecil helpers - #13095
Merged
Merged
Conversation
Remove the internal Xamarin.Android.Tasks.CecilExtensions type, whose registration adapters and source lookup have no remaining callers. The SDK project includes this file implicitly, so no compile item needs removal. Product, friend-test, shared-source, and name-based reference checks find no consumers of this task-side type. Retain the separate JavaCallableWrappers CecilExtensions type: its CecilImporter and JavaTypeScanner callers are still live on main. Their pending removals must merge before that cleanup is safe. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Repository searches show no remaining consumers, and the focused validation covers the affected tooling paths.
0 open findings
What changed in this PR
Removes an unused, internal Cecil helper duplicate from the build-task assembly.
Changes:
- Deletes orphaned registration adapters and source-lookup helpers.
- Retains the separate, actively used Java.Interop implementation.
| File | Description |
|---|---|
src/Xamarin.Android.Build.Tasks/Utilities/CecilExtensions.cs |
Removes the unused helper type. |
🧠 Review effort: Balanced
jonathanpeppers
approved these changes
Oct 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
title and
description
should follow the
commit-messages.mdworkflow documentation, and in particular should include:Why
Remove the already-orphaned internal
Xamarin.Android.Tasks.CecilExtensionstype insrc/Xamarin.Android.Build.Tasks/Utilities/CecilExtensions.cs. Its registration adapters and source lookup have no remaining product or test callers on the current main branch. Keeping this unused duplicate obscures which Cecil helpers are still needed by the tooling.The containing type is internal despite its public members. Whole-repository source/member/name searches and C# reference lookup found no consumers, linked-source imports, reflection/configuration references, or generated-name references to this task-side type. The three friend-test assemblies have no callers either. This SDK-style project includes the file implicitly, so no explicit compile item needs removal.
This is a one-file, 187-line deletion, not the retirement of all Cecil helpers. No public API, shared naming/CRC code, Cecil package, metadata scanner, or runtime behavior changes. No new absence tests or unrelated cleanup. No issue is being closed.
Remaining prerequisites
The distinct internal
Java.Interop.Tools.JavaCallableWrappers.Utilities.CecilExtensionsstays unchanged. Its method/export/source helper chains are still called byCecilImporteron main and must wait until #13080 merges. Its type-registration chain remains live throughJavaTypeScannerand must wait for the separate scanner-removal change to merge. This PR is independently based on main; no pending PR trees were applied or stacked.Local validation
Validated code is committed as
cf0fff06adb02fbab9719498c7fdb0adb33d010c, based on290a2824be3e1cff18675587c4432c0e944c1f0f. All SDK builds and tests used this worktree's own Debug SDK, not sibling/stale binaries. No device install/run was performed: this only removes an unreachable host-tool type.Builds ran with
MSBUILDDISABLENODEREUSE=1,DOTNET_CLI_USE_MSBUILD_SERVER=0, andDOTNET_PROCESSOR_COUNT=2. MSBuild was bounded to-m:2. The session-only Ninja wrapper was verified to execute/Users/simon/android-toolchain/sdk/cmake/4.1.2/bin/ninja -j2 "$@"; native build logs confirm its use. There were no shared build-server kills or global configuration changes.For the command records below,
Nexpands to/Users/simon/.copilot/session-state/36bfc8ae-8b3f-45aa-84bc-3c98929dca49/files/ninja-j2,Bexpands to/Users/simon/.copilot/session-state/36bfc8ae-8b3f-45aa-84bc-3c98929dca49/files/baseline.targets, andFexpands to/Users/simon/.copilot/session-state/36bfc8ae-8b3f-45aa-84bc-3c98929dca49/files. These are the literal session paths used in the executed commands, abbreviated only for readability.Baseline
Baseline compilation restored the exact main-commit helper as a compile input, without undoing the working-tree deletion:
git show HEAD:src/Xamarin.Android.Build.Tasks/Utilities/CecilExtensions.csexported the tracked source to session storage (SHA-256d9fdb36c50e143b0b190bc9d87192a972e039414e2511874bcd74e21d9cb7be4). The session-only$Badds that source only toXamarin.Android.Build.TasksviaCustomBeforeMicrosoftCommonTargets. Compiler output confirms this input. Changed builds omit the import entirely.make prepare CONFIGURATION=Debug MSBUILD_ARGS="-m:2 -p:UseSharedCompilation=false -p:NinjaPath=$N"make all CONFIGURATION=Debug MSBUILD_ARGS="-m:2 -p:UseSharedCompilation=false -p:NinjaPath=$N -p:CustomBeforeMicrosoftCommonTargets=$B"ref/Mono.Android.dllhad not yet been generated../dotnet-local.sh build build-tools/scripts/Prepare.proj -t:BuildExtraApiLevels -c Debug -m:2 -p:UseSharedCompilation=false -p:NinjaPath=$N -p:CustomBeforeMicrosoftCommonTargets=$B -bl:$F/baseline-extra-api.binlogmake all CONFIGURATION=Debug MSBUILD_ARGS="-m:2 -p:UseSharedCompilation=false -p:NinjaPath=$N -p:CustomBeforeMicrosoftCommonTargets=$B"./dotnet-local.sh build src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj -c Debug -m:2 -p:UseSharedCompilation=false -p:NinjaPath=$N -p:CustomBeforeMicrosoftCommonTargets=$B -bl:$F/baseline-tasks.binlognetstandard2.0, zero errors../dotnet-local.sh build src/Microsoft.Android.Sdk.ILLink/Microsoft.Android.Sdk.ILLink.csproj -c Debug -m:2 -p:UseSharedCompilation=false -p:NinjaPath=$N -p:CustomBeforeMicrosoftCommonTargets=$B -bl:$F/baseline-illink.binlognet11.0, zero errors../dotnet-local.sh test bin/TestDebug/net10.0/Xamarin.Android.Build.Tests.dll --filter 'FullyQualifiedName~LinkerTests.LinkAssembliesNoShrink|FullyQualifiedName~LinkerTests.PostTrimmingSkipsLegacyAbstractFixups|FullyQualifiedName~LinkerTests.FixAbstractMethodsStep_|FullyQualifiedName~LinkerTests.PreTrimmingFixLegacyBindings|FullyQualifiedName~GeneratePackageManagerJavaTests|FullyQualifiedName~BindingBuildTest.DotNetBuildBinding' --logger 'trx;LogFileName=baseline-host-focused.trx' --results-directory $F./dotnet-local.sh test bin/TestDebug/net10.0/Xamarin.Android.Build.Tests.dll --filter 'FullyQualifiedName~LinkerTests.LinkDescription' --logger 'trx;LogFileName=baseline-linker-integration.trx' --results-directory $FChanged tree
make all CONFIGURATION=Debug MSBUILD_ARGS="-m:2 -p:UseSharedCompilation=false -p:NinjaPath=$N"./dotnet-local.sh build src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj -c Debug -m:2 -p:UseSharedCompilation=false -p:NinjaPath=$N -bl:$F/changed-tasks.binlognetstandard2.0, zero errors../dotnet-local.sh build src/Microsoft.Android.Sdk.ILLink/Microsoft.Android.Sdk.ILLink.csproj -c Debug -m:2 -p:UseSharedCompilation=false -p:NinjaPath=$N -bl:$F/changed-illink.binlognet11.0, zero errors../dotnet-local.sh test bin/TestDebug/net10.0/Xamarin.Android.Build.Tests.dll --filter 'FullyQualifiedName~LinkerTests.LinkAssembliesNoShrink|FullyQualifiedName~LinkerTests.PostTrimmingSkipsLegacyAbstractFixups|FullyQualifiedName~LinkerTests.FixAbstractMethodsStep_|FullyQualifiedName~LinkerTests.PreTrimmingFixLegacyBindings|FullyQualifiedName~GeneratePackageManagerJavaTests|FullyQualifiedName~BindingBuildTest.DotNetBuildBinding|FullyQualifiedName~LinkerTests.LinkDescription' --logger 'trx;LogFileName=changed-host.trx' --results-directory $Fgit diff --check HEAD^ HEADTRX comparison confirms identical outcomes for every one of the 16 baseline/changed cases. Coverage includes CoreCLR/NativeAOT binding builds, no-shrink/pre-trimming/post-trimming task paths, package-manager generation, and CoreCLR ILLink integration.
LinkDescription(False,CoreCLR)is skipped in both runs because CoreCLR does not support builds without assembly stores. Existing generated-binding and duplicate nullable-source warnings remain; there are no build errors.