Commit 0638c89
committed
[Microsoft.Android.Ref] use reference assembly for Mono.Android.dll
The `Microsoft.Android.Ref.nupkg` file is meant to only contain
reference assemblies, and we are currently shipping the *real* assembly.
The actual runtime assembly is found in the runtime pack for each RID:
* `Microsoft.Android.Runtime.android.21-arm.nupkg`
* `Microsoft.Android.Runtime.android.21-arm64.nupkg`
* `Microsoft.Android.Runtime.android.21-x86.nupkg`
* `Microsoft.Android.Runtime.android.21-x64.nupkg`
To fix this, we need to set `$(ProduceReferenceAssembly)` for each
assembly we distribute in `Microsoft.Android.Ref`.
The MSBuild targets in dotnet/sdk already handle passing the correct
reference assembly to the `<Csc/>` MSBuild task, and passing us the
runtime assembly to place in `.apk` files.
I also cleaned up `Mono.Android.Export.csproj` so we don't need to
clear `$(BuildDependsOn)` after manually importing `Micrsoft.NET.Sdk`.
We could simply change `$(TargetFrameworks)` instead.
Using a reference assembly has the benefit of saving ~3.5 MB of file
size:
Length Name
------ ----
7167945 Microsoft.Android.Ref.11.0.100-ci.master.120.nupkg
3641811 Microsoft.Android.Ref.11.0.100-ci.microsoft-android-ref.121.nupkg
And saves ~18.9 MB when extracted:
Size Compressed Name
------------ ------------ ------------------------
32411136 6748183 ref\net5.0\Mono.Android.dll
78336 30619 ref\net5.0\Mono.Android.Export.dll
13564928 3244535 ref\net5.0\Mono.Android.dll
22016 8077 ref\net5.0\Mono.Android.Export.dll
We will need a future change in xamarin/java.interop to make a
reference assembly for `Java.Interop.dll`.1 parent 28add0d commit 0638c89
4 files changed
Lines changed: 11 additions & 13 deletions
File tree
- build-tools/create-packs
- src
- Mono.Android.Export
- Mono.Android
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
3 | 2 | | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
8 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 63 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
0 commit comments