Skip to content

Commit 200f843

Browse files
[trimming] use public $(MetricsSupport) property (#9068)
Context: #9060 (comment) Context: https://github.com/dotnet/sdk/blob/e18cfb7a09d74952d5e9c2448d31dee313e059bb/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets#L522-L525 In eb6397d, we introduced `$(_SystemDiagnosticsMetricsMeterIsSupported)` to avoid a startup time regression with `HttpClient`-related code. At the time, the public property `$(MetricsSupport)` had not been introduced yet in the .NET SDK. Let's use `$(MetricsSupport)` instead of the private `$(_SystemDiagnosticsMetricsMeterIsSupported)` property.
1 parent c20c5e9 commit 200f843

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.DefaultProperties.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
<NullabilityInfoContextSupport Condition="'$(NullabilityInfoContextSupport)' == ''">false</NullabilityInfoContextSupport>
120120
<BuiltInComInteropSupport Condition="'$(BuiltInComInteropSupport)' == ''">false</BuiltInComInteropSupport>
121121
<JsonSerializerIsReflectionEnabledByDefault Condition="'$(JsonSerializerIsReflectionEnabledByDefault)' == '' and '$(TrimMode)' == 'partial'">true</JsonSerializerIsReflectionEnabledByDefault>
122-
<_SystemDiagnosticsMetricsMeterIsSupported Condition="'$(_SystemDiagnosticsMetricsMeterIsSupported)' == ''">false</_SystemDiagnosticsMetricsMeterIsSupported>
122+
<MetricsSupport Condition="'$(MetricsSupport)' == ''">false</MetricsSupport>
123123
<AndroidAvoidEmitForPerformance Condition="'$(AndroidAvoidEmitForPerformance)' == ''">$(AvoidEmitForPerformance)</AndroidAvoidEmitForPerformance>
124124
<AndroidAvoidEmitForPerformance Condition="'$(AndroidAvoidEmitForPerformance)' == ''">true</AndroidAvoidEmitForPerformance>
125125
<!-- Verify DI trimmability at development-time, but turn the validation off for production/trimmed builds. -->

src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.RuntimeConfig.targets

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ See: https://github.com/dotnet/runtime/blob/b13715b6984889a709ba29ea8a1961db469f
4646
Value="$(AndroidAvoidEmitForPerformance)"
4747
Trim="true"
4848
/>
49-
<!-- https://github.com/dotnet/runtime/commit/3aeefbdd5e975e287effaa8670422837dc661d68 -->
50-
<RuntimeHostConfigurationOption Include="System.Diagnostics.Metrics.Meter.IsSupported"
51-
Value="$(_SystemDiagnosticsMetricsMeterIsSupported)"
52-
Trim="true"
53-
/>
5449
</ItemGroup>
5550

5651
<Target Name="_ParseRuntimeConfigFiles"

0 commit comments

Comments
 (0)