Skip to content

[Java.Interop] Retire JavaTypeScanner and unused Cecil helpers - #13122

Merged
simonrozsival merged 1 commit into
mainfrom
simonrozsival-legacy-java-scanner-retirement
Oct 13, 2026
Merged

simonrozsival merged 1 commit into
mainfrom
simonrozsival-legacy-java-scanner-retirement

Conversation

@simonrozsival

@simonrozsival simonrozsival commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Remove Java.Interop.Tools.JavaCallableWrappers.JavaTypeScanner now
that its last consumers were retired in #13080
and #13094. Also remove
Java.Interop.Tools.JavaCallableWrappers.Utilities.CecilExtensions:
its type-registration adapter was used only by the scanner, and its
method/export/source adapters lost their consumers with the old emitter.
This intentionally retires the public tooling scanner without a stub.

Keep the assembly, shared naming/hash/identifier utilities, modern
JavaPeerScanner, and all remaining tests unchanged. Update only the
existing test-catalog descriptions that still advertised legacy scanning.
Binding-reference, tracked-source, linked-file, and configuration searches
found no live consumers. Comparing the baseline and final implementation
and reference assemblies shows only the two intended type removals; the
other 29 top-level definitions have identical IL after normalizing address
layout.

Validation: the own-worktree Debug SDK build and explicit affected
builds passed. Baseline/changed naming tests passed 18/18 and binding
generator tests passed 478/478. Generator-helper tests passed 18/18,
SDK-backed modern typemap tests passed 34/34, and focused host integration
passed 24/24 across CoreCLR and NativeAOT. Final runs have no failures or
skips, including all seven framework cases initially skipped before the
local SDK was prepared. Device tests were not run: this removes unused
host tooling and does not change generated code or runtime paths.

Local validation commands and results

All commands ran in this worktree, on the committed change based on
e03caec36337c9c5698cc60ca3e2ae50839636a5.

Command Result
dotnet build external/Java.Interop/src/Java.Interop.Tools.JavaCallableWrappers/Java.Interop.Tools.JavaCallableWrappers.csproj -c Debug -f netstandard2.0 -m:2 --disable-build-servers -v minimal Baseline and changed passed; 0 warnings/errors
dotnet test external/Java.Interop/tests/Java.Interop.Tools.JavaCallableWrappers-Tests/Java.Interop.Tools.JavaCallableWrappers-Tests.csproj -c Debug -m:2 --disable-build-servers -v minimal Baseline and changed: 18 passed, 0 skipped
dotnet test external/Java.Interop/tests/generator-Tests/generator-Tests.csproj -c Debug -m:2 --disable-build-servers -v minimal Baseline and changed: 478 passed, 0 skipped
dotnet test external/Java.Interop/tests/Java.Interop.Tools.Generator-Tests/Java.Interop.Tools.Generator-Tests.csproj -c Debug -m:2 --disable-build-servers -v minimal 18 passed, 0 skipped
dotnet build external/Java.Interop/tools/generator/generator.csproj -c Debug -f net10.0 -m:2 --disable-build-servers -v minimal Passed; 0 warnings/errors
dotnet build external/Java.Interop/src/Java.Interop.Tools.TypeNameMappings/Java.Interop.Tools.TypeNameMappings.csproj -c Debug -f net10.0 -m:2 --disable-build-servers -v minimal Passed; 0 warnings/errors
dotnet build src/Microsoft.Android.Sdk.TrimmableTypeMap/Microsoft.Android.Sdk.TrimmableTypeMap.csproj -c Debug -f net11.0 -m:2 --disable-build-servers -v minimal Passed; 0 warnings/errors
make prepare CONFIGURATION=Debug MSBUILD_ARGS='-m:2 --disable-build-servers -nr:false' Passed; provisioned the repository-pinned local SDK
make all CONFIGURATION=Debug MSBUILD_ARGS='-m:2 --disable-build-servers -nr:false -p:NinjaPath=/Users/simon/.copilot/session-state/2930120b-d71d-4dc9-b958-174c233d5b97/files/scanner-ninja-j2' Final full solution and local-workload build passed
./dotnet-local.sh build Microsoft.Android.slnx -t:BuildExtraApiLevels -c Debug -m:2 --disable-build-servers -nr:false -p:NinjaPath=/Users/simon/.copilot/session-state/2930120b-d71d-4dc9-b958-174c233d5b97/files/scanner-ninja-j2 -bl:/Users/simon/.copilot/session-state/2930120b-d71d-4dc9-b958-174c233d5b97/files/scanner-sdk-extra-apis.binlog Passed; built the missing own API 37.1/37.2 reference outputs; 62 existing generated/API warnings
./dotnet-local.sh build build-tools/create-packs/Microsoft.Android.Sdk.proj -t:ConfigureLocalWorkload -c Debug -m:2 --disable-build-servers -nr:false -v minimal Passed
./dotnet-local.sh build src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj -c Debug -m:2 --disable-build-servers -nr:false -v minimal Passed at declared netstandard2.0, with own modern-framework dependencies; 30 existing warnings
./dotnet-local.sh test src/Microsoft.Android.Build.Tasks/Tests/Microsoft.Android.Build.Tasks.Tests/Microsoft.Android.Build.Tasks.Tests.csproj -c Debug -m:2 --disable-build-servers -nr:false -v minimal --filter 'FullyQualifiedName~GenerateTrimmableTypeMapTests|FullyQualifiedName~TrimmableTypeMap' --logger 'trx;LogFileName=scanner-modern-framework.trx' --results-directory /Users/simon/.copilot/session-state/2930120b-d71d-4dc9-b958-174c233d5b97/files 34 passed, 0 skipped; all seven SDK-dependent cases passed

