Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Adding Microsoft.Bcl.AsyncInterfaces for .NET Standard 2.0 #37189

Merged
merged 6 commits into from
May 1, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions eng/configurations/targetgroups.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@
<PackageTargetRuntimeSuffix>aot</PackageTargetRuntimeSuffix>
<UWPCompatible>true</UWPCompatible>
<Imports>uap10.0.16299aot</Imports>
<CompatibleWith>uapvnext;netstandard2.0</CompatibleWith>
<CompatibleWith>uapvnext;netstandard2.1</CompatibleWith>
joperezr marked this conversation as resolved.
Show resolved Hide resolved
</TargetGroups>
<TargetGroups Include="uapvnext">
<TargetFramework>$(UAPvNextTFM)</TargetFramework>
<TargetFrameworkIdentifier>$(UAPvNextTFI)</TargetFrameworkIdentifier>
<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">
Expand All @@ -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">
Expand All @@ -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>
Expand Down Expand Up @@ -126,6 +126,13 @@
<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>
Expand Down Expand Up @@ -157,14 +164,14 @@
<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>
Expand Down
15 changes: 11 additions & 4 deletions pkg/Microsoft.Private.PackageBaseline/packageIndex.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@
"net45": "4.0.0.0"
}
},
"Microsoft.Compatibility.AsyncInterfaces": {
"InboxOn": {},
"AssemblyVersionInPackageVersion": {
"4.0.0.0": "4.6.0"
}
},
"Microsoft.CSharp": {
"StableVersions": [
"4.0.1",
Expand Down Expand Up @@ -427,6 +433,7 @@
"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"
}
Expand Down Expand Up @@ -1232,8 +1239,8 @@
],
"BaselineVersion": "4.5.0",
"InboxOn": {
"net45": "4.0.0.0",
"netcoreapp3.0": "4.0.0.0",
"net45": "4.0.0.0",
"uap10.0.16300": "4.0.0.0"
},
"AssemblyVersionInPackageVersion": {
Expand Down Expand Up @@ -3723,8 +3730,8 @@
],
"BaselineVersion": "4.5.1",
"InboxOn": {
"uap10.0.16300": "4.0.5.0",
"netcoreapp3.0": "4.0.5.0"
"netcoreapp3.0": "4.0.5.0",
"uap10.0.16300": "4.0.5.0"
},
"AssemblyVersionInPackageVersion": {
"4.0.3.0": "4.4.0",
Expand Down Expand Up @@ -5939,4 +5946,4 @@
"System.Xml.XDocument"
]
}
}
}
9 changes: 9 additions & 0 deletions pkg/descriptions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,15 @@
"System.Buffers.Text.Utf8Formatter"
]
},
{
"Name": "Microsoft.Compatibility.AsyncInterfaces",
"Description": "Provides interfaces and helper types for consuming and producing async enumerables on .NET Standard 2.0. This package is not required when targeting .NET Standard 2.1 or .NET CoreApp 3.0 as they already have support for these types inbox.",
joperezr marked this conversation as resolved.
Show resolved Hide resolved
joperezr marked this conversation as resolved.
Show resolved Hide resolved
"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.",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>Open</StrongNameKeyId>
<!-- This assembly should never be placed inbox as it is only for downlevel compatibility. -->
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project DefaultTargets="Build">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.props))\Directory.Build.props" />
<ItemGroup>
<ProjectReference Include="..\ref\Microsoft.Compatibility.AsyncInterfaces.csproj">
<SupportedFramework>net461;netcoreapp2.0;uap10.0.16299;$(AllXamarinFrameworks)</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\Microsoft.Compatibility.AsyncInterfaces.csproj" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project DefaultTargets="Build">
<PropertyGroup>
<BuildConfigurations>
netstandard;
netstandard2.1;
netcoreapp;
uap;
</BuildConfigurations>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -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<>))]
joperezr marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -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; }
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{6371299B-8F39-4A0A-A9CD-70F80FF205F6}</ProjectGuid>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;netstandard2.1-Debug;netstandard2.1-Release;uap-Debug;uap-Release</Configurations>
</PropertyGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard'">
<Compile Include="Microsoft.Compatibility.AsyncInterfaces.cs" />
<Reference Include="System.Threading.Tasks.Extensions" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' != 'netstandard'">
<Compile Include="Microsoft.Compatibility.AsyncInterfaces.Forwards.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard' or '$(TargetGroup)' == 'netstandard2.1'">
<Reference Include="System.Runtime" />
<Reference Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'uap' or '$(TargetGroup)' == 'netcoreapp'">
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Threading.Tasks\ref\System.Threading.Tasks.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project DefaultTargets="Build">
<PropertyGroup>
<BuildConfigurations>
netstandard;
netstandard2.1;
netcoreapp;
uap-Windows_NT;
</BuildConfigurations>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="Current">
<PropertyGroup>
<ProjectGuid>{96A7CE75-B5E8-421B-BDF0-C4651D97D8CA}</ProjectGuid>
<Configurations>netcoreapp-Debug;netcoreapp-Release;netstandard-Debug;netstandard-Release;netstandard2.1-Debug;netstandard2.1-Release;uap-Windows_NT-Debug;uap-Windows_NT-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>
<Reference Include="System.Runtime" />
<Reference Condition="'$(TargetGroup)' == 'netstandard'" Include="System.Threading.Tasks.Extensions" />
<Reference Include="System.Threading.Tasks" />
</ItemGroup>
</Project>