Adding Microsoft.Bcl.AsyncInterfaces for .NET Standard 2.0 (dotnet/corefx#37189)
authorJose Perez Rodriguez <joperezr@microsoft.com>
Wed, 1 May 2019 02:24:33 +0000 (19:24 -0700)
committerStephen Toub <stoub@microsoft.com>
Wed, 1 May 2019 02:24:33 +0000 (22:24 -0400)
* Adding Microsoft.Compatibility.AsyncInterfaces package

* Addressing PR Feedback

* Fix small typo

* Remove unnecesary configurations from the package

* Rename to Microsoft.Bcl.AsyncInterfaces

* Addressing PR Feedback

Commit migrated from https://github.com/dotnet/corefx/commit/bfcbf22e72bd5f814af92c0980993a8b4e9c7232

12 files changed:
eng/configurations/targetgroups.props
src/libraries/Microsoft.Bcl.AsyncInterfaces/Directory.Build.props [new file with mode: 0644]
src/libraries/Microsoft.Bcl.AsyncInterfaces/Microsoft.Bcl.AsyncInterfaces.sln [new file with mode: 0644]
src/libraries/Microsoft.Bcl.AsyncInterfaces/pkg/Microsoft.Bcl.AsyncInterfaces.pkgproj [new file with mode: 0644]
src/libraries/Microsoft.Bcl.AsyncInterfaces/ref/Configurations.props [new file with mode: 0644]
src/libraries/Microsoft.Bcl.AsyncInterfaces/ref/Microsoft.Bcl.AsyncInterfaces.Forwards.cs [new file with mode: 0644]
src/libraries/Microsoft.Bcl.AsyncInterfaces/ref/Microsoft.Bcl.AsyncInterfaces.cs [new file with mode: 0644]
src/libraries/Microsoft.Bcl.AsyncInterfaces/ref/Microsoft.Bcl.AsyncInterfaces.csproj [new file with mode: 0644]
src/libraries/Microsoft.Bcl.AsyncInterfaces/src/Configurations.props [new file with mode: 0644]
src/libraries/Microsoft.Bcl.AsyncInterfaces/src/Microsoft.Bcl.AsyncInterfaces.csproj [new file with mode: 0644]
src/libraries/pkg/Microsoft.Private.PackageBaseline/packageIndex.json
src/libraries/pkg/descriptions.json

index 320103337fdb07e07b8f39a6945aae1b6954540a..5878d40d25323a87a37cbecb59c09b98ef050fb5 100644 (file)
@@ -42,7 +42,7 @@
       <PackageTargetRuntimeSuffix>aot</PackageTargetRuntimeSuffix>
       <UWPCompatible>true</UWPCompatible>
       <Imports>uap10.0.16299aot</Imports>
-      <CompatibleWith>uapvnext;netstandard2.0</CompatibleWith>
+      <CompatibleWith>uapvnext;netstandard2.1</CompatibleWith>
     </TargetGroups>
     <TargetGroups Include="uapvnext">
       <TargetFramework>$(UAPvNextTFM)</TargetFramework>
@@ -50,7 +50,7 @@
       <TargetFrameworkVersion>$(UAPvNextVersion)</TargetFrameworkVersion>
       <UWPCompatible>true</UWPCompatible>
       <Imports>uap10.0.16299</Imports>
-      <CompatibleWith>netstandard2.0</CompatibleWith>
+      <CompatibleWith>netstandard2.1</CompatibleWith>
     </TargetGroups>
     <!-- uap is an alias for uapvNext any/coreclr runtime -->
     <TargetGroups Include="uap">
@@ -59,7 +59,7 @@
       <TargetFrameworkVersion>$(UAPvNextVersion)</TargetFrameworkVersion>
       <UWPCompatible>true</UWPCompatible>
       <Imports>uapvnext</Imports>
-      <CompatibleWith>netstandard</CompatibleWith>
+      <CompatibleWith>netstandard2.1</CompatibleWith>
     </TargetGroups>
     <!-- uapaot is an alias for uapvNext, aot runtime -->
     <TargetGroups Include="uapaot">
@@ -69,7 +69,7 @@
       <PackageTargetRuntimeSuffix>aot</PackageTargetRuntimeSuffix>
       <UWPCompatible>true</UWPCompatible>
       <Imports>uapvnextaot</Imports>
-      <CompatibleWith>uap;netstandard</CompatibleWith>
+      <CompatibleWith>uap;netstandard2.1</CompatibleWith>
     </TargetGroups>
     <TargetGroups Include="netstandard1.0">
       <TargetFramework>netstandard1.0</TargetFramework>
       <UWPCompatible>true</UWPCompatible>
       <Imports>netstandard1.6</Imports>
     </TargetGroups>
+    <TargetGroups Include="netstandard2.1">
+      <TargetFramework>netstandard2.1</TargetFramework>
+      <!-- By default, netstandard libraries will be held to the UWP compatibility bar;
+           set this to false in the project to force otherwise. -->
+      <UWPCompatible>true</UWPCompatible>
+      <Imports>netstandard</Imports>
+    </TargetGroups>
     <!-- netstandard is an alias for netstandard2.0 -->
     <TargetGroups Include="netstandard">
       <TargetFramework>netstandard2.0</TargetFramework>
       <NETCoreAppMaximumVersion>3.0</NETCoreAppMaximumVersion>
       <TargetFramework>netcoreapp3.0</TargetFramework>
       <Imports>netcoreapp2.2</Imports>
-      <CompatibleWith>netstandard</CompatibleWith>
+      <CompatibleWith>netstandard2.1</CompatibleWith>
     </TargetGroups>
     <!-- netcoreapp is an alias for netcoreapp3.0 -->
     <TargetGroups Include="netcoreapp">
       <NETCoreAppMaximumVersion>3.0</NETCoreAppMaximumVersion>
       <TargetFramework>netcoreapp3.0</TargetFramework>
       <Imports>netcoreapp3.0</Imports>
-      <CompatibleWith>netstandard</CompatibleWith>
+      <CompatibleWith>netstandard2.1</CompatibleWith>
     </TargetGroups>
     <TargetGroups Include="net45">
       <TargetFramework>net45</TargetFramework>
diff --git a/src/libraries/Microsoft.Bcl.AsyncInterfaces/Directory.Build.props b/src/libraries/Microsoft.Bcl.AsyncInterfaces/Directory.Build.props
new file mode 100644 (file)
index 0000000..2f87c4e
--- /dev/null
@@ -0,0 +1,9 @@
+<Project>
+  <Import Project="..\Directory.Build.props" />
+  <PropertyGroup>
+    <AssemblyVersion>1.0.0.0</AssemblyVersion>
+    <PackageVersion>1.0.0</PackageVersion>
+    <StrongNameKeyId>Open</StrongNameKeyId>
+    <!-- This assembly should never be placed inbox as it is only for downlevel compatibility. -->
+  </PropertyGroup>
+</Project>
diff --git a/src/libraries/Microsoft.Bcl.AsyncInterfaces/Microsoft.Bcl.AsyncInterfaces.sln b/src/libraries/Microsoft.Bcl.AsyncInterfaces/Microsoft.Bcl.AsyncInterfaces.sln
new file mode 100644 (file)
index 0000000..7fa9037
--- /dev/null
@@ -0,0 +1,41 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.27213.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bcl.AsyncInterfaces", "src\Microsoft.Bcl.AsyncInterfaces.csproj", "{96A7CE75-B5E8-421B-BDF0-C4651D97D8CA}"
+       ProjectSection(ProjectDependencies) = postProject
+               {6371299B-8F39-4A0A-A9CD-70F80FF205F6} = {6371299B-8F39-4A0A-A9CD-70F80FF205F6}
+       EndProjectSection
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Bcl.AsyncInterfaces", "ref\Microsoft.Bcl.AsyncInterfaces.csproj", "{6371299B-8F39-4A0A-A9CD-70F80FF205F6}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E107E9C1-E893-4E87-987E-04EF0DCEAEFD}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{2E666815-2EDB-464B-9DF6-380BF4789AD4}"
+EndProject
+Global
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Any CPU = Debug|Any CPU
+               Release|Any CPU = Release|Any CPU
+       EndGlobalSection
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution
+               {96A7CE75-B5E8-421B-BDF0-C4651D97D8CA}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
+               {96A7CE75-B5E8-421B-BDF0-C4651D97D8CA}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
+               {96A7CE75-B5E8-421B-BDF0-C4651D97D8CA}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
+               {96A7CE75-B5E8-421B-BDF0-C4651D97D8CA}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
+               {6371299B-8F39-4A0A-A9CD-70F80FF205F6}.Debug|Any CPU.ActiveCfg = netstandard-Debug|Any CPU
+               {6371299B-8F39-4A0A-A9CD-70F80FF205F6}.Debug|Any CPU.Build.0 = netstandard-Debug|Any CPU
+               {6371299B-8F39-4A0A-A9CD-70F80FF205F6}.Release|Any CPU.ActiveCfg = netstandard-Release|Any CPU
+               {6371299B-8F39-4A0A-A9CD-70F80FF205F6}.Release|Any CPU.Build.0 = netstandard-Release|Any CPU
+       EndGlobalSection
+       GlobalSection(SolutionProperties) = preSolution
+               HideSolutionNode = FALSE
+       EndGlobalSection
+       GlobalSection(NestedProjects) = preSolution
+               {96A7CE75-B5E8-421B-BDF0-C4651D97D8CA} = {E107E9C1-E893-4E87-987E-04EF0DCEAEFD}
+               {6371299B-8F39-4A0A-A9CD-70F80FF205F6} = {2E666815-2EDB-464B-9DF6-380BF4789AD4}
+       EndGlobalSection
+       GlobalSection(ExtensibilityGlobals) = postSolution
+               SolutionGuid = {38217F72-3F9A-4B15-96C8-BFA23083AAD3}
+       EndGlobalSection
+EndGlobal
diff --git a/src/libraries/Microsoft.Bcl.AsyncInterfaces/pkg/Microsoft.Bcl.AsyncInterfaces.pkgproj b/src/libraries/Microsoft.Bcl.AsyncInterfaces/pkg/Microsoft.Bcl.AsyncInterfaces.pkgproj
new file mode 100644 (file)
index 0000000..3b0fbee
--- /dev/null
@@ -0,0 +1,10 @@
+<Project DefaultTargets="Build">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />
+  <ItemGroup>
+    <ProjectReference Include="..\ref\Microsoft.Bcl.AsyncInterfaces.csproj">
+      <SupportedFramework>net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
+    </ProjectReference>
+    <ProjectReference Include="..\src\Microsoft.Bcl.AsyncInterfaces.csproj" />
+  </ItemGroup>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
+</Project>
\ No newline at end of file
diff --git a/src/libraries/Microsoft.Bcl.AsyncInterfaces/ref/Configurations.props b/src/libraries/Microsoft.Bcl.AsyncInterfaces/ref/Configurations.props
new file mode 100644 (file)
index 0000000..20d2e63
--- /dev/null
@@ -0,0 +1,8 @@
+<Project DefaultTargets="Build">
+  <PropertyGroup>
+    <BuildConfigurations>
+      netstandard;
+      netstandard2.1;
+    </BuildConfigurations>
+  </PropertyGroup>
+</Project>
diff --git a/src/libraries/Microsoft.Bcl.AsyncInterfaces/ref/Microsoft.Bcl.AsyncInterfaces.Forwards.cs b/src/libraries/Microsoft.Bcl.AsyncInterfaces/ref/Microsoft.Bcl.AsyncInterfaces.Forwards.cs
new file mode 100644 (file)
index 0000000..8f737d6
--- /dev/null
@@ -0,0 +1,10 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.IAsyncDisposable))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.IAsyncEnumerable<>))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.IAsyncEnumerator<>))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.AsyncIteratorStateMachineAttribute))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.ConfiguredAsyncDisposable))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<>))]
diff --git a/src/libraries/Microsoft.Bcl.AsyncInterfaces/ref/Microsoft.Bcl.AsyncInterfaces.cs b/src/libraries/Microsoft.Bcl.AsyncInterfaces/ref/Microsoft.Bcl.AsyncInterfaces.cs
new file mode 100644 (file)
index 0000000..fefe5c5
--- /dev/null
@@ -0,0 +1,56 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+// ------------------------------------------------------------------------------
+// Changes to this file must follow the http://aka.ms/api-review process.
+// ------------------------------------------------------------------------------
+
+namespace System
+{
+    public partial interface IAsyncDisposable
+    {
+        System.Threading.Tasks.ValueTask DisposeAsync();
+    }
+}
+namespace System.Collections.Generic
+{
+    public partial interface IAsyncEnumerable<out T>
+    {
+        System.Collections.Generic.IAsyncEnumerator<T> GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
+    }
+    public partial interface IAsyncEnumerator<out T> : System.IAsyncDisposable
+    {
+        T Current { get; }
+        System.Threading.Tasks.ValueTask<bool> MoveNextAsync();
+    }
+}
+namespace System.Runtime.CompilerServices
+{
+    [System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false, AllowMultiple=false)]
+    public sealed partial class AsyncIteratorStateMachineAttribute : System.Runtime.CompilerServices.StateMachineAttribute
+    {
+        public AsyncIteratorStateMachineAttribute(System.Type stateMachineType) : base (default(System.Type)) { }
+    }
+    public readonly partial struct ConfiguredAsyncDisposable
+    {
+        private readonly object _dummy;
+        private readonly int _dummyPrimitive;
+        public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable DisposeAsync() { throw null; }
+    }
+    public readonly partial struct ConfiguredCancelableAsyncEnumerable<T>
+    {
+        private readonly object _dummy;
+        private readonly int _dummyPrimitive;
+        public System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> ConfigureAwait(bool continueOnCapturedContext) { throw null; }
+        public System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T>.Enumerator GetAsyncEnumerator() { throw null; }
+        public System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> WithCancellation(System.Threading.CancellationToken cancellationToken) { throw null; }
+        public readonly partial struct Enumerator
+        {
+            private readonly object _dummy;
+            private readonly int _dummyPrimitive;
+            public T Current { get { throw null; } }
+            public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable DisposeAsync() { throw null; }
+            public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<bool> MoveNextAsync() { throw null; }
+        }
+    }
+}
diff --git a/src/libraries/Microsoft.Bcl.AsyncInterfaces/ref/Microsoft.Bcl.AsyncInterfaces.csproj b/src/libraries/Microsoft.Bcl.AsyncInterfaces/ref/Microsoft.Bcl.AsyncInterfaces.csproj
new file mode 100644 (file)
index 0000000..3c58faf
--- /dev/null
@@ -0,0 +1,17 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <ProjectGuid>{6371299B-8F39-4A0A-A9CD-70F80FF205F6}</ProjectGuid>
+    <Configurations>netstandard-Debug;netstandard-Release;netstandard2.1-Debug;netstandard2.1-Release</Configurations>
+  </PropertyGroup>
+  <ItemGroup Condition="'$(TargetGroup)' == 'netstandard'">
+    <Compile Include="Microsoft.Bcl.AsyncInterfaces.cs" />
+    <Reference Include="System.Threading.Tasks.Extensions" />
+  </ItemGroup>
+  <ItemGroup Condition="'$(TargetGroup)' != 'netstandard'">
+    <Compile Include="Microsoft.Bcl.AsyncInterfaces.Forwards.cs" />
+  </ItemGroup>
+  <ItemGroup Condition="'$(TargetGroup)' == 'netstandard'">
+    <Reference Include="System.Runtime" />
+    <Reference Include="System.Threading.Tasks" />
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/src/libraries/Microsoft.Bcl.AsyncInterfaces/src/Configurations.props b/src/libraries/Microsoft.Bcl.AsyncInterfaces/src/Configurations.props
new file mode 100644 (file)
index 0000000..20d2e63
--- /dev/null
@@ -0,0 +1,8 @@
+<Project DefaultTargets="Build">
+  <PropertyGroup>
+    <BuildConfigurations>
+      netstandard;
+      netstandard2.1;
+    </BuildConfigurations>
+  </PropertyGroup>
+</Project>
diff --git a/src/libraries/Microsoft.Bcl.AsyncInterfaces/src/Microsoft.Bcl.AsyncInterfaces.csproj b/src/libraries/Microsoft.Bcl.AsyncInterfaces/src/Microsoft.Bcl.AsyncInterfaces.csproj
new file mode 100644 (file)
index 0000000..2e98b39
--- /dev/null
@@ -0,0 +1,32 @@
+<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="Current">
+  <PropertyGroup>
+    <ProjectGuid>{96A7CE75-B5E8-421B-BDF0-C4651D97D8CA}</ProjectGuid>
+    <Configurations>netstandard-Debug;netstandard-Release;netstandard2.1-Debug;netstandard2.1-Release</Configurations>
+    <IsPartialFacadeAssembly Condition="'$(TargetGroup)' != 'netstandard'">true</IsPartialFacadeAssembly>
+  </PropertyGroup>
+  <ItemGroup Condition="'$(IsPartialFacadeAssembly)' != 'true'">
+    <Compile Include="$(CommonPath)\CoreLib\System\Collections\Generic\IAsyncEnumerable.cs">
+      <Link>ProductionCode\Common\CoreLib\System\Collections\Generic\IAsyncEnumerable.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\CoreLib\System\Collections\Generic\IAsyncEnumerator.cs">
+      <Link>ProductionCode\Common\CoreLib\System\Collections\Generic\IAsyncEnumerator.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\CoreLib\System\IAsyncDisposable.cs">
+      <Link>ProductionCode\Common\CoreLib\System\IAsyncDisposable.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\CoreLib\System\Runtime\CompilerServices\AsyncIteratorStateMachineAttribute.cs">
+      <Link>ProductionCode\Common\CoreLib\System\Runtime\CompilerServices\AsyncIteratorStateMachineAttribute.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\CoreLib\System\Runtime\CompilerServices\ConfiguredAsyncDisposable.cs">
+      <Link>ProductionCode\Common\CoreLib\System\Runtime\CompilerServices\ConfiguredAsyncDisposable.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\CoreLib\System\Runtime\CompilerServices\ConfiguredCancelableAsyncEnumerable.cs">
+      <Link>ProductionCode\Common\CoreLib\System\Runtime\CompilerServices\ConfiguredCancelableAsyncEnumerable.cs</Link>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup Condition="'$(TargetGroup)' == 'netstandard'">
+    <Reference Include="System.Runtime" />
+    <Reference Include="System.Threading.Tasks.Extensions" />
+    <Reference Include="System.Threading.Tasks" />
+  </ItemGroup>
+</Project>
\ No newline at end of file
index cb66cb63d64cf31c456b46852879c167671d7279..fb47f507dfb8fe2612c0b65999c07c58f4aa9d00 100644 (file)
         "net45": "4.0.0.0"
       }
     },