The session-only Ninja wrapper executes the prepared real Ninja with
-j2, without changing shared tools or repository build files.

Focused host validation used the following selection:

HOST_FILTER='FullyQualifiedName~BindingBuildTest.DotNetBuildBinding|FullyQualifiedName~BindingBuildTest.UnmanagedCallersOnlyCallbacks|FullyQualifiedName~BindingBuildTest.BindingLibraryIncremental|FullyQualifiedName~TrimmableTypeMapBuildTests.BindingCallbackFormatSupportsDefaultConsumer|FullyQualifiedName~TrimmableTypeMapBuildTests.Build_ImplicitConstructorUsesCompatibleBaseJniSignature|FullyQualifiedName~TrimmableTypeMapBuildTests.Build_ExplicitExportConstructorAttributeOrders_PreserveJniSignatures|FullyQualifiedName~TrimmableTypeMapBuildTests.Build_WithTrimmableTypeMap_AbstractTypeWithProtectedCtor_Succeeds|FullyQualifiedName~TrimmableTypeMapBuildTests.TrimmableTypeMap_PreservesJniOnlyConstructorThroughR8|FullyQualifiedName~TrimmableTypeMapBuildTests.TrimmableTypeMap_PackagesAndroidJavaProxyThrowable|FullyQualifiedName~TrimmableTypeMapBuildTests.RetainedTypeMapRulesDriveR8|FullyQualifiedName~TrimmableTypeMapBuildTests.TrimmableTypeMap_PreserveLists_ArePackagedInSdk|FullyQualifiedName~TrimmableTypeMapBuildTests.TrimmableTypeMap_ReferencePack_DoesNotShipLegacyPlatformJcws|FullyQualifiedName~TrimmableTypeMapBuildTests.TrimmableTypeMap_RuntimeArtifacts_ArePackagedInSdk|FullyQualifiedName~TrimmableTypeMapBuildTests.ReleaseCoreClrTrimmableTypeMap_RemovesUnreferencedBindingOutputs|FullyQualifiedName~TrimmableTypeMapBuildTests.Build_TrimmableTypeMap_UsesMonoAndroidImplementationMetadata'
NUNIT_MSBUILD_ARGS=$'-m:2\n-nr:false\n-p:UseSharedCompilation=false' DOTNET_CLI_USE_MSBUILD_SERVER=0 ./dotnet-local.sh test bin/TestDebug/net10.0/Xamarin.Android.Build.Tests.dll --filter "$HOST_FILTER" --logger 'trx;LogFileName=scanner-host.trx' --results-directory /Users/simon/.copilot/session-state/2930120b-d71d-4dc9-b958-174c233d5b97/files -- NUnit.NumberOfTestWorkers=2

Result: 24 passed, 0 failed, 0 skipped (7m27s). This covers binding
incrementality, default callbacks, constructor signatures, JNI-only R8
retention, reference/runtime packaging, and removal of unused bindings.

Resolved preparation/invocation failures: the first cold solution
compile lacked generated ANDROID_* constants; an unchanged retry
imported the generated project items. Local workload configuration needed
the existing BuildExtraApiLevels target before API 37.1/37.2 packs were
available. Passing -f netstandard2.0 to the task project leaked that
framework to its modern dependencies; using its declared framework fixed
the invocation. The first host attempt put multiple response-file
arguments on one line; newline-separated arguments fixed it. All retries
used unchanged sources, without pin or build-file workarounds.


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

No linked issue; this is the follow-up retirement to #13080 and #13094.

Remove the unused public scanner and its internal attribute, export, and source adapters after the legacy consumers were retired. Preserve shared peer naming utilities and all remaining tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 14:43

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.

🟢 Approval recommended

The intentional API retirement is internally consistent, and repository searches found no remaining consumers.

0 open findings

What changed in this PR

Retires obsolete Java callable-wrapper scanning code while preserving modern typemap scanning and shared naming utilities.

Changes:

  • Removes the unused public JavaTypeScanner.
  • Removes its obsolete Cecil adapter helpers.
  • Updates test-catalog descriptions to reflect remaining coverage.
File Description
JavaTypeScanner.cs Removes the retired legacy scanner.
CecilExtensions.cs Removes helpers with no remaining consumers.
test-catalog.md Updates test-suite scope and coverage notes.

🧠 Review effort: Balanced

@simonrozsival simonrozsival added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Oct 13, 2026
@simonrozsival
simonrozsival enabled auto-merge (squash) October 13, 2026 18:12
@simonrozsival

Copy link
Copy Markdown
Member Author

@dalexsoto review

@simonrozsival
simonrozsival merged commit bf1cade into main Oct 13, 2026
42 checks passed
@simonrozsival
simonrozsival deleted the simonrozsival-legacy-java-scanner-retirement branch October 13, 2026 20:08
@dalexsoto

Copy link
Copy Markdown
Member

@simonrozsival Not reviewing this request in this iteration: The PR merged before the review could be completed, so no GitHub review will be submitted.

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.

4 participants