Repository navigation
[TrimmableTypeMap] Implement pre-trimming build task #10789
Copy link
Copy link
Closed
Task
5 / 55 of 5 issues completed
Copy link
Labels
Area: CoreCLRIssues that only occur when using CoreCLR.Issues that only occur when using CoreCLR.Area: NativeAOTIssues that only occur when using NativeAOT.Issues that only occur when using NativeAOT.needs-triageIssues that need to be assigned.Issues that need to be assigned.trimmable-type-map
Milestone
Description
Activity
- addedArea: NativeAOTIssues that only occur when using NativeAOT.Issues that only occur when using NativeAOT.
on Feb 10, 2026 - addedArea: CoreCLRIssues that only occur when using CoreCLR.Issues that only occur when using CoreCLR.
on Feb 10, 2026 - addedneeds-triageIssues that need to be assigned.Issues that need to be assigned.
on Feb 10, 2026 Follow-up:
_GenerateJavaStubsmega-target decompositionFiled #10807 to track decomposing the legacy
_GenerateJavaStubsmega-target. Key finding from the scanner work:The trimmable path (#10779) overrides
_GenerateJavaStubsto a no-op, which inadvertently skips shared tasks that are NOT typemap-specific:GenerateMainAndroidManifest— every Android app needs a merged manifestGenerateAdditionalProviderSources— runtime provider .java filesGenerateACWMap→acw-map.txt— consumed by_ConvertCustomViewfor layout XML fixup
These need to be extracted from the LLVM IR mega-target so both legacy and trimmable paths can use them. The scanner (
JavaPeerScanner) already computes CRC64 JNI names, so generatingacw-map.txtfromJavaPeerInfois trivial — no need to reuse the Cecil-based task.See #10807 for the full analysis, proposed targets structure, and definition of done.
- locked and limited conversation to collaborators
on May 14, 2026
Metadata
Metadata
Assignees
Labels
Area: CoreCLRIssues that only occur when using CoreCLR.Issues that only occur when using CoreCLR.Area: NativeAOTIssues that only occur when using NativeAOT.Issues that only occur when using NativeAOT.needs-triageIssues that need to be assigned.Issues that need to be assigned.trimmable-type-map
Part of #10788
Details outlined in #10757
Implementation Plan
Implement a build-time code generation step that runs before the trimmer and produces:
Uses System.Reflection.Metadata (SRM) for both reading and emitting — no Mono.Cecil.
Key design decisions
Architecture: Separate task assembly
New project `src/Microsoft.Android.Build.TypeMap/` (`netstandard2.0`) keeps the scanner, generators, and MSBuild task in a dedicated assembly separate from `Xamarin.Android.Build.Tasks`. This enables a fast inner dev loop (~5s build+test) without building the full solution.
Incremental builds: Per-assembly typemap generation
Typical incremental build cost: <0.5s (only re-scan the app assembly + regenerate root).
Testing strategy
References