Skip to content

Commit 55dbc33

Browse files
authored
[One .NET] Do not preserve GeneratedEnumAttribute (#5450)
Context: #5167 The `GeneratedEnumAttribute` attribute does not need to be preserved for runtime behavior. It is only used for bindings. Removing the attribute allows apps to be smaller. `.apk` size comparison, BuildReleaseArm64False test: > apkdiff -f -e dll$ before.apk after.apk Size difference in bytes ([*1] apk1 only, [*2] apk2 only): - 39 assemblies/Mono.Android.dll + 132 Resource Android.ILLink.ILLink.LinkAttributes.xml - Type Android.Runtime.GeneratedEnumAttribute Summary: - 39 Assemblies -0.01% (of 749,078) Note that the attribute instances removal doesn't work yet; we need net6 illink for that.
1 parent bb3a9dc commit 55dbc33

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Microsoft.Android.Sdk.ILLink/PreserveLists/Mono.Android.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<assembly fullname="Mono.Android">
44
<type fullname="Android.Runtime.AnnotationAttribute" />
55
<type fullname="Android.Runtime.GeneratedDummyHost" />
6-
<type fullname="Android.Runtime.GeneratedEnumAttribute" />
76
<type fullname="Android.Runtime.IJavaObject" />
87
<type fullname="Android.Runtime.JNIEnv">
98
<method name="Exit" />

src/Mono.Android/ILLink/ILLink.LinkAttributes.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@
66
<type fullname="Android.Runtime.IntDefinitionAttribute">
77
<attribute internal="RemoveAttributeInstances" />
88
</type>
9+
<type fullname="Android.Runtime.GeneratedEnumAttribute">
10+
<attribute internal="RemoveAttributeInstances" />
11+
</type>
912
</assembly>
1013
</linker>

0 commit comments

Comments
 (0)