Move hardcoded error strings in RemoveRegisterAttribute and GenerateCompressedAssembliesNativeSourceFiles to Properties.Resources#11470
Merged
Conversation
7 tasks
…XA2025 codes Agent-Logs-Url: https://github.com/dotnet/android/sessions/e77e9808-9097-433d-bd71-ba569aa3f6eb Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix hardcoded error strings in MSBuild tasks
Move hardcoded error strings in RemoveRegisterAttribute and GenerateCompressedAssembliesNativeSourceFiles to Properties.Resources
May 24, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR localizes previously hardcoded MSBuild task error strings by introducing new XA error codes and moving the message text into Properties.Resources, aligning these tasks with the rest of Xamarin.Android.Build.Tasks error-reporting patterns.
Changes:
- Added new localized resource strings and error codes
XA2024/XA2025. - Updated
RemoveRegisterAttributeandGenerateCompressedAssembliesNativeSourceFilestasks to useLog.LogCodedErrorwithProperties.Resources. - Added documentation pages for
XA2024/XA2025and linked them from the messages index.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Tasks/Tasks/RemoveRegisterAttribute.cs | Switches assembly-load failure logging to Log.LogCodedError with XA2024. |
| src/Xamarin.Android.Build.Tasks/Tasks/GenerateCompressedAssembliesNativeSourceFiles.cs | Switches missing-assembly logging to Log.LogCodedError with XA2025. |
| src/Xamarin.Android.Build.Tasks/Properties/Resources.resx | Adds localized strings for XA2024 and XA2025. |
| src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs | Adds strongly-typed accessors for XA2024 / XA2025. |
| Documentation/docs-mobile/messages/xa2024.md | Adds documentation for XA2024. |
| Documentation/docs-mobile/messages/xa2025.md | Adds documentation for XA2025. |
| Documentation/docs-mobile/messages/index.md | Adds links/entries for XA2024 and XA2025. |
Files not reviewed (1)
- src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs: Language not supported
simonrozsival
approved these changes
May 27, 2026
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.
Two MSBuild tasks used
Log.LogErrorwith hardcoded, non-localized strings and no XA error codes. This replaces them withLog.LogCodedErrorusingProperties.Resourcesentries.Changes
Resources.resxandResources.Designer.csRemoveRegisterAttribute.csandGenerateCompressedAssembliesNativeSourceFiles.cs— replacedLog.LogErrorwithLog.LogCodedErrorxa2024.md,xa2025.md, and updatedindex.md