Skip to content
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

Add Trimming Support #20

Merged
merged 4 commits into from
May 14, 2024
Merged

Add Trimming Support #20

merged 4 commits into from
May 14, 2024

Conversation

Qonfused
Copy link
Member

@Qonfused Qonfused commented May 14, 2024

Adds a custom ILLink pipeline for trimming reference assemblies embedded in the MTGOSDK assembly. We leverage the ILLink MSBuild task to add a post-build target that trims these assemblies before ILRepack runs. This reduces the assembly size from 14.14 MB to 3.88 MB (~72.6%), and the total package size from 2.85 MB to 1.38 MB (~51.6%).

As this library leverages type proxying with the ProxyType and DLRWrapper classes, most API type usage can properly be detected and trimmed by ILLink. Some internal usage of type unbindings w/ DLRWrapper will need to be handled in a custom preserve list. However, this is a relatively small task despite being a reflection-heavy library.

Trim types and members of embedded reference assemblies to only include used types.
Avoid internalizing assemblies so ImpromptuInterface can bind reference assembly types
@Qonfused Qonfused self-assigned this May 14, 2024
@Qonfused Qonfused marked this pull request as ready for review May 14, 2024 20:41
@Qonfused Qonfused merged commit f6d0372 into main May 14, 2024
1 check passed
@Qonfused Qonfused deleted the illink-trim branch May 14, 2024 20:51
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.

1 participant