[xabt] Move trimmable typemap tasks to net11 - #12678
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It changes shipped MSBuild task loading/target wiring and retargets generator infrastructure, which warrants careful human validation of build/packaging behavior across MSBuild runtimes.
Review tier: Lite
Findings: None
What changed in this PR
This PR restructures the trimmable typemap pipeline by moving the MSBuild task entrypoints into the Microsoft.Android.Build.Tasks net11 assembly, retargeting the generator/tests to .NET 11, and updating the SDK targets to load the new tasks appropriately under both Full Framework and Core MSBuild.
Changes:
- Rewired
Microsoft.Android.Sdk.TypeMap.Trimmable*.targetsto loadMicrosoft.Android.Tasks.GenerateTrimmableTypeMap/GenerateMissingTypeMapStubsfromMicrosoft.Android.Build.Tasks.dll. - Retargeted
Microsoft.Android.Sdk.TrimmableTypeMap(and its unit tests) to$(DotNetTargetFramework)and adjusted code for .NET 11 runtime behavior. - Added a dedicated
Microsoft.Android.Build.Tasks.Testsproject and migrated relevant task tests, while keeping unrelated NativeAOT ProGuard tests in the existing suite.
| File | Description |
|---|---|
| Xamarin.Android.slnx | Adds the new Microsoft.Android.Build.Tasks.Tests project to the main solution test folder. |
| Xamarin.Android.Build.Tasks.slnx | Adds the new Microsoft.Android.Build.Tasks.Tests project to the build-tasks solution. |
| tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests.csproj | Retargets unit tests to $(DotNetTargetFramework) for the net11 transition. |
| src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj | Adds explicit System.Reflection.Metadata package reference and removes the trimmable typemap project reference. |
| src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Tasks/GenerateNativeAotProguardConfigurationTests.cs | Introduces a dedicated test file for NativeAOT ProGuard configuration behavior after test relocation. |
| src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.targets | Updates <UsingTask> to load GenerateTrimmableTypeMap from Microsoft.Android.Build.Tasks. |
| src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.Trimmable.CoreCLR.targets | Updates <UsingTask> to load GenerateMissingTypeMapStubs from Microsoft.Android.Build.Tasks. |
| src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.targets | Adds _MicrosoftAndroidBuildTasksAssembly path for the new task assembly. |
| src/Microsoft.Android.Sdk.TrimmableTypeMap/Scanner/ScannerHashingHelper.cs | Adjusts CRC64 hashing implementation to use compatible APIs in the presence of MSBuild’s asset loading behavior. |
| src/Microsoft.Android.Sdk.TrimmableTypeMap/Scanner/JavaPeerScanner.cs | Tightens forwarded-type resolution with an explicit null-aware lookup. |
| src/Microsoft.Android.Sdk.TrimmableTypeMap/Scanner/JavaAnnotationParser.cs | Tightens dictionary lookup/null handling around resolved indices. |
| src/Microsoft.Android.Sdk.TrimmableTypeMap/README.md | Updates documentation paths and notes net11 generator/task location. |
| src/Microsoft.Android.Sdk.TrimmableTypeMap/Microsoft.Android.Sdk.TrimmableTypeMap.csproj | Retargets generator library to $(DotNetTargetFramework) and removes now-unneeded references for net11. |
| src/Microsoft.Android.Build.Tasks/Tests/Microsoft.Android.Build.Tasks.Tests/Microsoft.Android.Build.Tasks.Tests.csproj | Adds a new net11 test project for Microsoft.Android.Build.Tasks. |
| src/Microsoft.Android.Build.Tasks/Tests/Microsoft.Android.Build.Tasks.Tests/GenerateTrimmableTypeMapTests.cs | Updates tests to use the moved task type and adjusts Mono.Android discovery logic. |
| src/Microsoft.Android.Build.Tasks/Tests/Microsoft.Android.Build.Tasks.Tests/GenerateMissingTypeMapStubsTests.cs | Updates tests to reference Microsoft.Android.Tasks task types. |
| src/Microsoft.Android.Build.Tasks/Tests/Microsoft.Android.Build.Tasks.Tests/BaseTest.cs | Adds a lightweight base test helper for the new task test project. |
| src/Microsoft.Android.Build.Tasks/Tasks/GenerateTrimmableTypeMap.cs | Moves task entrypoint into Microsoft.Android.Tasks and adjusts helper implementations. |
| src/Microsoft.Android.Build.Tasks/Tasks/GenerateMissingTypeMapStubs.cs | Moves task entrypoint namespace to Microsoft.Android.Tasks. |
| src/Microsoft.Android.Build.Tasks/Microsoft.Android.Build.Tasks.csproj | Adds direct references needed for moved tasks and links shared utilities/resources. |
| .github/skills/tests/SKILL.md | Updates the tests skill guidance to include the new standalone task tests. |
| .github/skills/tests/references/test-catalog.md | Adds the new Microsoft.Android.Build.Tasks.Tests project to the test catalog. |
Suppressed comments (1)
src/Microsoft.Android.Build.Tasks/Tasks/GenerateTrimmableTypeMap.cs:389
⚠️ warning Error handling —LoadCustomViewTypeNames()assumes every line contains a;separator and will throwIndexOutOfRangeExceptionon blank/malformed lines (e.g., an empty trailing line or manual edits), failing the task. Consider parsing defensively and only collecting the keys since the values aren’t used.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
/review |
|
✅ Android PR Reviewer completed successfully!
|
There was a problem hiding this comment.
✅ LGTM
No correctness or safety issues found. 0 errors · 0 warnings · 1 suggestion. The task migration keeps modern dependencies isolated under tools/net, updates both Core and full-framework registrations consistently, preserves localized resources, and adds focused task/resource coverage. All 44 CI checks passed.
The inline suggestion is non-blocking and asks for explicit coverage of the full-framework TaskHostFactory execution path.
Generated by Android PR Reviewer for #12678 · gpt56 · 328.4 AIC · ⌖ 20.6 AIC · ⊞ 25.7K
Comment /review to run again
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Summary
GenerateTrimmableTypeMapandGenerateMissingTypeMapStubsinto the net11.0Microsoft.Android.Build.Tasksassemblytools/net/, avoiding conflicts with netstandard2.0 dependencies in the shared tools directorySystem.Reflection.Metadatausage explicitPerformance improvements remain intentionally out of scope; existing stack-based hashing continues to use
System.IO.Hashing.Crc64directly.Validation
make prepare && make allBuild_WithTrimmableTypeMap_Succeedscases