Skip to content

Move RemoveResourceDesignerStep out of ILLink process#11039

Open
sbomer wants to merge 2 commits intomainfrom
dev/sbomer/remove-resource-designer-v2
Open

Move RemoveResourceDesignerStep out of ILLink process#11039
sbomer wants to merge 2 commits intomainfrom
dev/sbomer/remove-resource-designer-v2

Conversation

@sbomer
Copy link
Copy Markdown
Member

@sbomer sbomer commented Mar 27, 2026

Migrate RemoveResourceDesignerStep out of the ILLink custom step pipeline and into PostTrimmingPipeline so it runs as an IAssemblyModifierPipelineStep after trimming. This follows the same pattern as FixLegacyResourceDesignerStep.

  • Add IAssemblyModifierPipelineStep to RemoveResourceDesignerStep
  • Add constructor accepting assemblies list and logging delegate
  • Remove GetAssembliesStep (no longer needed; assemblies passed directly)
  • Remove both _TrimmerCustomSteps entries from targets
  • Add AndroidLinkResources property to PostTrimmingPipeline task

Trying as an alternative to #10977.

…ngPipeline

Migrate RemoveResourceDesignerStep out of the ILLink custom step pipeline
and into PostTrimmingPipeline so it runs as an IAssemblyModifierPipelineStep
after trimming. This follows the same pattern as FixLegacyResourceDesignerStep.

- Add IAssemblyModifierPipelineStep to RemoveResourceDesignerStep
- Add constructor accepting assemblies list and logging delegate
- Remove GetAssembliesStep (no longer needed; assemblies passed directly)
- Remove both _TrimmerCustomSteps entries from targets
- Add AndroidLinkResources property to PostTrimmingPipeline task
@sbomer sbomer requested a review from jonathanpeppers as a code owner March 27, 2026 18:25
Copilot AI review requested due to automatic review settings March 27, 2026 18:25
@sbomer sbomer requested a review from simonrozsival as a code owner March 27, 2026 18:25
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

Moves RemoveResourceDesignerStep out of the ILLink custom step pipeline and into the PostTrimmingPipeline MSBuild task so it runs after trimming as an IAssemblyModifierPipelineStep, aligning with other post-trim steps.

Changes:

  • Add AndroidLinkResources support to PostTrimmingPipeline and run RemoveResourceDesignerStep when enabled.
  • Refactor RemoveResourceDesignerStep to implement IAssemblyModifierPipelineStep and accept an explicit assemblies list + logging delegate.
  • Remove the ILLink-side plumbing (GetAssembliesStep, ILLink csproj inclusion, and _TrimmerCustomSteps registrations in targets).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Xamarin.Android.Build.Tasks/Tasks/PostTrimmingPipeline.cs Adds AndroidLinkResources flag and invokes RemoveResourceDesignerStep post-trim.
src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.TypeMap.LlvmIr.targets Removes ILLink custom steps and wires AndroidLinkResources into PostTrimmingPipeline.
src/Xamarin.Android.Build.Tasks/Linker/MonoDroid.Tuner/RemoveResourceDesignerStep.cs Converts step to IAssemblyModifierPipelineStep and removes ILLink config dependency.
src/Microsoft.Android.Sdk.ILLink/Microsoft.Android.Sdk.ILLink.csproj Stops compiling/linking RemoveResourceDesignerStep into the ILLink project.
src/Microsoft.Android.Sdk.ILLink/GetAssembliesStep.cs Deletes unused ILLink step previously used to collect assemblies for the designer step.

…esolver calls

Load all assemblies into a shared list upfront so that RemoveResourceDesignerStep
and the per-assembly processing loop operate on the same AssemblyDefinition instances
instead of calling resolver.GetAssembly() twice for each assembly.
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.

2 participants