Move hardcoded error strings in JCWGenerator.cs to Properties.Resources with XA error codes#11427
Move hardcoded error strings in JCWGenerator.cs to Properties.Resources with XA error codes#11427Copilot wants to merge 3 commits into
Conversation
…es with XA error codes Add XA4212, XA4217, XA4227 resource strings and replace LogError calls with LogCodedError in JCWGenerator.cs. Create documentation files for each new error code and update the error code index. Agent-Logs-Url: https://github.com/dotnet/android/sessions/4696467d-3a7f-4b52-a92d-5e884cb5bad1 Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates JCWGenerator error reporting to use localized Properties.Resources strings and LogCodedError calls with XA error codes, and adds corresponding documentation pages for the new/updated messages.
Changes:
- Replaced hardcoded
LogErrorstrings inUtilities/JCWGenerator.cswithLogCodedErrorand new resource entries (XA4212/XA4217/XA4227). - Added new XA resource strings to
Properties/Resources.resx(and updatedResources.Designer.cs). - Added message documentation pages (
xa4212.md,xa4217.md,xa4227.md) and updatedDocumentation/docs-mobile/messages/index.md.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Xamarin.Android.Build.Tasks/Utilities/JCWGenerator.cs | Switches several error logs to LogCodedError and consolidates one multi-line error into a single message. |
| src/Xamarin.Android.Build.Tasks/Properties/Resources.resx | Adds new XA resource strings used by JCWGenerator. |
| src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs | Regenerates resource accessors for the new XA entries. |
| Documentation/docs-mobile/messages/xa4212.md | Adds docs page for XA4212. |
| Documentation/docs-mobile/messages/xa4217.md | Adds docs page for XA4217. |
| Documentation/docs-mobile/messages/xa4227.md | Adds docs page for XA4227. |
| Documentation/docs-mobile/messages/index.md | Adds entries linking to the new XA docs pages. |
Files not reviewed (1)
- src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs: Language not supported
|
@copilot address the code review comments where they are relevant and explain what you did in detail. |
- Rename XA4212 to XA4253 to avoid conflicting with existing XA4212 in XAJavaTypeScanner.cs (IJavaObject without Java.Lang.Object). - Sort type names with StringComparer.Ordinal before joining for deterministic error messages across runs. - Fix double spaces after periods in xa4253.md, xa4217.md, xa4227.md to match single-space convention used in other doc files. Agent-Logs-Url: https://github.com/dotnet/android/sessions/38e8cd39-9d56-407f-81ca-76b35be25ccd Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Addressed all relevant review comments in edc6d32:
|
Four
LogErrorcalls inJCWGenerator.csused hardcoded interpolated strings instead of localized resource strings withXA####codes. This replaces them withLogCodedErrorusing new resource entries.New error codes
Changes
Properties/Resources.resx/Resources.Designer.cs— Added XA4253, XA4217, XA4227 resource stringsUtilities/JCWGenerator.cs— ReplacedLogError→LogCodedErrorat all four call sites; collapsed the type-list loop into a single sorted,string.Join'd messageDocumentation/docs-mobile/messages/— Addedxa4253.md,xa4217.md,xa4227.md; updatedindex.md