Skip to content

[XABT] Remove RunCheckedBuild / _AndroidJLOCheckedBuild infrastructure#11228

Merged
simonrozsival merged 1 commit intomainfrom
jonathanpeppers/skip-redundant-typemap-xml
Apr 29, 2026
Merged

[XABT] Remove RunCheckedBuild / _AndroidJLOCheckedBuild infrastructure#11228
simonrozsival merged 1 commit intomainfrom
jonathanpeppers/skip-redundant-typemap-xml

Conversation

@jonathanpeppers
Copy link
Copy Markdown
Member

@jonathanpeppers jonathanpeppers commented Apr 27, 2026

Summary

The RunCheckedBuild flag (set via _AndroidJLOCheckedBuild MSBuild property) was temporary validation infrastructure introduced to verify that linker-based JLO scanning produced the same results as the old process. The property is never defined or set to true anywhere in the codebase — no .props, no .targets, no tests — making all code gated behind it unreachable dead code.

This PR removes the entire RunCheckedBuild infrastructure across 8 files (290 lines deleted).

Changes

  • GenerateJavaStubs.cs — Removed redundant JCW generation, CompareScannedAssemblies(), CompareLists(), scannedAssemblies tracking, and GeneratedJavaFiles property
  • GenerateTypeMappings.cs — Simplified condition from RunCheckedBuild || useMarshalMethods to just useMarshalMethods, eliminating the redundant dual XML + NativeState type map generation path
  • TypeMapGenerator.cs — Removed RunCheckedBuild property and comparison logic in GenerateNativeAssembly()
  • GenerateACWMap.cs — Removed the checked build code path and unused IntermediateOutputDirectory property
  • ACWMapGenerator.cs — Removed the Generate(NativeCodeGenState, string) overload (only used by checked build)
  • XAJavaTypeScanner.cs — Removed scannedAssemblies parameter from GetJavaTypes() (only populated for checked build comparison)
  • MarshalMethodsCollection.cs — Updated GetJavaTypes() call site
  • Microsoft.Android.Sdk.TypeMap.LlvmIr.targets — Removed RunCheckedBuild attributes, GeneratedJavaFiles attribute, and duplicate GenerateACWMap invocation

The RunCheckedBuild flag was temporary validation infrastructure
introduced to verify that linker-based JLO scanning produced the
same results as the old process. The flag was never set to true
(no definitions of _AndroidJLOCheckedBuild exist anywhere), making
all code gated behind it dead code.

Removes:
- RunCheckedBuild property from GenerateJavaStubs, GenerateTypeMappings,
  GenerateACWMap, and TypeMapGenerator
- CompareScannedAssemblies/CompareLists validation methods
- Redundant JCW generation in GenerateJavaStubs
- NativeCodeGenState-based overload in ACWMapGenerator
- Duplicate GenerateACWMap invocation in targets file
- scannedAssemblies parameter from XAJavaTypeScanner.GetJavaTypes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jonathanpeppers jonathanpeppers marked this pull request as ready for review April 28, 2026 13:26
Copilot AI review requested due to automatic review settings April 28, 2026 13:26
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

Removes the unused RunCheckedBuild / _AndroidJLOCheckedBuild validation infrastructure from Xamarin.Android.Build.Tasks, eliminating unreachable comparison/duplicate-generation code paths and simplifying task/target wiring.

Changes:

  • Removed RunCheckedBuild-gated code paths and associated plumbing across tasks/utilities.
  • Simplified typemap generation decisions to align with actual marshal-methods usage.
  • Cleaned up MSBuild target invocations and task parameters related to the removed infrastructure.

Reviewed changes

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

Show a summary per file
File Description
src/Xamarin.Android.Build.Tasks/Utilities/XAJavaTypeScanner.cs Simplifies GetJavaTypes API by removing the checked-build-only scannedAssemblies tracking.
src/Xamarin.Android.Build.Tasks/Utilities/TypeMapGenerator.cs Removes checked-build output comparison/duplicate output behavior; always writes the generated typemap output.
src/Xamarin.Android.Build.Tasks/Utilities/MarshalMethodsCollection.cs Updates call site for the new XAJavaTypeScanner.GetJavaTypes signature.
src/Xamarin.Android.Build.Tasks/Utilities/ACWMapGenerator.cs Removes the checked-build-only Generate(NativeCodeGenState, ...) overload, keeping the JLO-driven path.
src/Xamarin.Android.Build.Tasks/Tasks/GenerateTypeMappings.cs Drops RunCheckedBuild property and simplifies conditions/logging around native-state typemap generation.
src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs Removes checked-build-only JCW generation/comparison plumbing and updates scanner call site.
src/Xamarin.Android.Build.Tasks/Tasks/GenerateACWMap.cs Removes checked-build path and unused task properties; always generates from .jlo.xml ACW map entries.
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.LlvmIr.targets Removes checked-build parameters/duplicate task invocation; aligns MSBuild task parameters with updated task APIs.

@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Apr 28, 2026
@simonrozsival simonrozsival merged commit b9eb2de into main Apr 29, 2026
7 checks passed
@simonrozsival simonrozsival deleted the jonathanpeppers/skip-redundant-typemap-xml branch April 29, 2026 08:53
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.

3 participants