Skip to content

Move MarshalMethodsAssemblyRewriter warning into resources - #12330

Merged
jonathanpeppers merged 4 commits into
mainfrom
copilot/fix-finder-move-warning-to-resources
Aug 11, 2026
Merged

jonathanpeppers merged 4 commits into
mainfrom
copilot/fix-finder-move-warning-to-resources

Conversation

Copilot AI commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

MarshalMethodsAssemblyRewriter emitted a hardcoded customer-facing warning when source-file deletion failed, preventing localization.

  • Resources
    • Add the unchanged warning text to the English Resources.resx.
    • Add the corresponding generated-style designer property.
  • Warning emission
    • Format the resource with the target architecture and file path.
    • Preserve plain LogWarning behavior and adjacent exception diagnostics.
log.LogWarning (string.Format (
    Properties.Resources.MarshalMethodsAssemblyRewriterUnableToDeleteSourceFile,
    targetArch,
    path));

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix finder move MarshalMethodsAssemblyRewriter warning into Resources.resx Move MarshalMethodsAssemblyRewriter warning into resources Aug 10, 2026
Copilot AI requested a review from jonathanpeppers August 10, 2026 02:51
@jonathanpeppers
jonathanpeppers marked this pull request as ready for review August 10, 2026 12:26
Copilot AI lite review requested due to automatic review settings August 10, 2026 12:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Moves a customer-facing MarshalMethodsAssemblyRewriter warning string into Properties.Resources so the message can be localized while preserving the existing non-coded LogWarning behavior.

Changes:

  • Replaces the hardcoded warning in MarshalMethodsAssemblyRewriter with a string.Format call using Properties.Resources.
  • Adds the warning text to the English Resources.resx.
  • Adds the corresponding strongly-typed resource accessor to Resources.Designer.cs.

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/Utilities/MarshalMethodsAssemblyRewriter.cs Switches warning emission to a localized resource-based format string.
src/Xamarin.Android.Build.Tasks/Properties/Resources.resx Adds MarshalMethodsAssemblyRewriterUnableToDeleteSourceFile with unchanged warning text.
src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs Adds the generated-style property for the new resource key.
Files not reviewed (1)
  • src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs: Generated file

πŸ’‘ Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
@jonathanpeppers

Copy link
Copy Markdown
Member

@copilot there is an error:

       (CoreCompile target) -> 
         /Users/cloudtest/vss/_work/1/s/android/src/Xamarin.Android.Build.Tasks/Utilities/MarshalMethodsAssemblyRewriter.cs(199,78): error CS8604: Possible null reference argument for parameter 'messageArgs' in 'void MSBuildExtensions.LogCodedWarning(TaskLoggingHelper log, string code, string message, params object[] messageArgs)'. [/Users/cloudtest/vss/_work/1/s/android/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Build.Tasks.csproj]

    136 Warning(s)
    1 Error(s)

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>

Copilot AI commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

@copilot there is an error:

       (CoreCompile target) -> 

...

Fixed in beae5a1. String.IsNullOrEmpty isn't NRT-annotated for netstandard2.0, so path stayed string? after the guard and flowed into the params object []. Switched the guard to the repo's path.IsNullOrEmpty () extension ([NotNullWhen (false)]), which narrows path to non-null.

@jonathanpeppers jonathanpeppers added ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). and removed ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). labels Aug 10, 2026
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Aug 11, 2026
@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) August 11, 2026 13:03
@jonathanpeppers

Copy link
Copy Markdown
Member

@dalexsoto review

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the current changes. The resource, designer property, and call-site wiring preserve the warning text, argument order, and warning severity. No blocking issues found.

@jonathanpeppers
jonathanpeppers merged commit a087b95 into main Aug 11, 2026
44 checks passed
@jonathanpeppers
jonathanpeppers deleted the copilot/fix-finder-move-warning-to-resources branch August 11, 2026 13:36
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix-finder] Move MarshalMethodsAssemblyRewriter warning into Resources.resx

4 participants