Skip to content

Commit 26803f7

Browse files
authored
[dotnet] Set default runtime feature switches. (#10250)
Set all current feature switches, except for InvariantGlobalization, to defaults which trim the features. Ref: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md Ref: dotnet/android#5337 This drops the hello world app size from 28.6 MB to 23.5 MB. Full report: https://gist.github.com/rolfbjarne/71cc18b49446862f1d42aa29526b0ac6
1 parent 38531bd commit 26803f7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

dotnet/targets/Xamarin.Shared.Sdk.targets

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,17 @@
112112

113113
<!-- On the other hand, we want the linker to link away debug support in the actual code unless we're building for Debug -->
114114
<DebuggerSupport Condition="'$(DebuggerSupport)' == ''">$(_BundlerDebug)</DebuggerSupport>
115+
116+
<!--
117+
Other runtime libraries feature switches defaults
118+
Available feature switches: https://github.com/dotnet/runtime/blob/master/docs/workflow/trimming/feature-switches.md
119+
-->
120+
<EnableUnsafeBinaryFormatterSerialization Condition="'$(EnableUnsafeBinaryFormatterSerialization)' == ''">false</EnableUnsafeBinaryFormatterSerialization>
121+
<EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding>
122+
<EventSourceSupport Condition="'$(EventSourceSupport)' == ''">false</EventSourceSupport>
123+
<HttpActivityPropagationSupport Condition="'$(HttpActivityPropagationSupport)' == ''">false</HttpActivityPropagationSupport>
124+
<StartupHookSupport Condition="'$(StartupHookSupport)' == ''">false</StartupHookSupport>
125+
<UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == ''">true</UseSystemResourceKeys>
115126
</PropertyGroup>
116127

117128
<PropertyGroup>

0 commit comments

Comments
 (0)