+    "Microsoft.Bcl.AsyncInterfaces": {
+      "InboxOn": {},
+      "AssemblyVersionInPackageVersion": {
+        "1.0.0.0": "1.0.0"
+      }
+    },
     "Microsoft.Bcl.Json.Sources": {
       "InboxOn": {}
     },
         "netcoreapp3.0": "2.1.0.0",
         "net461": "2.0.0.0",
         "netstandard2.0": "2.0.0.0",
+        "netstandard2.1": "2.1.0.0",
         "uap10.0.16299": "2.0.0.0",
         "uap10.0.16300": "2.1.0.0"
       }
       "System.Xml.XDocument"
     ]
   }
-}
+}
\ No newline at end of file
index 82e2bda1a8927893d2f82a63a5313418a0c7e7e1..440c24ef46edee6df6151618a5f5ac80dc9e0ac0 100644 (file)
         "System.Buffers.Text.Utf8Formatter"
     ]
   },
+  {
+    "Name": "Microsoft.Bcl.AsyncInterfaces",
+    "Description": "Provides the IAsyncEnumerable<T> and IAsyncDisposable interfaces and helper types for .NET Standard 2.0. This package is not required starting with .NET Standard 2.1 and .NET Core 3.0.",
+    "CommonTypes": [
+      "System.IAsyncDisposable",
+      "System.Collections.Generic.IAsyncEnumerable",
+      "System.Collections.Generic.IAsyncEnumerator"
+    ]
+  },
   {
     "Name": "System.Net.Http",
     "Description": "Provides a programming interface for modern HTTP applications, including HTTP client components that allow applications to consume web services over HTTP and HTTP components that can be used by both clients and servers for parsing HTTP headers.",