-
Notifications
You must be signed in to change notification settings - Fork 566
Expand file tree
/
Copy pathMicrosoft.Android.Sdk.RuntimeConfig.targets
More file actions
80 lines (72 loc) · 3.86 KB
/
Microsoft.Android.Sdk.RuntimeConfig.targets
File metadata and controls
80 lines (72 loc) · 3.86 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!--
***********************************************************************************************
Microsoft.Android.Sdk.RuntimeConfig.targets
MSBuild logic related to *.runtimeconfig.json files.
See: https://github.com/dotnet/runtime/blob/b13715b6984889a709ba29ea8a1961db469f8805/src/mono/nuget/Microsoft.NET.Runtime.RuntimeConfigParser.Task/README.md
***********************************************************************************************
-->
<Project>
<PropertyGroup>
<_BinaryRuntimeConfigPath>$(IntermediateOutputPath)$(ProjectRuntimeConfigFileName).bin</_BinaryRuntimeConfigPath>
<_AndroidUseManagedTypeMap Condition=" '$(_AndroidTypeMapImplementation)' == 'managed' ">true</_AndroidUseManagedTypeMap>
</PropertyGroup>
<ItemGroup>
<!--
See: https://docs.microsoft.com/en-us/dotnet/core/tutorials/netcore-hosting#step-3-%2D-prepare-runtime-properties
These properties shouldn't be used in .NET for Android apps as there are no directories the runtime can search,
everything related to assemblies or shared libraries must go through the .NET for Android native runtime.
-->
<_RuntimeConfigReservedProperties Include="TRUSTED_PLATFORM_ASSEMBLIES"/>
<_RuntimeConfigReservedProperties Include="APP_PATHS"/>
<_RuntimeConfigReservedProperties Include="APP_NI_PATHS"/>
<_RuntimeConfigReservedProperties Include="NATIVE_DLL_SEARCH_DIRECTORIES"/>
<_RuntimeConfigReservedProperties Include="PLATFORM_RESOURCE_ROOTS"/>
<_RuntimeConfigReservedProperties Include="PINVOKE_OVERRIDE"/>
<_RuntimeConfigReservedProperties Include="RUNTIME_IDENTIFIER"/>
<_RuntimeConfigReservedProperties Include="APP_CONTEXT_BASE_DIRECTORY"/>
</ItemGroup>
<ItemGroup>
<!-- Default RuntimeHostConfigurationOptions -->
<RuntimeHostConfigurationOption Include="Xamarin.Android.Net.UseNegotiateAuthentication"
Condition="'$(AndroidUseNegotiateAuthentication)' != ''"
Value="$(AndroidUseNegotiateAuthentication)"
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="$(AndroidAvoidEmitForPerformance)"
Trim="true"
/>
<!-- https://github.com/dotnet/runtime/commit/fecf3eeffd3650566555e15292f9df0d3abcdfc6 -->
<RuntimeHostConfigurationOption Include="Microsoft.Extensions.DependencyInjection.DisableDynamicEngine"
Value="$(AndroidAvoidEmitForPerformance)"
Trim="true"
/>
<RuntimeHostConfigurationOption Include="Microsoft.Android.Runtime.RuntimeFeature.ManagedTypeMap"
Value="$([MSBuild]::ValueOrDefault('$(_AndroidUseManagedTypeMap)', 'false'))"
Trim="true"
/>
<RuntimeHostConfigurationOption Include="Microsoft.Android.Runtime.RuntimeFeature.XaHttpClientHandlerType"
Value="$([MSBuild]::ValueOrDefault('$(_AndroidUseXaHttpClientHandlerType)', 'false'))"
Trim="true"
/>
<RuntimeHostConfigurationOption Include="Microsoft.Android.Runtime.RuntimeFeature.IsAssignableFromCheck"
Condition="'$(_AndroidIsAssignableFromCheck)' != ''"
Value="$(_AndroidIsAssignableFromCheck)"
Trim="true"
/>
</ItemGroup>
<Target Name="_ParseRuntimeConfigFiles"
AfterTargets="GenerateBuildRuntimeConfigurationFiles"
Condition=" '$(GenerateRuntimeConfigurationFiles)' == 'true' "
Inputs="$(ProjectRuntimeConfigFilePath)"
Outputs="$(_BinaryRuntimeConfigPath)">
<RuntimeConfigParserTask
RuntimeConfigFile="$(ProjectRuntimeConfigFilePath)"
OutputFile="$(_BinaryRuntimeConfigPath)"
RuntimeConfigReservedProperties="@(_RuntimeConfigReservedProperties)"
/>
<ItemGroup>
<FileWrites Include="$(_BinaryRuntimeConfigPath)" />
</ItemGroup>
</Target>
</Project>