Move hardcoded error strings in GenerateJniRemappingNativeCode to Properties.Resources with XA error codes#11366
Open
Copilot wants to merge 4 commits into
Open
Move hardcoded error strings in GenerateJniRemappingNativeCode to Properties.Resources with XA error codes#11366Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
6 tasks
…perties.Resources with XA1045-XA1047 error codes Agent-Logs-Url: https://github.com/dotnet/android/sessions/895d450d-8ee0-42ba-a920-784ef258ec94 Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix hardcoded error strings in GenerateJniRemappingNativeCode
Move hardcoded error strings in GenerateJniRemappingNativeCode to Properties.Resources with XA error codes
May 14, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns GenerateJniRemappingNativeCode with the repo’s build-error conventions by replacing three hardcoded Log.LogError messages with localized Properties.Resources entries and corresponding XA#### error codes.
Changes:
- Added new localized error message resources
XA1045–XA1047toResources.resx(with format placeholders and comments). - Updated
Resources.Designer.cswith the generated accessors for the new resource keys. - Replaced the three
Log.LogErrorcall sites withLog.LogCodedErrorusingXA1045–XA1047.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Tasks/Tasks/GenerateJniRemappingNativeCode.cs | Switches three uncoded errors to coded, localized Log.LogCodedError calls. |
| src/Xamarin.Android.Build.Tasks/Properties/Resources.resx | Adds XA1045–XA1047 localized messages with placeholders and argument documentation. |
| src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs | Includes the generated resource properties for the new XA1045–XA1047 keys. |
Files not reviewed (1)
- src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs: Language not supported
Member
|
@copilot there are markdown files for each error code, and a table of contents. Can you update these for the new error codes? |
…date index.md TOC Agent-Logs-Url: https://github.com/dotnet/android/sessions/19a56121-fdbe-45d4-84be-ea0f62355b6b Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Contributor
Author
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.
Three
Log.LogErrorcalls inGenerateJniRemappingNativeCode.csused hardcoded interpolated strings with noXA####error codes, violating repo convention for localizable, coded build errors.Changes
Properties/Resources.resx: AddedXA1045,XA1046,XA1047with format-string placeholders and<comment>descriptionsProperties/Resources.Designer.cs: Added corresponding generated propertiesGenerateJniRemappingNativeCode.cs: ReplacedLog.LogError→Log.LogCodedErrorat all three call sitesDocumentation/docs-mobile/messages/xa1045.md,xa1046.md,xa1047.md: Added markdown documentation files for the new error codesDocumentation/docs-mobile/messages/index.md: AddedXA1044–XA1047entries to the table of contentsError codes assigned:
XA1045(invalid root element),XA1046(unparseable boolean attribute),XA1047(missing required attribute). These follow sequentially after the existingXA1044.