PNSE BinaryFormatter on mobile and skip related tests (#52248)
authorSteve Pfister <steveisok@users.noreply.github.com>
Fri, 7 May 2021 20:12:13 +0000 (16:12 -0400)
committerGitHub <noreply@github.com>
Fri, 7 May 2021 20:12:13 +0000 (16:12 -0400)
eng/testing/tests.mobile.targets
src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs
src/libraries/System.Runtime.Serialization.Formatters/src/ILLink/ILLink.Substitutions.NonMobile.xml [moved from src/libraries/System.Runtime.Serialization.Formatters/src/ILLink/ILLink.Substitutions.NonBrowser.xml with 100% similarity]
src/libraries/System.Runtime.Serialization.Formatters/src/System.Runtime.Serialization.Formatters.csproj
src/tasks/AndroidAppBuilder/ApkBuilder.cs

index bae8a84..00f9fc0 100644 (file)
@@ -17,7 +17,6 @@
     <EnableUnsafeUTF7Encoding>false</EnableUnsafeUTF7Encoding>
     <EnableUnsafeBinaryFormatterSerialization>false</EnableUnsafeBinaryFormatterSerialization>
     <EventSourceSupport>false</EventSourceSupport>
-    <InvariantGlobalization>false</InvariantGlobalization>
     <UseSystemResourceKeys>true</UseSystemResourceKeys>
     <HttpActivityPropagationSupport>false</HttpActivityPropagationSupport>
     <StartupHookSupport>false</StartupHookSupport>
index d5d5817..35b2b6f 100644 (file)
@@ -51,7 +51,7 @@ namespace System
         public static bool IsNotWindows => !IsWindows;
 
         public static bool IsThreadingSupported => !IsBrowser;
-        public static bool IsBinaryFormatterSupported => !IsBrowser;
+        public static bool IsBinaryFormatterSupported => IsNotMobile;
 
         public static bool IsSpeedOptimized => !IsSizeOptimized;
         public static bool IsSizeOptimized => IsBrowser || IsAndroid || IsiOS || IstvOS;
index 6d339f8..137d1e5 100644 (file)
@@ -1,16 +1,16 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppCurrent)-Browser</TargetFrameworks>
+    <TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Android;</TargetFrameworks>
     <Nullable>enable</Nullable>
     <!-- When we replace implementations with PNSE, need to suppress some "field is never assigned to" warnings. -->
-    <NoWarn Condition="'$(TargetsBrowser)' == 'true'">$(NoWarn);CS0649</NoWarn>
+    <NoWarn Condition="'$(TargetsMobile)' == 'true'">$(NoWarn);CS0649</NoWarn>
   </PropertyGroup>
   <!-- ILLinker settings -->
   <PropertyGroup>
     <ILLinkDirectory>$(MSBuildThisFileDirectory)ILLink\</ILLinkDirectory>
   </PropertyGroup>
-  <ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
-    <ILLinkSubstitutionsXmls Include="$(ILLinkDirectory)ILLink.Substitutions.NonBrowser.xml" />
+  <ItemGroup Condition="'$(TargetsMobile)' != 'true'">
+    <ILLinkSubstitutionsXmls Include="$(ILLinkDirectory)ILLink.Substitutions.NonMobile.xml" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="System.Runtime.Serialization.Formatters.TypeForwards.cs" />
     <Compile Include="$(CoreLibSharedDir)System\Collections\HashHelpers.cs"
              Link="Common\System\Collections\HashHelpers.cs" />
   </ItemGroup>
-  <ItemGroup Condition="'$(TargetsBrowser)' != 'true'">
+  <ItemGroup Condition="'$(TargetsMobile)' != 'true'">
     <Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryFormatter.Core.cs" />
     <Compile Include="System\Runtime\Serialization\LocalAppContextSwitches.cs" />
     <Compile Include="$(CommonPath)System\LocalAppContextSwitches.Common.cs">
       <Link>Common\System\LocalAppContextSwitches.Common.cs</Link>
     </Compile>
   </ItemGroup>
-  <ItemGroup Condition="'$(TargetsBrowser)' == 'true'">
+  <ItemGroup Condition="'$(TargetsMobile)' == 'true'">
     <Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryFormatter.PlatformNotSupported.cs" />
   </ItemGroup>
   <ItemGroup>
index 67e5cd7..91e1dc8 100644 (file)
@@ -24,6 +24,8 @@ public class ApkBuilder
     public string? KeyStorePath { get; set; }
     public bool ForceInterpreter { get; set; }
     public bool ForceAOT { get; set; }
+    public bool InvariantGlobalization { get; set; }
+    public bool EnableRuntimeLogging { get; set; }
     public string? StaticLinkedComponentNames { get; set; }
     public ITaskItem[] Assemblies { get; set; } = Array.Empty<ITaskItem>();