[xabt] Move trimmable typemap tasks to net11 - #12678
Open
simonrozsival wants to merge 8 commits into
Open
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>
Contributor
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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