Skip to content

Remove unused CilStrip MSBuild task and related references #10206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 16, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 16, 2025

The Xamarin.Android.Tasks.CilStrip MSBuild task was identified as vestigial code from Xamarin.Android that is no longer used anywhere in the build system. This PR removes all references to it.

Changes Made

  • Deleted CilStrip.cs: Removed the entire 122-line source file containing the unused MSBuild task
  • Removed UsingTask declaration: Cleaned up the task registration from Xamarin.Android.Common.targets
  • Removed XA3003 error code: Eliminated the "Could not strip IL of assembly" error message from all 14 localized resource files and Resources.Designer.cs
  • Updated documentation: Removed XA3003 reference from the error codes documentation

Additional Findings

During the analysis, 16 other MSBuild tasks were identified as having UsingTask declarations but not being used in any targets:

  • AndroidMessage
  • CalculateAdditionalResourceCacheDirectories
  • CheckForRemovedItems
  • CollectLibraryAssets
  • CollectNonEmptyDirectories
  • CollectPdbFiles
  • ComputeHash
  • ConvertResourcesCases
  • CreateAdditionalLibraryResourceCache
  • GetConvertedJavaLibraries
  • GetFilesThatExist
  • KeyTool
  • LogErrorsForFiles
  • MakeBundleNativeCodeExternal
  • ReadJavaStubsCache
  • ScanAssemblies

Note: XA3002 ("Invalid AOT mode") was preserved as it is actively used by Aot.cs and GetAotAssemblies.cs tasks.

Verification

  • Build tested successfully with ./build.sh --target=BuildMSBuildTasksOnly
  • No remaining references to CilStrip or XA3003 in source files
  • All changes are minimal and surgical - only removals, no modifications to working code

Fixes #10205.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Remove Xamarin.Android.Tasks.CilStrip Remove unused CilStrip MSBuild task and related references Jun 16, 2025
@Copilot Copilot AI requested a review from jonathanpeppers June 16, 2025 17:06
Copilot finished work on behalf of jonathanpeppers June 16, 2025 17:06
jonathanpeppers added a commit that referenced this pull request Jun 16, 2025
Context: #10206

@copilot found these in #10206, so I checked their usage one-by-one to
remove completely unused code.

Many of these look *very* old, like `<GetConvertedJavaLibraries/>` for
example, mentions an old Android tool named `jack`.

Removing the `<UsingTask>` declarations should also slightly improve
MSBuild evaluation time. From what I've seen profiling in the past,
MSBuild creates a full path string for each `AssemblyFile` entry.
…line

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot finished work on behalf of jonathanpeppers June 16, 2025 18:13
@jonathanpeppers jonathanpeppers marked this pull request as ready for review June 16, 2025 18:18
@jonathanpeppers jonathanpeppers enabled auto-merge (squash) June 16, 2025 18:20
jonathanpeppers added a commit that referenced this pull request Jun 16, 2025
Context: #10206

@copilot found these in #10206, so I checked their usage one-by-one to
remove completely unused code.

Many of these look *very* old, like `<GetConvertedJavaLibraries/>` for
example, mentions an old Android tool named `jack`.

Removing the `<UsingTask>` declarations should also slightly improve
MSBuild evaluation time. From what I've seen profiling in the past,
MSBuild creates a full path string for each `AssemblyFile` entry.
@jonathanpeppers jonathanpeppers merged commit e67527e into main Jun 16, 2025
59 checks passed
@jonathanpeppers jonathanpeppers deleted the copilot/fix-10205 branch June 16, 2025 23:55
@github-actions github-actions bot locked and limited conversation to collaborators Jul 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Xamarin.Android.Tasks.CilStrip
2 participants