Add S.R.WindowsRuntime implemenation assembly into .NetCoreApp (dotnet/corefx#30761)
authorLuqun Lou <luqunl@users.noreply.github.com>
Wed, 1 Aug 2018 19:49:00 +0000 (12:49 -0700)
committerGitHub <noreply@github.com>
Wed, 1 Aug 2018 19:49:00 +0000 (12:49 -0700)
Commit migrated from https://github.com/dotnet/corefx/commit/724ffdee9db1c95314ca3c45f2692c2b7f73d78e

16 files changed:
src/libraries/System.Runtime.WindowsRuntime/Directory.Build.props
src/libraries/System.Runtime.WindowsRuntime/pkg/System.Runtime.WindowsRuntime.pkgproj [new file with mode: 0644]
src/libraries/System.Runtime.WindowsRuntime/ref/Configurations.props
src/libraries/System.Runtime.WindowsRuntime/ref/System.Runtime.WindowsRuntime.csproj
src/libraries/System.Runtime.WindowsRuntime/src/Configurations.props
src/libraries/System.Runtime.WindowsRuntime/src/System.Runtime.WindowsRuntime.csproj
src/libraries/external/harvestPackages/harvestPackages.props
src/libraries/external/netstandard/netstandard.depproj
src/libraries/external/winrt/Configurations.props
src/libraries/external/winrt/winrt.depproj
src/libraries/mscorlib.WinRT-Facade/ref/Configurations.props
src/libraries/mscorlib.WinRT-Facade/ref/TypeForwards.cs
src/libraries/mscorlib.WinRT-Facade/ref/mscorlib.WinRT-Facade.csproj
src/libraries/pkg/Microsoft.Private.CoreFx.NETCoreApp/Microsoft.Private.CoreFx.NETCoreApp.pkgproj
src/libraries/pkg/Microsoft.Private.PackageBaseline/packageIndex.json
src/libraries/shims/ApiCompat.proj

index 380ed50..d27b403 100644 (file)
@@ -4,6 +4,8 @@
   <PropertyGroup>
     <AssemblyVersion>4.0.14.0</AssemblyVersion>
     <AssemblyKey>ECMA</AssemblyKey>
+    <IsNETCoreApp>true</IsNETCoreApp> 
+    <IsNETCoreAppRef>false</IsNETCoreAppRef> 
     <IsUAP>true</IsUAP>
   </PropertyGroup>
 </Project>
\ No newline at end of file
diff --git a/src/libraries/System.Runtime.WindowsRuntime/pkg/System.Runtime.WindowsRuntime.pkgproj b/src/libraries/System.Runtime.WindowsRuntime/pkg/System.Runtime.WindowsRuntime.pkgproj
new file mode 100644 (file)
index 0000000..960a82f
--- /dev/null
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />
+  <ItemGroup>
+    <ProjectReference Include="..\ref\System.Runtime.WindowsRuntime.csproj">
+      <SupportedFramework>net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
+    </ProjectReference>
+    <ProjectReference Include="..\src\System.Runtime.WindowsRuntime.csproj"/>
+
+    <HarvestIncludePaths Include="ref/netcore50" />
+    <HarvestIncludePaths Include="ref/netstandard1.0">
+      <SupportedFramework>netcore45;wp8;net45</SupportedFramework>
+    </HarvestIncludePaths>
+    <HarvestIncludePaths Include="ref/netstandard1.2">
+      <SupportedFramework>net451;netcore451;wpa81;netcoreapp1.0</SupportedFramework>
+    </HarvestIncludePaths>
+    <!-- we've previously shipped higer netstandard reference assembly version,
+         this is OK since both of these frameworks will unify down to the inbox version -->
+    <ValidatePackageSuppression Include="PermitInboxRevsion">
+      <Value>.NETCore,Version=v4.5.1;WindowsPhoneApp,Version=v8.1</Value>
+    </ValidatePackageSuppression>
+
+    <!-- We can't harvest an assert to more than one path -->
+    <!-- Disable support for netcoreapp1.0 - netcoreapp2.0 for now.  To support these we need to build the src project for the old TFMs 
+    <File Include="$(PackagesDir)\System.Runtime.WindowsRuntime\4.3.0\runtimes\win8\lib\netstandard1.3\System.Runtime.WindowsRuntime.dll">
+      <TargetPath>runtimes/win/lib/netcoreapp1.0</TargetPath>
+      <TargetFramework>netcoreapp1.0</TargetFramework>
+    </File>  -->
+    
+    <HarvestIncludePaths Include="runtimes/win8/lib/netstandard1.3">
+      <TargetPath>runtimes/win/lib/netcore50</TargetPath>
+    </HarvestIncludePaths>
+    <HarvestIncludePaths Include="runtimes/win8-aot/lib/netcore50">
+      <TargetPath>runtimes/win-aot/lib/netcore50</TargetPath>
+    </HarvestIncludePaths>
+
+    <File Include="$(PlaceHolderFile)">
+      <TargetPath>runtimes/win-aot/lib/uap10.0.16299</TargetPath>
+    </File>
+    <File Include="$(PlaceHolderFile)">
+      <TargetPath>runtimes/win/lib/uap10.0.16299</TargetPath>
+    </File>
+    <InboxOnTargetFramework Include="uap10.0.16299" />
+    <InboxOnTargetFramework Include="portable-win8+wp8+wpa81" />
+    <InboxOnTargetFramework Include="win8" />
+    <InboxOnTargetFramework Include="wp80" />
+    <InboxOnTargetFramework Include="wpa81" />
+  </ItemGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
+</Project> 
\ No newline at end of file
index 241987c..600231d 100644 (file)
@@ -1,9 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
+    <PackageConfigurations>
+      netstandard;
+    </PackageConfigurations>
     <BuildConfigurations>
-      uap;
+      $(PackageConfigurations);
       netcoreapp;
+      uap;
     </BuildConfigurations>
   </PropertyGroup>
 </Project>
\ No newline at end of file
index 58c3178..fcfc0f4 100644 (file)
@@ -17,7 +17,7 @@
     <Compile Include="System.Runtime.WindowsRuntime.cs" />
     <Compile Include="System.Runtime.WindowsRuntime.Manual.cs" />
   </ItemGroup>
-  <ItemGroup>
+  <ItemGroup Condition="'$(TargetGroup)'=='netcoreapp' or '$(TargetGroup)'=='uap'">
     <ProjectReference Include="..\..\..\external\winrt\winrt.depproj" />
     <ProjectReference Include="..\..\mscorlib.WinRT-Facade\ref\mscorlib.WinRT-Facade.csproj" />
     <ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
@@ -25,4 +25,8 @@
     <ProjectReference Include="..\..\System.IO\ref\System.IO.csproj" />
     <ProjectReference Include="..\..\System.Threading.Tasks\ref\System.Threading.Tasks.csproj" />
   </ItemGroup>
+  <ItemGroup Condition="'$(TargetGroup)'=='netstandard'">
+    <ProjectReference Include="..\..\..\external\winrt\winrt.depproj" />
+    <ProjectReference Include="..\..\mscorlib.WinRT-Facade\ref\mscorlib.WinRT-Facade.csproj" />
+  </ItemGroup>
 </Project>
\ No newline at end of file
index 7fd1fae..db1b5d3 100644 (file)
@@ -1,10 +1,16 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
+    <PackageConfigurations>
+      netstandard1.0;
+      netstandard1.2;
+      netstandard;
+      netcoreapp-Windows_NT;
+    </PackageConfigurations>
     <BuildConfigurations>
+      $(PackageConfigurations);
       uap-Windows_NT;
       uapaot-Windows_NT;
-      netcoreapp-Windows_NT;
     </BuildConfigurations>
   </PropertyGroup>
 </Project>
\ No newline at end of file
index 552c451..fb09a37 100644 (file)
@@ -7,13 +7,18 @@
     <!-- CS0436 - System.Private.CoreLib has internals visible to System.Runtime.WindowsRuntime and is colliding internals on common shared code -->
     <NoWarn>$(NoWarn);1698;0436</NoWarn>
     <ProjectGuid>{844A2A0B-4169-49C3-B367-AFDC4894E487}</ProjectGuid>
-    <PackageTargetRuntime>win8</PackageTargetRuntime>
-    <PackageTargetRuntime Condition="'$(TargetGroup)' == 'uapaot'">win8-aot</PackageTargetRuntime>
-    <Configurations>netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release;uapaot-Windows_NT-Debug;uapaot-Windows_NT-Release</Configurations>
+   <Configurations>netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;uap-Windows_NT-Debug;uap-Windows_NT-Release;uapaot-Windows_NT-Debug;uapaot-Windows_NT-Release;netstandard1.0-Debug;netstandard1.0-Release;</Configurations>
   </PropertyGroup>
   <PropertyGroup Condition="'$(TargetGroup)'=='netcoreapp' or '$(TargetGroup)'=='uap'">
     <DefineConstants>$(DefineConstants);netstandard;FEATURE_APPX</DefineConstants>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(TargetsNetStandard)' == 'true'">
+    <GeneratePlatformNotSupportedAssembly>true</GeneratePlatformNotSupportedAssembly>
+    <!-- <GeneratePlatformNotSupportedAssemblyMessage>SR.PlatformNotSupported_WindowsRuntime</GeneratePlatformNotSupportedAssemblyMessage> -->
+    <GeneratePlatformNotSupportedAssemblyWithGlobalPrefix>true</GeneratePlatformNotSupportedAssemblyWithGlobalPrefix>
+    <AssemblyVersion Condition="'$(TargetGroup)' == 'netstandard1.0'">4.0.0.0</AssemblyVersion>
+    <AssemblyVersion Condition="'$(TargetGroup)' == 'netstandard1.2'">4.0.11.0</AssemblyVersion>
+  </PropertyGroup>
   <ItemGroup Condition="'$(TargetGroup)'=='netcoreapp' or '$(TargetGroup)'=='uap'">
     <ReferenceFromRuntime Include="System.Private.CoreLib" />
     <Reference Include="mscorlib" />
@@ -53,7 +58,7 @@
       <TargetGroup>uapaot</TargetGroup>
     </ProjectReference>
   </ItemGroup>
-  <ItemGroup Condition="'$(TargetGroup)'=='netcoreapp' or '$(TargetGroup)'=='uap'">
+  <ItemGroup Condition="'$(TargetsNETCoreApp)'=='true' or '$(TargetGroup)'=='uap'">
     <Compile Include="System\InternalHelpers.CoreCLR.cs" />
     <Compile Include="System\IO\StreamOperationAsyncResult.CoreCLR.cs" />
     <Compile Include="System\Runtime\InteropServices\WindowsRuntime\MarshalingHelpers.cs" />
@@ -76,7 +81,7 @@
     <Compile Include="System\Threading\Tasks\AsyncInfoToTaskBridge.CoreRT.cs" />
     <Compile Include="System\WindowsRuntimeSystemExtensions.CoreRT.cs" />
   </ItemGroup>
-  <ItemGroup>
+  <ItemGroup Condition="'$(TargetsNETCoreApp)'=='true' or '$(TargetsUAP)'=='true'">
     <Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.ResolveLocaleName.cs">
       <Link>Common\Interop\Windows\kernel32\Interop.ResolveLocaleName.cs</Link>
     </Compile>
     <Compile Include="System\Windows\TokenizerHelper.cs" />
     <Compile Include="System\Windows\UI\Color.cs" />
   </ItemGroup>
+  
+  <ItemGroup Condition="'$(TargetsNetStandard)' == 'true'">
+    <Reference Include="System.Runtime" />
+    <Reference Include="System.IO" />
+    <Reference Include="System.Threading.Tasks" />
+    <Reference Include="System.Resources.ResourceManager" />
+    <ProjectReference Include="..\..\..\external\winrt\winrt.depproj" />
+    <ProjectReference Include="..\..\mscorlib.WinRT-Facade\ref\mscorlib.WinRT-Facade.csproj" />
+  </ItemGroup>
 </Project>
\ No newline at end of file
index c5e8f96..993989c 100644 (file)
 <PackageReference Include="System.Runtime.CompilerServices.Unsafe">
   <Version>4.5.1</Version>
 </PackageReference>
+<PackageReference Include="System.Runtime.WindowsRuntime">
+  <Version>4.3.0</Version>
+</PackageReference>
+<PackageReference Include="System.Runtime.WindowsRuntime.UI.Xaml">
+  <Version>4.3.0</Version>
+</PackageReference>
 <PackageReference Include="System.Security.AccessControl">
   <Version>4.4.0</Version>
 </PackageReference>
index b856a65..62c42c9 100644 (file)
@@ -46,6 +46,9 @@
     <PackageReference Include="System.Reflection.Emit.Lightweight">
       <Version>4.3.0</Version>
     </PackageReference>
+    <PackageReference Include="System.Runtime.WindowsRuntime">
+      <Version>4.3.0</Version>
+    </PackageReference>
   </ItemGroup>
 
   <ItemGroup>
index c701755..04ff7ea 100644 (file)
@@ -4,6 +4,7 @@
     <BuildConfigurations>
       netcoreapp;
       uap;
+      netstandard1.0;
     </BuildConfigurations>
   </PropertyGroup>
 </Project>
\ No newline at end of file
index 619f509..60ccc97 100644 (file)
@@ -4,7 +4,9 @@
   <PropertyGroup>
     <AssemblyName>Windows</AssemblyName>
     <TargetExt>.winmd</TargetExt>
-    <BinPlaceRef>true</BinPlaceRef>
+    <!-- don't binplace for netstandard since the netstandard ref path is used for API compat and assumed to be 
+         implemented by all frameworks that support it.  Instead require projectreference to this project -->
+    <BinPlaceRef Condition="'$(TargetsNetStandard)' != 'true'">true</BinPlaceRef>
     <NuGetDeploySourceItem>Reference</NuGetDeploySourceItem>
   </PropertyGroup>
   <ItemGroup>
index 241987c..0840ff6 100644 (file)
@@ -4,6 +4,8 @@
     <BuildConfigurations>
       uap;
       netcoreapp;
+      netstandard;
+      netstandard1.0;
     </BuildConfigurations>
   </PropertyGroup>
-</Project>
\ No newline at end of file
+</Project>
index 7625e95..40be9d9 100644 (file)
@@ -19,7 +19,9 @@ using System.Runtime.CompilerServices;
 [assembly: TypeForwardedTo(typeof(System.IntPtr))]
 [assembly: TypeForwardedTo(typeof(System.MulticastDelegate))]
 [assembly: TypeForwardedTo(typeof(System.Object))]
+#if !NETSTANDARD10 && !NETSTANDARD12
 [assembly: TypeForwardedTo(typeof(System.Runtime.CompilerServices.IsConst))]
+#endif
 [assembly: TypeForwardedTo(typeof(System.Single))]
 [assembly: TypeForwardedTo(typeof(System.String))]
 [assembly: TypeForwardedTo(typeof(System.Type))]
@@ -30,4 +32,4 @@ using System.Runtime.CompilerServices;
 [assembly: TypeForwardedTo(typeof(void))] // System.Void
 
 // XAML compiler is checking for the following
-[assembly: TypeForwardedTo(typeof(System.Array))]
\ No newline at end of file
+[assembly: TypeForwardedTo(typeof(System.Array))]
index 50632e5..35ace12 100644 (file)
@@ -8,11 +8,16 @@
     <BinPlaceRef>false</BinPlaceRef>
     <ProjectGuid>{4773F3C0-646E-4542-9FD5-D07A7737403A}</ProjectGuid>
     <Configurations>netcoreapp-Debug;netcoreapp-Release;uap-Debug;uap-Release</Configurations>
+    <DefineConstants Condition="'$(TargetGroup)' == 'netstandard1.0'">$(DefineConstants);NETSTANDARD10</DefineConstants>
+    <DefineConstants Condition="'$(TargetGroup)' == 'netstandard1.2'">$(DefineConstants);NETSTANDARD12</DefineConstants>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="TypeForwards.cs" />
   </ItemGroup>
-  <ItemGroup>
+  <ItemGroup Condition="'$(TargetGroup)' != 'netstandard1.0' and '$(TargetGroup)' != 'netstandard'">
     <ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
   </ItemGroup>
-</Project>
\ No newline at end of file
+  <ItemGroup Condition="'$(TargetGroup)' == 'netstandard1.0' or '$(TargetGroup)' == 'netstandard'">
+    <Reference Include="System.Runtime" />
+  </ItemGroup>
+</Project>
index 0fec6b3..3921a6c 100644 (file)
@@ -18,6 +18,7 @@
 
   <ItemGroup>
     <IgnoredReference Include="System.Private.CoreLib" />
+    <IgnoredReference Include="Windows" />
 
     <!-- Exclude shims from the closure verification -->
     <ExcludeFromClosure Include="mscorlib" />
@@ -44,6 +45,7 @@
         System.Private.Uri;
         System.Private.Xml;
         System.Private.Xml.Linq;
+        System.Runtime.WindowsRuntime;
         System.Security.AccessControl;
         System.Security.Cryptography.Cng;
         System.Security.Cryptography.OpenSsl;
index 75a7605..a1ddc17 100644 (file)
         "4.0.10.0": "4.0.10",
         "4.0.11.0": "4.0.11",
         "4.0.12.0": "4.3.0",
-        "4.0.13.0": "4.4.0"
+        "4.0.13.0": "4.4.0",
+        "4.0.14.0": "4.6.0"
       }
     },
     "System.Runtime.WindowsRuntime.UI.Xaml": {
       "System.Xml.XDocument"
     ]
   }
-}
+}
\ No newline at end of file
index 17e1d42..eb89b85 100644 (file)
@@ -17,7 +17,8 @@
     <ApiCompatNSOnlyBaselineFile>$(MSBuildThisFileDirectory)ApiCompatBaseline.$(TargetGroup).netstandard20Only.txt</ApiCompatNSOnlyBaselineFile>
     <ApiCompatImplementationDirs>$(RefPath),$(GenFacadesOutputPath)</ApiCompatImplementationDirs>
     <!-- If we are targeting uap or uapaot run ApiCompat against the implementation assemblies instead since they don't match the reference assemblies -->
-    <ApiCompatImplementationDirs Condition="$(TargetGroup.StartsWith('uap'))">$(RuntimePath),$(GenFacadesOutputPath)</ApiCompatImplementationDirs>
+    <!-- also include $(RefPath) last to pick up windows.winmd dependency, which we don't place in RuntimePath -->
+    <ApiCompatImplementationDirs Condition="$(TargetGroup.StartsWith('uap'))">$(RuntimePath),$(GenFacadesOutputPath),$(RefPath)</ApiCompatImplementationDirs>
     <!-- Set to true to build this project -->
     <!-- Separate property otherwise /p:BaselineApiCompat=true would force it to run even for non-UAP -->
     <BaselineApiCompat Condition="'$(BaselineApiCompat)' == ''">false</BaselineApiCompat>