Skip to content

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

@github-actions

Description

@github-actions

Problem

MergeRemapXml.cs has three Log.LogWarning() calls with hardcoded interpolated strings instead of using coded warnings from Properties.Resources. This makes the warnings harder to discover in documentation and inconsistent with the rest of the build tasks.

Location

  • File: src/Xamarin.Android.Build.Tasks/Tasks/MergeRemapXml.cs
  • Lines: 56, 68, 79

Current Code

// Line 56
Log.LogWarning ($"Specified input file `{file}` does not exist.  Ignoring.");

// Line 68
Log.LogWarning ($"Input file `{file}` does not start with `<replacements/>`.  Skipping.");

// Line 79
Log.LogWarning ($"Input file `{file}` could not be read: {e.Message}  Skipping.");

Suggested Fix

  1. Add three new warning codes to src/Xamarin.Android.Build.Tasks/Properties/Resources.resx (and Resources.Designer.cs). Use codes XA4316, XA4317, and XA4318 (next available in the XA43xx range):

    • 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.
  2. Replace the three Log.LogWarning(...) calls with Log.LogCodedWarning("XA4316", ...) etc., using the resource strings.

  3. Create documentation files for each new code:

    • Documentation/docs-mobile/messages/xa4316.md
    • Documentation/docs-mobile/messages/xa4317.md
    • Documentation/docs-mobile/messages/xa4318.md

    Follow the existing format (see xa4315.md for reference): frontmatter with title, description, ms.date, f1_keywords, then sections for Example messages, Issue explanation, and Solution.

  4. Add the new codes to the table of contents in Documentation/docs-mobile/messages/index.md.

Guidelines

  • Use Log.LogCodedWarning ("XA4316", Properties.Resources.XA4316, file) pattern
  • Only modify the English Resources.resx — never modify *.lcl or non-English *.resx files
  • Follow Mono code style (tabs, space before parentheses)
  • Check xa4315.md for documentation format reference

Acceptance Criteria

  • All three Log.LogWarning calls in MergeRemapXml.cs are replaced with Log.LogCodedWarning using resource strings
  • Three new entries added to Resources.resx (XA4316, XA4317, XA4318)
  • Three new documentation files created under Documentation/docs-mobile/messages/
  • New codes added to Documentation/docs-mobile/messages/index.md
  • All tests pass
  • No new warnings introduced

Generated by Nightly Fix Finder · ● 10.1M ·

  • expires on May 29, 2026, 2:30 AM UTC

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions