Uh oh!
There was an error while loading. Please reload this page.
[Microsoft.Android.Ref] use reference assembly for Mono.Android.dll - #5119
Merged
Merged
Conversation
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`.
jonathanpeppersforce-pushed
the
microsoft.android.ref
branch
from
September 15, 2020 19:29
0d6ad98 to
0638c89Comparejonathanpeppers
marked this pull request as ready for review
September 16, 2020 01:05
jonathanpeppers added a commit
to jonathanpeppers/java.interop
that referenced
this pull request
Sep 16, 2020
Context: dotnet/android#5119 The `Microsoft.Android.Ref` package for .NET 6 needs to contain reference assemblies for each assembly we ship. `Java.Interop.dll` is one of these, so we need to set `$(ProduceReferenceAssembly)` to generate a reference assembly automatically. Size difference: Length Name ------ ---- 227328 Java.Interop.dll 94208 ref/Java.Interop.dll
dellis1972
approved these changes
Sep 16, 2020
pjcollins
approved these changes
Sep 16, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Microsoft.Android.Ref.nupkgfile is meant to only containreference 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.nupkgMicrosoft.Android.Runtime.android.21-arm64.nupkgMicrosoft.Android.Runtime.android.21-x86.nupkgMicrosoft.Android.Runtime.android.21-x64.nupkgTo fix this, we need to set
$(ProduceReferenceAssembly)for eachassembly 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 theruntime assembly to place in
.apkfiles.I also cleaned up
Mono.Android.Export.csprojso we don't need toclear
$(BuildDependsOn)after manually importingMicrsoft.NET.Sdk.We could simply change
$(TargetFrameworks)instead.Using a reference assembly has the benefit of saving ~3.5 MB of file
size:
And saves ~18.9 MB when extracted:
We will need a future change in xamarin/java.interop to make a
reference assembly for
Java.Interop.dll.