Repository navigation
[Microsoft.Android.Build.Tasks] Enable MT for package names - #13282
Merged
jonathanpeppers merged 1 commit intoOct 27, 2026
Merged
Conversation
Run <GetAndroidPackageName/> in the MSBuild process during -mt builds instead of sending its calls to a separate task process. Use the multithreaded base and declare the task attribute directly. Resolve manifest reads through TaskEnvironment without changing public inputs or package selection. Add focused path and project-isolation tests while keeping the existing Java identifier checks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the change enabling in-process, multithreaded package-name resolution.
No open issues 🎉
What changed in this PR
Enables GetAndroidPackageName to run in-process during multithreaded MSBuild builds while preserving its public inputs and package-selection behavior.
Changes:
- Uses
MultithreadedAndroidTaskand declares[MSBuildMultiThreadableTask]. - Resolves manifest paths through
TaskEnvironmentbefore file access. - Adds four manifest-path cases and a two-project isolation test, retaining existing Java identifier tests.
| File | Description |
|---|---|
| src/Microsoft.Android.Build.Tasks/Tests/Microsoft.Android.Build.Tasks.Tests/GetAndroidPackageNameTests.cs | Adds path-resolution, input-preservation, and concurrent project-isolation coverage. |
| src/Microsoft.Android.Build.Tasks/Tasks/GetAndroidPackageName.cs | Enables multithreaded execution and project-relative manifest resolution. |
Review effort: Balanced
Member
Author
|
@dalexsoto review |
jonathanpeppers
enabled auto-merge (squash)
October 27, 2026 19:42
dalexsoto
approved these changes
Oct 27, 2026
dalexsoto
left a comment
Member
There was a problem hiding this comment.
Reviewed the complete 2-file task/test change and the relevant task base, MSBuild environment/routing, production consumers and source tests. GetAndroidPackageName uses the per-project TaskEnvironment while preserving package-selection and diagnostic contracts. No high-confidence blockers remain in the bounded static review.
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.
Allow
<GetAndroidPackageName/>to run in the MSBuild process during-mtbuilds instead of using a separate task process.Use
Microsoft.Android.Build.Tasks.MultithreadedAndroidTaskand declare[MSBuildMultiThreadableTask]directly. Resolve manifest paths throughTaskEnvironmentbefore file access, without changing the public input or package selection. Add four path cases and one two-project isolation test; retain the existing Java identifier tests.Local validation
Validation used SDK
11.0.100-rc.2.26504.105, MSBuild 18.12, and the matching .NET 11 runtime, reference pack, ILLink, and MonoTargets. Local-only version overrides and a workload-manifest compatibility change were needed for current main; neither is included in this PR.dotnet-local.cmd build Microsoft.Android.slnx -t:BuildDotNet -c Release -nr:false -v:minimalafter VS environment setup: passed, 92 existing warnings and zero errors.dotnet-local.cmd test src\Microsoft.Android.Build.Tasks\Tests\Microsoft.Android.Build.Tasks.Tests\Microsoft.Android.Build.Tasks.Tests.csproj -c Release --filter FullyQualifiedName~GetAndroidPackageNameTests -p:MicrosoftNETCoreAppRefPackageVersion=11.0.0-rc.2.26504.105 -p:MicrosoftNETILLinkPackageVersion=11.0.0-rc.2.26504.105 -nr:false -v:minimal: passed 9/9.-m -mt -nr:false -warnaserror:MSB4286,MSB4287,MSB4288fixtures and real Android app builds: passed with matching outputs. Binlogs confirm two successful package-task calls in the app, zero TaskHost calls, and zero task messages. The APK CoreCLR and app CoreLib hashes match the .NET 11 runtime pack.No linked issue.
Pull Request
title and
description
should follow the
commit-messages.mdworkflow documentation, and in particular should include: