Skip to content

Commit

Permalink
Merge branch 'master' into simplify-first-last-blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
akarnokd committed Nov 14, 2019
2 parents 0cf3ffc + 5747c1c commit ce352c8
Show file tree
Hide file tree
Showing 285 changed files with 4,424 additions and 15,110 deletions.
8 changes: 0 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,3 @@ csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false








4 changes: 0 additions & 4 deletions .github/release-drafter.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static (IAsyncObserver<TSource>, IAsyncDisposable) Throttle<TSource>(IAsy
hasValue = false;
}
}
}).ConfigureAwait(false);
}, dueTime).ConfigureAwait(false);
await d.AssignAsync(t).ConfigureAwait(false);
},
async ex =>
Expand Down
12 changes: 8 additions & 4 deletions Ix.NET/Source/AsyncQueryableGenerator.t4
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ return name;

var toQuoted = new Func<Type, int, string>((t, i) => toQuotedImpl(t, i, true));
#>
#nullable enable

using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
Expand Down Expand Up @@ -154,7 +156,7 @@ foreach (var m in asyncEnumerableType.GetMethods()
}
}

var pars = string.Join(", ", m.GetParameters().Select((p, i) => (i == parCount - 1 && isParams ? "params " : "") + toQuoted(p.ParameterType, i) + " " + p.Name + (i == parCount - 1 && lastParameterDefault ? " = default" : "")));
var pars = string.Join(", ", m.GetParameters().Select((p, i) => (i == parCount - 1 && isParams ? "params " : "") + toQuoted(p.ParameterType, i) + (nullableParameterNames.Contains(p.Name) ? "?" : "") + " " + p.Name + (i == parCount - 1 && lastParameterDefault ? " = default" : "")));
var quotedPars = string.Join(", ", m.GetParameters().Select((p, i) => "default(" + toQuoted(p.ParameterType, i) + ")"));

if (m.IsDefined(typeof(System.Runtime.CompilerServices.ExtensionAttribute), true))
Expand All @@ -172,7 +174,7 @@ foreach (var m in asyncEnumerableType.GetMethods()
{
infoName += "__" + string.Join("_", genArgs.Select(a => a.Name));
infoTypeArgs = "(" + string.Join(", ", genArgs.Select(a => "Type " + a.Name)) + ")";
infoToGeneric = ".GetGenericMethodDefinition()";
infoToGeneric = "!.GetGenericMethodDefinition()";
infoMakeGeneric = ".MakeGenericMethod(" + string.Join(", ", genArgs.Select(a => a.Name)) + ")";
infoGenArgs = "<" + string.Join(", ", genArgs.Select(_ => "object")) + ">";
}
Expand Down Expand Up @@ -279,14 +281,16 @@ foreach (var m in asyncEnumerableType.GetMethods()
}

var expr = "Expression.Call(" + mtd + ", " + string.Join(", ", quotedArgs) + ")";

var cons = name.StartsWith("ToDictionary") ? " where TKey : notnull" : "";
#>
private static MethodInfo s_<#=infoName#>;
private static MethodInfo? s_<#=infoName#>;

private static MethodInfo <#=infoName#><#=infoTypeArgs#> =>
(s_<#=infoName#> ??
(s_<#=infoName#> = new Func<<#=infoSignature#>>(<#=m.Name#><#=infoGenArgs#>).GetMethodInfo()<#=infoToGeneric#>))<#=infoMakeGeneric#>;

public static <#=ret#> <#=name#>(<#=pars#>)
public static <#=ret#> <#=name#>(<#=pars#>)<#=cons#>
{
<#
var any = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.11.5" />
<PackageReference Include="BenchmarkDotNet" Version="0.12.0" />
</ItemGroup>

<ItemGroup Condition="'$(Configuration)|$(Platform)'=='Ix.net 3.1.1|AnyCPU'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
Expand All @@ -15,7 +14,7 @@ public class BufferCountBenchmark
{
[Params(1, 10, 100, 1000, 10000, 100000, 1000000)]
public int N;
private IList<int> _store;
private IList<int>? _store;

[Benchmark]
public void Exact()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
Expand All @@ -18,8 +17,8 @@ public class IgnoreElementsBenchmark

private int _store;

private int[] _array;
private List<int> _list;
private int[]? _array;
private List<int>? _list;

[Benchmark]
public void Ignore()
Expand All @@ -32,15 +31,15 @@ public void Ignore()
[Benchmark]
public void IgnoreList()
{
_list
_list!
.IgnoreElements()
.Subscribe(v => Volatile.Write(ref _store, v));
}

[Benchmark]
public void IgnoreArray()
{
_array
_array!
.IgnoreElements()
.Subscribe(v => Volatile.Write(ref _store, v));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
Expand All @@ -16,7 +15,7 @@ public class MinMaxBenchmark
[Params(1, 10, 100, 1000, 10000, 100000, 1000000)]
public int N;
private int _store;
private IList<int> _listStore;
private IList<int>? _listStore;

private readonly IComparer<int> _comparer = Comparer<int>.Default;

Expand Down
2 changes: 1 addition & 1 deletion Ix.NET/Source/Benchmarks.System.Interactive/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Benchmarks.System.Interactive
{
internal class Program
{
internal static void Main(string[] args)
internal static void Main()
{
Console.WriteLine("Effective Ix-version: " + typeof(EnumerableEx).Assembly.GetName().Version);

Expand Down
32 changes: 7 additions & 25 deletions Ix.NET/Source/CodeCoverage.runsettings
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,15 @@
<!-- File name extension must be .runsettings -->
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<DataCollectors>
<DataCollector friendlyName="XPlat code coverage">
<Configuration>
<CodeCoverage>

<!--
About include/exclude lists:
Empty "Include" clauses imply all; empty "Exclude" clauses imply none.
Each element in the list is a regular expression (ECMAScript syntax). See http://msdn.microsoft.com/library/2k3te2cs.aspx.
An item must first match at least one entry in the include list to be included.
Included items must then not match any entries in the exclude list to remain included.
-->

<!-- Match assembly file paths: -->
<ModulePaths>
<Include>
<ModulePath>.*Interactive.*</ModulePath>
<ModulePath>.*System.Linq.Async.dll$</ModulePath>
</Include>
<Exclude>
<ModulePath>.*Tests.dll$</ModulePath>
</Exclude>
</ModulePaths>

</CodeCoverage>
<Format>cobertura</Format>
<Exclude>[xunit.*]*,[*Tests]*</Exclude> <!-- [Assembly-Filter]Type-Filter -->
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>
<SingleHit>false</SingleHit>
</Configuration>
</DataCollector>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
13 changes: 8 additions & 5 deletions Ix.NET/Source/Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@
<DebugType Condition="'$(Configuration)' != 'Debug'">embedded</DebugType>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- While in beta, we need to set 8.0 manually (rather than latest). -->
<LangVersion>8.0</LangVersion>
<!-- While in beta, we need to set preview for 8.0 manually (rather than latest). -->
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All"/>
<PackageReference Include="Nerdbank.GitVersioning" Version="2.3.138" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-19554-01" PrivateAssets="All"/>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.0.26" PrivateAssets="all" />
</ItemGroup>


<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<PackageReference Include="coverlet.msbuild" Version="2.5.1" />
<PackageReference Include="coverlet.collector" Version="1.1.0" />
</ItemGroup>


<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition=" '$(SourceRevisionId)' != '' ">
Expand Down
17 changes: 2 additions & 15 deletions Ix.NET/Source/Directory.build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,15 @@
<PropertyGroup Condition="'$(TargetFramework)' == 'net45'">
<DefineConstants>$(DefineConstants);NO_ARRAY_EMPTY;NO_TASK_FROMEXCEPTION</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net46' or '$(TargetFramework)' == 'net461'">
<DefineConstants>$(DefineConstants);USE_ASYNC_ITERATOR</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0' or '$(TargetFramework)' == 'netstandard2.1'">
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0' or '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>$(DefineConstants);USE_ASYNC_ITERATOR;HAS_ASYNCENUMERABLE;HAS_ASYNCDISPOSABLE;BCL_HAS_CONFIGUREAWAIT;HAS_VALUETUPLE</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
</PropertyGroup>

<ItemGroup>
<!-- Workaround https://github.com/dotnet/sdk/issues/2976 -->
<PackageReference Update="Microsoft.NETCore.Platforms" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup Condition="'$(IsTestProject)' == 'true'">
<UseSourceLink>true</UseSourceLink>
<CoverletOutputFormat>cobertura</CoverletOutputFormat>
<Exclude>[xunit.*]*</Exclude>
<CoverletOutput>$(MSBuildThisFileDirectory)coverlet/raw/$(AssemblyName)/$(TargetFramework)/</CoverletOutput>
<CollectCoverage Condition="'$(TF_BUILD)' == 'true'">true</CollectCoverage>
</PropertyGroup>

</Project>
4 changes: 3 additions & 1 deletion Ix.NET/Source/FasterLinq/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

#nullable disable

using System;
using System.Collections;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal static void SucceedOrFailProper(Action action)
}
catch (AggregateException ex)
{
var inner = ex.Flatten().InnerException;
_ = ex.Flatten().InnerException;

// TODO: proper assert; unfortunately there's not always a good call stack
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<NoWarn>$(NoWarn);CS0618</NoWarn>
</PropertyGroup>


<ItemGroup>
<Content Include="xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand All @@ -18,13 +17,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.6.0" />

<PackageReference Include="FluentAssertions" Version="5.9.0" />
<PackageReference Include="xunit" Version="2.4.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Description>Interactive Extensions Async Providers Library used to build query providers and express queries over async enumerable sequences.</Description>
<AssemblyTitle>Interactive Extensions - Async Providers Library</AssemblyTitle>
<TargetFrameworks>net45;net46;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
<TargetFrameworks>net461;netstandard2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
<PackageTags>Ix;Interactive;Extensions;Enumerable;Asynchronous</PackageTags>
</PropertyGroup>

Expand Down

0 comments on commit ce352c8

Please sign in to comment.