Commit e5a4bee
authored
Fixes: #5373
Reverts: d548ec9
Reverts: #2862
The idea in Issue #2862 and commit d548ec9 was to to improve code
completion for Android Resources within Visual Studio:
![Android Resource completion in Visual Studio][0]
This was achieved by adding [`CategoryAttribute`][1] to various
properties so that Visual Studio could know what completions to show:
partial class ActivityAttribute {
[System.ComponentModel.Category ("@string")]
public string? Label {get; set;}
}
Unfortunately, the presence of `CategoryAttribute` causes the .NET 6
linker to preserve various dependencies of `System.ComponentModel`,
causing `.apk` files to be larger than desired.
Furthermore, the feature was *experimental*, and never shipped in a
stable Visual Studio release.
For now, revert commit d548ec9, removing the `[Category]` custom
attributes. This will allow `.apk` files to be smaller for .NET 6.
Should we want to bring this feature back, we'll either need to see
if the linker can be improved to remove `CategoryAttribute`, or
instead introduce a set of `internal` attributes for this purpose.
Results of this change in a .NET 6 `.apk`:
> apkdiff before.apk after.apk
Size difference in bytes ([*1] apk1 only, [*2] apk2 only):
- 56 lib/armeabi-v7a/libxamarin-app.so
Section size difference
- 8 .rel.dyn
- 12 .data
- 6,144 .bss
- 77 assemblies/Mono.Android.dll
- 3,194 assemblies/System.ComponentModel.Primitives.dll *1
Summary:
+ 0 Other entries 0.00% (of 6,484)
+ 0 Dalvik executables 0.00% (of 317,508)
- 3,271 Assemblies -0.15% (of 2,139,234)
- 56 Shared libraries -0.00% (of 20,674,428)
- 3,468 Package size difference -0.04% (of 9,485,287)
[0]: https://user-images.githubusercontent.com/169707/54777844-f9b37500-4bf1-11e9-8e52-63982b8b362f.gif
[1]: https://docs.microsoft.com/dotnet/api/system.componentmodel.categoryattribute?view=netframework-4.7.2
1 parent 143f662 commit e5a4bee
File tree
8 files changed
+49
-29
lines changed- Documentation/release-notes
- src/Xamarin.Android.NamingCustomAttributes
- Android.App
- Android.Content
- tests/api-compatibility
8 files changed
+49
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
56 | | - | |
57 | 55 | | |
58 | | - | |
59 | 56 | | |
60 | 57 | | |
61 | 58 | | |
| |||
102 | 99 | | |
103 | 100 | | |
104 | 101 | | |
105 | | - | |
106 | 102 | | |
107 | 103 | | |
108 | 104 | | |
| |||
124 | 120 | | |
125 | 121 | | |
126 | 122 | | |
127 | | - | |
128 | 123 | | |
129 | 124 | | |
130 | 125 | | |
| |||
Lines changed: 0 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | | - | |
35 | 33 | | |
36 | 34 | | |
37 | 35 | | |
| |||
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
51 | | - | |
52 | 49 | | |
53 | 50 | | |
54 | 51 | | |
55 | 52 | | |
56 | 53 | | |
57 | | - | |
58 | 54 | | |
59 | 55 | | |
60 | | - | |
61 | 56 | | |
62 | 57 | | |
63 | 58 | | |
| |||
75 | 70 | | |
76 | 71 | | |
77 | 72 | | |
78 | | - | |
79 | 73 | | |
80 | 74 | | |
81 | 75 | | |
82 | 76 | | |
83 | 77 | | |
84 | 78 | | |
85 | | - | |
86 | 79 | | |
87 | 80 | | |
88 | 81 | | |
| |||
Lines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | | - | |
19 | 17 | | |
20 | | - | |
21 | 18 | | |
22 | 19 | | |
23 | 20 | | |
24 | | - | |
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
| |||
Lines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
34 | | - | |
35 | 32 | | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
39 | | - | |
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
| |||
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
20 | 18 | | |
21 | | - | |
22 | 19 | | |
23 | | - | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
28 | 24 | | |
29 | | - | |
30 | 25 | | |
31 | 26 | | |
32 | 27 | | |
| |||
Lines changed: 0 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
29 | 27 | | |
30 | 28 | | |
31 | | - | |
32 | 29 | | |
33 | 30 | | |
34 | 31 | | |
35 | 32 | | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
39 | | - | |
40 | 36 | | |
41 | 37 | | |
42 | 38 | | |
| |||
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
0 commit comments