Repository navigation
[Xamarin.Android.Build.Tasks] Remove typemap implementation selector - #13024
Conversation
The trimmable type map is the sole supported implementation. Remove AndroidTypeMapImplementation defaults, branching, cache input and validation rather than retaining a selector with no alternative. Make runtime fixtures unconditional and simplify the test matrices while preserving CoreCLR and NativeAOT coverage. Test that obsolete assignments are ignored, retire XA4267, and update diagnostics and documentation. Co-authored-by: Copilot App <[email protected]>
|
@dalexsoto review |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It changes the shipped MSBuild pipeline, while full SDK, integration, and device validation remains blocked.
Review effort: Balanced
Findings: 1
What changed in this PR
Removes the obsolete typemap implementation selector now that trimmable typemaps are universal.
Changes:
- Always enables trimmable typemap targets and runtime artifacts.
- Removes obsolete validation, defaults, and test parameters.
- Updates diagnostics, tests, and documentation.
| File | Description |
|---|---|
tests/MSBuildDeviceIntegration/Tests/WebViewJavascriptInterfaceTests.cs |
Removes selector parameterization. |
tests/MSBuildDeviceIntegration/Tests/R8ObfuscationTests.cs |
Removes explicit selector assignment. |
tests/MSBuildDeviceIntegration/Tests/InterfaceCollectionTests.cs |
Removes explicit selector assignment. |
tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs |
Simplifies typemap test matrices. |
tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj |
Unconditionally includes typemap fixtures. |
tests/Android.Benchmarks/Android.Benchmarks.csproj |
Removes obsolete property. |
src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets |
Always selects the trimmable pipeline and JAR. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/TrimmableTypeMapBuildTests.cs |
Tests obsolete values are ignored. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/LinkerTests.cs |
Removes obsolete test setup. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs |
Removes obsolete test setup. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/InvalidConfigTests.cs |
Replaces selector validation tests. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/IncrementalBuildTest.cs |
Removes obsolete property. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BindingBuildTest.cs |
Removes obsolete property. |
src/Xamarin.Android.Build.Tasks/Properties/Resources.resx |
Retires XA4267 and updates diagnostics. |
src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs |
Synchronizes generated resource descriptions. |
src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets |
Removes selector prerequisite validation. |
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.targets |
Removes selector conditions. |
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.CoreCLR.targets |
Unconditionally enables applicable CoreCLR targets. |
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Proguard.targets |
Removes selector gates from R8 targets. |
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets |
Removes selector default. |
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets |
Removes global selector default. |
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets |
Removes selector-dependent metadata conditions. |
src/Mono.Android/Mono.Android.targets |
Removes callback selector validation. |
src/Microsoft.Android.Sdk.TrimmableTypeMap/README.md |
Updates pipeline description. |
src/Microsoft.Android.Build.Tasks/Tests/Microsoft.Android.Build.Tasks.Tests/TypeMapProguardTargetsTests.cs |
Adds obsolete-value regression coverage. |
Documentation/guides/internals/JavaJNI_Interop.md |
Documents universal trimmable typemaps. |
Documentation/docs-mobile/TOC.yml |
Removes XA4267 entry. |
Documentation/docs-mobile/messages/xa4267.md |
Deletes retired diagnostic documentation. |
Documentation/docs-mobile/messages/xa4266.md |
Removes selector wording. |
Documentation/docs-mobile/messages/xa4265.md |
Updates unsupported-format guidance. |
Documentation/docs-mobile/messages/index.md |
Updates diagnostic index. |
Documentation/docs-mobile/building-apps/build-properties.md |
Marks the selector ineffective. |
.github/skills/tests/SKILL.md |
Updates test guidance. |
.github/skills/tests/references/test-catalog.md |
Updates typemap test commands. |
.github/copilot-instructions.md |
Removes selector arguments from validation commands. |
Files not reviewed (1)
- src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs: Generated file
dalexsoto
left a comment
There was a problem hiding this comment.
The complete 35-file static review found no source blocker in retiring the selector. Ignoring obsolete assignments, using the sole trimmable pipeline/JAR, preserving non-selector guards, and unconditional fixture inclusion are accepted. Source/generated-resource, target/incremental and test-contract checks completed; optional local SDK/device limitations were not converted into findings.
One current platform blocker remains: this exact head is nonmergeable. Fresh GitHub metadata reports mergeable=false, mergeable_state=dirty, and rebaseable=false. Please resolve the conflicts and validate the resulting revision. The 43 successful exact-head checks do not clear the current conflicts. No conflict filename or compiled source failure is invented from those metadata fields.
Merge main to resolve the runtime test project conflict. Preserve the new transferred-reference fixture and include it unconditionally, matching the sole supported typemap implementation. Reword test guidance so it no longer implies an optional typemap mode. Validation: 98 focused standalone tests passed, 7 skipped. All 12 modified XML files parsed, and all main-branch Compile and ProjectReference entries are preserved. Full SDK preparation remains blocked by missing Microsoft.NETCore.App.Ref 10.0.13 (NU1102). Co-authored-by: Copilot App <[email protected]>
|
@dalexsoto Resolved the merge conflict in 88e2c4a by merging current Validation on the merged revision: 98 focused standalone tests passed, 7 skipped, 0 failed (including the new activation-cleanup tests). All 12 modified XML files parse, and all 84 Compile items and five ProjectReference items from main are preserved. Exact test commands and results are recorded in the PR description.
|
dalexsoto
left a comment
There was a problem hiding this comment.
The complete current 35-file source review found no source blocker. The merged TransferredReferenceTests and all 84 Compile/five ProjectReference items are preserved; ignored obsolete assignments, non-selector guards, imports, JAR/UCO, incremental/Clean contracts and generated diagnostics remain consistent. The separate integration/completeness and final sweeps completed; optional local SDK/device limitations were not converted into findings.
Resolve the newly observed current merge conflicts. Your earlier resolution on 88e2c4a was confirmed mergeable, but fresh GitHub metadata for this same head now reports mergeable=false and mergeable_state=dirty. The 42 successful exact-head checks do not clear the current platform conflict state. Please update against the target branch, resolve the conflicts and validate the resulting revision. This is newly observed platform evidence on the updated head, not a claim that your earlier resolution failed or that a source defect was found. No conflict filename or compiled source error is invented from those metadata fields.
Merge current main while retaining its R8 target import, policy cache inputs, fallback producer tests, NativeAOT opt-in coverage and concurrent assembly-store device test. Remove obsolete selector arguments from new typemap tests without dropping runtime or policy cases. Validation: 362 focused standalone typemap and R8 tests passed, 7 skipped. All 12 modified XML files parse; 204 retained target contracts and all current-main test matrices in conflicted fixtures are preserved. Full SDK preparation remains blocked by unavailable Microsoft.NETCore.App.Ref 10.0.13 (NU1102). Co-authored-by: Copilot App <[email protected]>
|
@dalexsoto Resolved the newly reported conflicts in 6dda80c by merging current Validation on the merged revision: 362 focused standalone typemap/R8 tests passed, 7 skipped, 0 failed. All 12 modified XML files parse. Structural checks confirm 204 retained target contracts preserve ordering, dependencies, hooks, incremental inputs/outputs and non-selector guards; all 128 test methods and 180 explicit cases in the conflicted fixtures are preserved. Exact commands and results are updated in the PR description.
|
dalexsoto
left a comment
There was a problem hiding this comment.
The complete current 36-file source audit is clean. The trimmable-only retirement preserves non-selector target/import/cache/Clean contracts, the merged R8 policy and RunILLink=false fallback, retained runtime/device fixtures, and English/generated diagnostic parity.
Current merge blocker: immediately refreshed metadata for 6dda80c still reports mergeable=false, mergeable_state=dirty, and rebaseable=false against main. This is fresh evidence for the updated head, not a carry-forward of the old 88e2c4a conflict or a claim that your earlier resolution never worked. Please update from current main and resolve the current conflicts while preserving the retained tests and upstream contracts. No conflict filename or compiler error is inferred from these platform fields.
I also inspected both new current-source CI reds in build 1626120. MAUI's arm64 default work item failed during APK installation with insufficient storage/UID allocation, before app execution. The dedicated JcwGen negative-control test detected its intentionally retained references but failed its literal Delta=100 message assertion on Delta=99; that test and its net-counter measurement helper are unchanged from the authorized base. Neither observation establishes a new typemap-retirement-specific source blocker. The sole confirmed blocker in this review is current mergeability, not pending CI or an inferred JNI-leak regression.
Merge main and preserve the updated on-device JNI test locations and standalone tooling guidance without restoring AndroidTypeMapImplementation. No product or test implementation changes are required by the conflict resolution. Validation: 362 focused typemap/R8 tests passed, 7 skipped; all 12 modified XML files parse. Current-main testing guidance and all 81 non-overlapping upstream changes are preserved. make prepare remains blocked by unavailable Microsoft.NETCore.App.Ref 10.0.13 (NU1102), so full SDK/device validation is still outstanding. Co-authored-by: Copilot App <[email protected]>
|
@dalexsoto Addressed the latest mergeability blocker in 08d25be by merging current Revalidated the merged revision: 362 focused typemap/R8 tests passed, 7 skipped, 0 failed; all 12 modified XML files parse. The resolved guide matches current main except for the intended selector removal, and all 81 non-overlapping upstream changes match main exactly. No unrelated JNI leak measurement or MAUI installation behavior was changed. Retried |
dalexsoto
left a comment
There was a problem hiding this comment.
Reviewed the complete current 36-file change and its source/generated/runtime/test integration. The main resolution preserves the relocated on-device JNI paths and standalone tooling guidance without restoring the retired selector; all 81 non-overlapping upstream units and rename origins were independently verified. The non-selector target/cache/Clean contracts, actual R8 import/policies/RunILLink=false fallback, NativeAOT opt-in, runtime fixtures and English/generated diagnostics remain intact. The earlier merge-conflict blocker is cleared by fresh current-head metadata. No blocking issue remains. This review's additional validation was static source/condition analysis, not local product execution; pending checks and optional preparation/device gaps are not treated as findings.

