Skip to content

Commit

Permalink
Merge branch 'main' into all-assemblies-per-rid
Browse files Browse the repository at this point in the history
* main:
  [Xamarin.Android.Build.Tasks] feature switch defaults for fast startup (dotnet#8347)
  Localized file check-in by OneLocBuild Task (dotnet#8358)
  • Loading branch information
grendello committed Sep 21, 2023
2 parents 87905aa + eb6397d commit bf60944
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 95 deletions.
26 changes: 26 additions & 0 deletions Documentation/guides/building-apps/build-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,32 @@ The `$(AndroidApplicationJavaClass)` property is generally set by

Added in Xamarin.Android 6.1.

## AndroidAvoidEmitForPerformance

A boolean property that determines whether or not `System.Reflection.Emit` is
"avoided" to improve startup performance. This property is `True` by default.

Usage of `System.Reflection.Emit` has a noticeable impact on startup performance
on Android. This behavior is disabled by default for the following feature
switches:

* `Switch.System.Reflection.ForceInterpretedInvoke`: after the second call to
`MethodInfo.Invoke()` or `ConstructorInfo.Invoke()`, code is emitted to
improve performance of repeated calls.

* `Microsoft.Extensions.DependencyInjection.DisableDynamicEngine`: after the
second call to retrieve a service from a dependency injection container, code
is emitted to improve performance of repeated calls.

It is desirable in most Android applications to disable this behavior.

See the [Base Class Libraries Feature Switches documentation][feature-switches]
for details about available feature switches.

Added in .NET 8.

[feature-switches]: https://github.com/dotnet/runtime/blob/main/docs/workflow/trimming/feature-switches.md

## AndroidBinUtilsPath

A path to a directory containing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@
<NullabilityInfoContextSupport Condition="'$(NullabilityInfoContextSupport)' == ''">false</NullabilityInfoContextSupport>
<BuiltInComInteropSupport Condition="'$(BuiltInComInteropSupport)' == ''">false</BuiltInComInteropSupport>
<JsonSerializerIsReflectionEnabledByDefault Condition="'$(JsonSerializerIsReflectionEnabledByDefault)' == '' and '$(TrimMode)' == 'partial'">true</JsonSerializerIsReflectionEnabledByDefault>
<_SystemReflectionForceInterpretedInvoke Condition="'$(_SystemReflectionForceInterpretedInvoke)' == ''">true</_SystemReflectionForceInterpretedInvoke>
<_SystemDiagnosticsMetricsMeterIsSupported Condition="'$(_SystemDiagnosticsMetricsMeterIsSupported)' == ''">false</_SystemDiagnosticsMetricsMeterIsSupported>
<AndroidAvoidEmitForPerformance Condition="'$(AndroidAvoidEmitForPerformance)' == ''">$(AvoidEmitForPerformance)</AndroidAvoidEmitForPerformance>
<AndroidAvoidEmitForPerformance Condition="'$(AndroidAvoidEmitForPerformance)' == ''">true</AndroidAvoidEmitForPerformance>
<!-- Verify DI trimmability at development-time, but turn the validation off for production/trimmed builds. -->
<VerifyDependencyInjectionOpenGenericServiceTrimmability Condition="'$(VerifyDependencyInjectionOpenGenericServiceTrimmability)' == '' and '$(PublishTrimmed)' == 'true'">false</VerifyDependencyInjectionOpenGenericServiceTrimmability>
<VerifyDependencyInjectionOpenGenericServiceTrimmability Condition="'$(VerifyDependencyInjectionOpenGenericServiceTrimmability)' == ''">true</VerifyDependencyInjectionOpenGenericServiceTrimmability>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,17 @@ See: https://github.com/dotnet/runtime/blob/b13715b6984889a709ba29ea8a1961db469f
Trim="true" />
<!-- https://github.com/dotnet/runtime/blob/211cdd011f19a51b7092d8365e11e774a8280afb/src/libraries/System.Private.CoreLib/src/System/LocalAppContextSwitches.cs#L52 -->
<RuntimeHostConfigurationOption Include="Switch.System.Reflection.ForceInterpretedInvoke"
Value="$(_SystemReflectionForceInterpretedInvoke)"
Value="$(AndroidAvoidEmitForPerformance)"
Trim="true"
/>
<!-- https://github.com/dotnet/runtime/commit/fecf3eeffd3650566555e15292f9df0d3abcdfc6 -->
<RuntimeHostConfigurationOption Include="Microsoft.Extensions.DependencyInjection.DisableDynamicEngine"
Value="$(AndroidAvoidEmitForPerformance)"
Trim="true"
/>
<!-- https://github.com/dotnet/runtime/commit/3aeefbdd5e975e287effaa8670422837dc661d68 -->
<RuntimeHostConfigurationOption Include="System.Diagnostics.Metrics.Meter.IsSupported"
Value="$(_SystemDiagnosticsMetricsMeterIsSupported)"
Trim="true"
/>
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Xamarin.Android.Build.Tasks/Properties/Resources.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -542,11 +542,11 @@ Bitte ändern Sie den Wert in einen Assembly-basierten Typnamen, der von „{1}
{0} - The assembly name</comment>
</data>
<data name="APT2264" xml:space="preserve">
<value>This could be caused by the project exceeding the Windows maximum path length limitation. See https://learn.microsoft.com/xamarin/android/errors-and-warnings/apt2264 for details.</value>
<value>Dies ist möglicherweise darauf zurückzuführen, dass das Projekt die Windows-Beschränkung der maximalen Pfadlänge überschreitet. Weitere Informationen finden Sie unter https://learn.microsoft.com/xamarin/android/errors-and-warnings/apt2264.</value>
<comment>The following are literal names and should not be translated:</comment>
</data>
<data name="APT2265" xml:space="preserve">
<value>This could be caused by the project having non-ASCII characters in its filename or path. See https://learn.microsoft.com/xamarin/android/errors-and-warnings/apt2265 for details.</value>
<value>Dies kann daran liegen, dass der Dateiname oder der Pfad des Projekts Nicht-ASCII-Zeichen enthält. Weitere Informationen finden Sie unter https://learn.microsoft.com/xamarin/android/errors-and-warnings/apt2265.</value>
<comment>The following are literal names and should not be translated:</comment>
</data>
<data name="XA3001" xml:space="preserve">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,136 +5,136 @@
"Size": 3572
},
"assemblies/_Microsoft.Android.Resource.Designer.dll": {
"Size": 2101
"Size": 2102
},
"assemblies/FormsViewGroup.dll": {
"Size": 7112
},
"assemblies/Java.Interop.dll": {
"Size": 70026
"Size": 70036
},
"assemblies/Mono.Android.dll": {
"Size": 469836
"Size": 471216
},
"assemblies/Mono.Android.Runtime.dll": {
"Size": 5509
"Size": 5506
},
"assemblies/mscorlib.dll": {
"Size": 3859
"Size": 3852
},
"assemblies/netstandard.dll": {
"Size": 5575
"Size": 5565
},
"assemblies/rc.bin": {
"Size": 1395
"Size": 1512
},
"assemblies/System.Collections.Concurrent.dll": {
"Size": 11508
"Size": 11502
},
"assemblies/System.Collections.dll": {
"Size": 15408
"Size": 15398
},
"assemblies/System.Collections.NonGeneric.dll": {
"Size": 7451
"Size": 7442
},
"assemblies/System.ComponentModel.dll": {
"Size": 1935
"Size": 1925
},
"assemblies/System.ComponentModel.Primitives.dll": {
"Size": 2549
"Size": 2538
},
"assemblies/System.ComponentModel.TypeConverter.dll": {
"Size": 6031
"Size": 6020
},
"assemblies/System.Console.dll": {
"Size": 6572
"Size": 6565
},
"assemblies/System.Core.dll": {
"Size": 1984
"Size": 1977
},
"assemblies/System.Diagnostics.DiagnosticSource.dll": {
"Size": 12520
"Size": 9057
},
"assemblies/System.Diagnostics.TraceSource.dll": {
"Size": 6548
"Size": 6540
},
"assemblies/System.dll": {
"Size": 2341
"Size": 2332
},
"assemblies/System.Drawing.dll": {
"Size": 1934
"Size": 1923
},
"assemblies/System.Drawing.Primitives.dll": {
"Size": 11971
"Size": 11967
},
"assemblies/System.IO.Compression.Brotli.dll": {
"Size": 11188
"Size": 11187
},
"assemblies/System.IO.Compression.dll": {
"Size": 15864
"Size": 15856
},
"assemblies/System.IO.IsolatedStorage.dll": {
"Size": 9869
"Size": 9862
},
"assemblies/System.Linq.dll": {
"Size": 19560
"Size": 19555
},
"assemblies/System.Linq.Expressions.dll": {
"Size": 164682
"Size": 165111
},
"assemblies/System.Net.Http.dll": {
"Size": 69544
"Size": 67637
},
"assemblies/System.Net.Primitives.dll": {
"Size": 22431
"Size": 22426
},
"assemblies/System.Net.Requests.dll": {
"Size": 3599
"Size": 3589
},
"assemblies/System.ObjectModel.dll": {
"Size": 8113
"Size": 8106
},
"assemblies/System.Private.CoreLib.dll": {
"Size": 845111
"Size": 845653
},
"assemblies/System.Private.DataContractSerialization.dll": {
"Size": 192906
"Size": 193645
},
"assemblies/System.Private.Uri.dll": {
"Size": 43477
"Size": 42849
},
"assemblies/System.Private.Xml.dll": {
"Size": 215983
"Size": 215960
},
"assemblies/System.Private.Xml.Linq.dll": {
"Size": 16636
"Size": 16631
},
"assemblies/System.Runtime.dll": {
"Size": 2748
"Size": 2740
},
"assemblies/System.Runtime.InteropServices.dll": {
"Size": 3858
"Size": 3851
},
"assemblies/System.Runtime.Serialization.dll": {
"Size": 1861
"Size": 1850
},
"assemblies/System.Runtime.Serialization.Formatters.dll": {
"Size": 2480
"Size": 2469
},
"assemblies/System.Runtime.Serialization.Primitives.dll": {
"Size": 3758
"Size": 3747
},
"assemblies/System.Security.Cryptography.dll": {
"Size": 8099
"Size": 8089
},
"assemblies/System.Text.RegularExpressions.dll": {
"Size": 158865
"Size": 158950
},
"assemblies/System.Xml.dll": {
"Size": 1752
"Size": 1741
},
"assemblies/System.Xml.Linq.dll": {
"Size": 1771
"Size": 1761
},
"assemblies/UnnamedProject.dll": {
"Size": 4987
Expand Down Expand Up @@ -206,7 +206,7 @@
"Size": 42282
},
"classes.dex": {
"Size": 3514720
"Size": 3513140
},
"lib/arm64-v8a/libmono-component-marshal-ilgen.so": {
"Size": 97080
Expand All @@ -215,19 +215,19 @@
"Size": 325320
},
"lib/arm64-v8a/libmonosgen-2.0.so": {
"Size": 3189360
"Size": 3193200
},
"lib/arm64-v8a/libSystem.IO.Compression.Native.so": {
"Size": 723560
},
"lib/arm64-v8a/libSystem.Native.so": {
"Size": 93920
"Size": 93952
},
"lib/arm64-v8a/libSystem.Security.Cryptography.Native.Android.so": {
"Size": 154904
},
"lib/arm64-v8a/libxamarin-app.so": {
"Size": 102752
"Size": 102840
},
"META-INF/android.support.design_material.version": {
"Size": 12
Expand Down Expand Up @@ -1916,5 +1916,5 @@
"Size": 325240
}
},
"PackageSize": 7977998
"PackageSize": 7973902
}
Binary file modified src/profiled-aot/dotnet.aotprofile
Binary file not shown.
Loading

0 comments on commit bf60944

Please sign in to comment.