Skip to content

Move hardcoded warning strings in MergeRemapXml to Properties.Resources with XA codes#11446

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-warning-strings-in-metadata
Open

Move hardcoded warning strings in MergeRemapXml to Properties.Resources with XA codes#11446
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-warning-strings-in-metadata

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 22, 2026

Three Log.LogWarning() calls in MergeRemapXml.cs used hardcoded interpolated strings instead of coded warnings from Properties.Resources, making them inconsistent with the rest of the build tasks and harder to discover in documentation.

Changes

  • MergeRemapXml.cs — Replace Log.LogWarning with Log.LogCodedWarning using resource strings:
    // Before
    Log.LogWarning ($"Specified input file `{file}` does not exist.  Ignoring.");
    // After
    Log.LogCodedWarning ("XA4316", Properties.Resources.XA4316, file);
  • Resources.resx / Resources.Designer.cs — Add XA4316, XA4317, XA4318 entries
  • Documentation/docs-mobile/messages/ — Add xa4316.md, xa4317.md, xa4318.md
  • index.md — Add new codes to the warning table of contents

New warning codes

Code Message
XA4316 Specified input file '{0}' does not exist. Ignoring.
XA4317 Input file '{0}' does not start with '<replacements/>'. Skipping.
XA4318 Input file '{0}' could not be read: {1}. Skipping.

…g using XA4316-XA4318 resource strings

Agent-Logs-Url: https://github.com/dotnet/android/sessions/7e03d751-10ad-43ae-aaf3-4eed96128ac4

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix hardcoded warning strings in MergeRemapXml Move hardcoded warning strings in MergeRemapXml to Properties.Resources with XA codes May 22, 2026
Copilot AI requested a review from jonathanpeppers May 22, 2026 02:54
@jonathanpeppers jonathanpeppers marked this pull request as ready for review May 22, 2026 15:27
Copilot AI review requested due to automatic review settings May 22, 2026 15:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes MergeRemapXml warnings by converting previously hardcoded Log.LogWarning() messages into coded warnings backed by Properties.Resources entries (XA4316–XA4318), and documents the new warning codes in the docs message catalog.

Changes:

  • Replaced three hardcoded warning strings in MergeRemapXml.cs with Log.LogCodedWarning() calls using new XA4316–XA4318 resource strings.
  • Added XA4316–XA4318 to Resources.resx (and updated the generated Resources.Designer.cs).
  • Added new warning documentation pages and linked them from the messages index.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Xamarin.Android.Build.Tasks/Tasks/MergeRemapXml.cs Switch warning logging to XA-coded warnings backed by localized resources.
src/Xamarin.Android.Build.Tasks/Properties/Resources.resx Add XA4316–XA4318 warning strings and parameter comments.
src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs Generated accessors for the new XA4316–XA4318 resource strings.
Documentation/docs-mobile/messages/xa4316.md New documentation page for warning XA4316.
Documentation/docs-mobile/messages/xa4317.md New documentation page for warning XA4317.
Documentation/docs-mobile/messages/xa4318.md New documentation page for warning XA4318.
Documentation/docs-mobile/messages/index.md Add XA4316–XA4318 to the messages index.
Files not reviewed (1)
  • src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs: Language not supported

@@ -836,6 +836,22 @@ Remove the '{0}' reference from your project and add the '{1}' NuGet package ins
<data name="XA4315" xml:space="preserve">
<value>Ignoring `{0}`. Manifest does not have the required 'package' attribute on the manifest element.</value>
<comment>{0} - The path the the file.
+ [XA4314](xa4314.md): `$(Property)` is empty. A value for `$(Property)` should be provided.
+ [XA4315](xa4315.md): Ignoring {file}. Manifest does not have the required 'package' attribute on the manifest element.
+ [XA4316](xa4316.md): Specified input file '{file}' does not exist. Ignoring.
+ [XA4317](xa4317.md): Input file '{file}' does not start with '\<replacements/\>'. Skipping.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix-finder] Move hardcoded warning strings in MergeRemapXml to Properties.Resources with XA codes

3 participants