The trimmable type map is the sole supported implementation after #12889 and #12890.
$(AndroidTypeMapImplementation)no longer selects between working implementations, but still adds conditions, defaults, validation, and redundant test parameters throughout the build.Remove the selector rather than preserving an extension point for a hypothetical future implementation:
java_runtime_trimmable.jar; retain application/library, runtime, trimming, design-time, and inner-RID guards.CoreCLRTrimmabletest flavor default.llvm-ir,trimmable, and unknown values.main.Compatibility: Existing assignments to
$(AndroidTypeMapImplementation)are now ignored, including previously rejectedllvm-ir, unknown, and explicitly empty global values. The documentation retains an obsolete-property notice so users can remove those assignments.No linked issue; this follows the legacy typemap removal PRs and the redundant test-lane removal in #13011.
Validation
After merging
mainat40160bdfb9and resolving the latest test-guide conflict in08d25beb13, expanded standalone coverage: 362 passed, 7 skipped, 0 failed. This includes the obsolete-property regression cases, transferred-reference activation tests, and upstream R8/NativeAOT object-extraction coverage. The skipped tests require locally built Android assemblies. NativeAOT target cases were exercised with the NDK tools.The earlier focused obsolete-property regression run passed all 5 cases; these cases also passed in the expanded run above:
git diff --cached --checkpassed. All 12 modified XML files parsed successfully. The latest conflict resolution preserves all current-main testing guidance, including the moved on-device JNI test locations, with only the obsolete selector removed. All 81 non-overlapping upstream changes matchmainexactly.Structural checks during the previous R8 conflict resolution in
6dda80c5ecconfirmed:Compileitems and fiveProjectReferenceitems are preserved; formerly selector-gated fixture entries remain unconditional.The latest merge makes no further product-target or typemap-test changes.
Full SDK validation is blocked: Retrying
make prepare && make allon this merged revision failed during preparation with NU1102 because the configured feeds cannot supplyMicrosoft.NETCore.App.Refversion10.0.13;make alldid not run. Earlier attempts usingmake prepare MSBUILD_ARGS=-p:DotNetPreviewTool=/usr/local/share/dotnet/dotnetanddotnet build src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests.csproj -v minimal -p:DotNetStableTargetFramework=net11.0failed for the same dependency. Full-build application/library regressions, device integration tests, and on-device runtime tests have therefore not run locally.Pull Request
title and
description
should follow the
commit-messages.mdworkflow documentation, and in particular should include: