[TrimmableTypeMap] Add ComputeTypeMapDependencies pre-task for partial builds
- Dominant language
- C#
- Stars
- 2.1k
- Forks
- 579
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 252
Description
Part of #10958.
The proposed per-assembly MSBuild partial-build design needs a lightweight dependency pre-task that computes which assemblies can affect each typemap unit. This issue tracks implementing that pre-task independently, without changing typemap generation yet.
## Goal
Add a `ComputeTypeMapDependencies`-style MSBuild task that reads assembly metadata and produces per-assembly dependency metadata suitable for later `Inputs`/`Outputs` wiring.
## Proposed behavior
- Read each input assembly's `AssemblyRef` metadata using `System.Reflection.Metadata`/`PEReader`.
- Build the transitive assembly dependency graph for the resolved assembly set.
- Prune dependencies that cannot affect trimmable typemap generation, especially assemblies with no path to Java-peer-bearing assemblies such as `Mono.Android` or `Java.Interop`.
- Output items for each candidate typemap input assembly with metadata containing its relevant dependency closure.
## Current related code
- `src/Microsoft.Android.Sdk.TrimmableTypeMap/Scanner/AssemblyIndex.cs` already reads metadata and type references, but it builds a richer scan index than this pre-task should need.
- `src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.targets` currently passes all assemblies directly to `GenerateTrimmableTypeMap`.
## Acceptance criteria
- New task computes deterministic per-assembly dependency metadata from a set of resolved assemblies.
- Task is covered by unit tests using small fixture assemblies or existing test infrastructure.
- No behavior change to typemap generation yet; this is an enabling step for later partial-build wiring.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.