Skip to content

[TrimmableTypeMap] Reconcile ACW map generation with per-assembly incrementality #11495

@simonrozsival

Description

@simonrozsival

Part of #10958.

Earlier notes on #10958 mention per-assembly acw-map.{AssemblyName}.txt files and an _MergeAcwMaps target, but current main appears to write a single merged acw-map.txt from GenerateTrimmableTypeMap. This issue tracks reconciling ACW map generation with the current and planned incremental typemap design.

Current locations

  • src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/AcwMapWriter.cs
    • Writes ACW map entries from all peers passed to it.
  • src/Xamarin.Android.Build.Tasks/Tasks/GenerateTrimmableTypeMap.cs
    • Writes one merged AcwMapOutputFile using all peers.
  • src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.targets
    • Passes AcwMapOutputFile="$(IntermediateOutputPath)acw-map.txt" and records it in FileWrites.

Questions to resolve

  • Do we still want per-assembly ACW map side outputs for Debug partial builds?
  • If yes, should each typemap unit write acw-map.{AssemblyName}.txt and should a separate _MergeAcwMaps target produce acw-map.txt?
  • If no, update the parent issue notes to reflect that current main intentionally keeps a single merged map.

Suggested implementation if per-assembly maps are kept

  • Emit one ACW map file per typemap unit.
  • Merge per-assembly maps with MSBuild Inputs/Outputs so the merge target skips when no input map changed.
  • Preserve first-entry-wins behavior expected by downstream ACW map consumers.

Acceptance criteria

  • ACW map generation has a clear incremental story compatible with the planned per-assembly typemap split.
  • Current consumers still receive $(IntermediateOutputPath)acw-map.txt.
  • Tests cover unchanged map inputs not touching the merged output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    copilot`copilot-cli` or other AIs were used to author thistrimmable-type-map

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions