Skip to content

Commit df75c21

Browse files
author
Oren Novotny
authored
Merge pull request #900 from dotnet/use-bcl-iae
Use Microsoft.Bcl.AsyncInterfaces for net461 and netstandard2.0
2 parents 641a751 + ca93b96 commit df75c21

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+201
-883
lines changed

Ix.NET/Source/Directory.build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<DebugType Condition="'$(Configuration)' != 'Debug'">embedded</DebugType>
1717
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1818
<PublishRepositoryUrl>true</PublishRepositoryUrl>
19-
<!-- While in beta, we need to set 8.0 manually (rather than latest). -->
20-
<LangVersion>8.0</LangVersion>
19+
<!-- While in beta, we need to set preview for 8.0 manually (rather than latest). -->
20+
<LangVersion>preview</LangVersion>
2121
</PropertyGroup>
2222

2323
<ItemGroup>

Ix.NET/Source/Directory.build.targets

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PropertyGroup Condition="'$(TargetFramework)' == 'net45'">
1111
<DefineConstants>$(DefineConstants);NO_ARRAY_EMPTY;NO_TASK_FROMEXCEPTION</DefineConstants>
1212
</PropertyGroup>
13-
<PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
13+
<PropertyGroup Condition="'$(TargetFramework)' == 'net46' or '$(TargetFramework)' == 'net461'">
1414
<DefineConstants>$(DefineConstants);USE_ASYNC_ITERATOR</DefineConstants>
1515
</PropertyGroup>
1616
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0' or '$(TargetFramework)' == 'netstandard2.1'">
@@ -21,11 +21,6 @@
2121
<Product>$(AssemblyName) ($(TargetFramework))</Product>
2222
</PropertyGroup>
2323

24-
<ItemGroup>
25-
<!-- Workaround https://github.com/dotnet/sdk/issues/2976 -->
26-
<PackageReference Update="Microsoft.NETCore.Platforms" PrivateAssets="All" />
27-
</ItemGroup>
28-
2924
<PropertyGroup Condition="'$(IsTestProject)' == 'true'">
3025
<UseSourceLink>true</UseSourceLink>
3126
<CoverletOutputFormat>cobertura</CoverletOutputFormat>

Ix.NET/Source/NuGet.config

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
5+
<add key="dotnet-windowsdesktop" value="https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json" />
6+
<add key="aspnet-aspnetcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json" />
7+
<add key="aspnet-aspnetcore-tooling" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json" />
8+
<add key="aspnet-entityframeworkcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json" />
9+
<add key="aspnet-extensions" value="https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json" />
10+
</packageSources>
11+
</configuration>

Ix.NET/Source/System.Interactive.Async.Providers/System.Interactive.Async.Providers.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<Description>Interactive Extensions Async Providers Library used to build query providers and express queries over async enumerable sequences.</Description>
55
<AssemblyTitle>Interactive Extensions - Async Providers Library</AssemblyTitle>
6-
<TargetFrameworks>net45;net46;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
6+
<TargetFrameworks>net461;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
77
<PackageTags>Ix;Interactive;Extensions;Enumerable;Asynchronous</PackageTags>
88
</PropertyGroup>
99

Ix.NET/Source/System.Interactive.Async/System.Interactive.Async.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<Description>Interactive Extensions Async Library used to express queries over asynchronous enumerable sequences.</Description>
55
<AssemblyTitle>Interactive Extensions - Async Library</AssemblyTitle>
6-
<TargetFrameworks>net45;net46;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
6+
<TargetFrameworks>net461;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
77
<PackageTags>Ix;Interactive;Extensions;Enumerable;Asynchronous</PackageTags>
88
</PropertyGroup>
99

Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Amb.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
9494
}
9595

9696
try
97-
{
98-
await using (AsyncEnumerableExtensions.ConfigureAwait(winner, false))
97+
{
98+
await using (winner.ConfigureAwait(false))
9999
{
100100
if (!await moveNextWinner.ConfigureAwait(false))
101101
{
@@ -204,7 +204,7 @@ async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
204204

205205
try
206206
{
207-
await using (AsyncEnumerableExtensions.ConfigureAwait(winner, false))
207+
await using (winner.ConfigureAwait(false))
208208
{
209209
if (!await moveNextWinner.ConfigureAwait(false))
210210
{
@@ -246,7 +246,7 @@ private static async Task AwaitMoveNextAsyncAndDispose<T>(Task<bool> moveNextAsy
246246
{
247247
if (enumerator != null)
248248
{
249-
await using (AsyncEnumerableExtensions.ConfigureAwait(enumerator, false))
249+
await using (enumerator.ConfigureAwait(false))
250250
{
251251
if (moveNextAsync != null)
252252
{

Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Buffer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async IAsyncEnumerator<IList<TSource>> Core(CancellationToken cancellationToken)
2525
{
2626
var buffer = new List<TSource>(count);
2727

28-
await foreach (var item in AsyncEnumerableExtensions.WithCancellation(source, cancellationToken).ConfigureAwait(false))
28+
await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
2929
{
3030
buffer.Add(item);
3131

@@ -65,7 +65,7 @@ async IAsyncEnumerator<IList<TSource>> Core(CancellationToken cancellationToken)
6565

6666
var index = 0;
6767

68-
await foreach (var item in AsyncEnumerableExtensions.WithCancellation(source, cancellationToken).ConfigureAwait(false))
68+
await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
6969
{
7070
if (index++ % skip == 0)
7171
{

Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Catch.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
6464

6565
if (err != null)
6666
{
67-
await foreach (var item in AsyncEnumerableExtensions.WithCancellation(err, cancellationToken).ConfigureAwait(false))
67+
await foreach (var item in err.WithCancellation(cancellationToken).ConfigureAwait(false))
6868
{
6969
yield return item;
7070
}
@@ -122,7 +122,7 @@ async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
122122

123123
if (err != null)
124124
{
125-
await foreach (var item in AsyncEnumerableExtensions.WithCancellation(err, cancellationToken).ConfigureAwait(false))
125+
await foreach (var item in err.WithCancellation(cancellationToken).ConfigureAwait(false))
126126
{
127127
yield return item;
128128
}
@@ -181,7 +181,7 @@ async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
181181

182182
if (err != null)
183183
{
184-
await foreach (var item in AsyncEnumerableExtensions.WithCancellation(err, cancellationToken).ConfigureAwait(false))
184+
await foreach (var item in err.WithCancellation(cancellationToken).ConfigureAwait(false))
185185
{
186186
yield return item;
187187
}

Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Concat.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public static IAsyncEnumerable<TSource> Concat<TSource>(this IAsyncEnumerable<IA
2121

2222
async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
2323
{
24-
await foreach (var source in AsyncEnumerableExtensions.WithCancellation(sources, cancellationToken).ConfigureAwait(false))
24+
await foreach (var source in sources.WithCancellation(cancellationToken).ConfigureAwait(false))
2525
{
26-
await foreach (var item in AsyncEnumerableExtensions.WithCancellation(source, cancellationToken).ConfigureAwait(false))
26+
await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
2727
{
2828
yield return item;
2929
}
@@ -46,7 +46,7 @@ async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
4646
{
4747
foreach (var source in sources)
4848
{
49-
await foreach (var item in AsyncEnumerableExtensions.WithCancellation(source, cancellationToken).ConfigureAwait(false))
49+
await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
5050
{
5151
yield return item;
5252
}
@@ -69,7 +69,7 @@ async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
6969
{
7070
foreach (var source in sources)
7171
{
72-
await foreach (var item in AsyncEnumerableExtensions.WithCancellation(source, cancellationToken).ConfigureAwait(false))
72+
await foreach (var item in source.WithCancellation(cancellationToken).ConfigureAwait(false))
7373
{
7474
yield return item;
7575
}

Ix.NET/Source/System.Interactive.Async/System/Linq/Operators/Defer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static IAsyncEnumerable<TSource> Defer<TSource>(Func<IAsyncEnumerable<TSo
2121

2222
async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
2323
{
24-
await foreach (var item in AsyncEnumerableExtensions.WithCancellation(factory(), cancellationToken).ConfigureAwait(false))
24+
await foreach (var item in factory().WithCancellation(cancellationToken).ConfigureAwait(false))
2525
{
2626
yield return item;
2727
}
@@ -41,7 +41,7 @@ public static IAsyncEnumerable<TSource> Defer<TSource>(Func<Task<IAsyncEnumerabl
4141

4242
async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
4343
{
44-
await foreach (var item in AsyncEnumerableExtensions.WithCancellation((await factory().ConfigureAwait(false)), cancellationToken).ConfigureAwait(false))
44+
await foreach (var item in (await factory().ConfigureAwait(false)).WithCancellation(cancellationToken).ConfigureAwait(false))
4545
{
4646
yield return item;
4747
}
@@ -62,7 +62,7 @@ public static IAsyncEnumerable<TSource> Defer<TSource>(Func<CancellationToken, T
6262

6363
async IAsyncEnumerator<TSource> Core(CancellationToken cancellationToken)
6464
{
65-
await foreach (var item in AsyncEnumerableExtensions.WithCancellation((await factory(cancellationToken).ConfigureAwait(false)), cancellationToken).ConfigureAwait(false))
65+
await foreach (var item in (await factory(cancellationToken).ConfigureAwait(false)).WithCancellation(cancellationToken).ConfigureAwait(false))
6666
{
6767
yield return item;
6868
}

0 commit comments

Comments
 (0)