-
Notifications
You must be signed in to change notification settings - Fork 526
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
[Xamarin.Android.Build.Tasks] implement $(AndroidStripILAfterAOT) #8172
Changes from 9 commits
815e374
2d8bfff
d0db340
f747395
19b2ab9
6152320
0feee89
747aabc
0902fea
6ac4b46
647c8b9
b5dc596
e4db7b8
40475e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,11 +123,25 @@ They run in a context of an inner build with a single $(RuntimeIdentifier). | |
LLVMPath="$(_LLVMPath)" | ||
LdName="$(_LdName)" | ||
LdFlags="$(_LdFlags)" | ||
CollectTrimmingEligibleMethods="$(AndroidStripIL)" | ||
TrimmingEligibleMethodsOutputDirectory="$(IntermediateOutputPath)tokens" | ||
WorkingDirectory="$(MSBuildProjectDirectory)" | ||
AotArguments="$(AndroidAotAdditionalArguments)"> | ||
<Output TaskParameter="CompiledAssemblies" ItemName="_MonoAOTCompiledAssemblies" /> | ||
<Output TaskParameter="FileWrites" ItemName="FileWrites" /> | ||
</MonoAOTCompiler> | ||
<ILStrip | ||
Condition=" '$(AndroidStripIL)' == 'true' " | ||
TrimIndividualMethods="true" | ||
Assemblies="@(_MonoAOTCompiledAssemblies)" | ||
DisableParallelStripping="$(_DisableParallelAot)"> | ||
<Output TaskParameter="TrimmedAssemblies" ItemName="_ILStripTrimmedAssemblies" /> | ||
</ILStrip> | ||
<Move | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This Does this make sense to anyone? Why was There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The goal of Here for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fanyang-mono: how does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The output |
||
Condition=" '$(AndroidStripIL)' == 'true' " | ||
SourceFiles="@(_ILStripTrimmedAssemblies->'%(TrimmedAssemblyFileName)')" | ||
DestinationFiles="@(_ILStripTrimmedAssemblies)" | ||
/> | ||
<WriteLinesToFile | ||
File="$(_AndroidStampDirectory)_AndroidAot.stamp" | ||
Lines="@(_MonoAOTCompiledAssemblies->'%(LibraryFile)')" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If others have a better idea on the name, basically you use this in combination with AOT and it will strip most IL that was AOT'd.
For best results, we'd turn off AndroidEnableProfiledAot by default -- so AndroidStripIL will AOT & Strip most of the IL as a good default setting.
@fanyang-mono has some example
.apk
sizes from adotnet new android
project:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok looks like there is a
$(WasmStripILAfterAOT)
:https://github.com/dotnet/runtime/blob/2ed506c010b41c41c01997c81df977831f0fa217/src/mono/wasm/build/WasmApp.targets#L88-L89
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$(AndroidStripILAfterAOT) seems logical to align?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed parameter name to
AndroidStripILAfterAOT