Skip to content

Commit bcf4740

Browse files
authored
Merge pull request #871 from polyadic/add-dotnet10
Compile Funcky in .NET10
2 parents a1f80fd + 974a9f9 commit bcf4740

File tree

15 files changed

+33
-14
lines changed

15 files changed

+33
-14
lines changed

FrameworkFeatureConstants.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,7 @@
2121
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net9.0'))">
2222
<DefineConstants>$(DefineConstants);REFLECTION_ASSEMBLY_NAME_INFO;REFLECTION_TYPE_NAME;ORDERED_DICTIONARY</DefineConstants>
2323
</PropertyGroup>
24+
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net10.0'))">
25+
<DefineConstants>$(DefineConstants);SHUFFLE_EXTENSION;INTEGRATED_ASYNC</DefineConstants>
26+
</PropertyGroup>
2427
</Project>

Funcky.Analyzers/Funcky.Analyzers.Test/Funcky.Analyzers.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55

66
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
77
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

Funcky.Async.Test/Funcky.Async.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>net9.0;net8.0;net7.0</TargetFrameworks>
44
<LangVersion>preview</LangVersion>

Funcky.Async/Funcky.Async.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<ItemGroup>
4747
<PackageReference Include="PolySharp" PrivateAssets="all" />
4848
<PackageReference Include="Polyadic.Build.SemanticVersioning" PrivateAssets="all" />
49-
<PackageReference Include="System.Linq.Async" />
49+
<PackageReference Include="System.Linq.Async" Condition="'$(TargetFramework)' != 'net10.0'" />
5050
</ItemGroup>
5151
<ItemGroup>
5252
<ProjectReference Include="..\Funcky\Funcky.csproj" />

Funcky.SourceGenerator.Test/Funcky.SourceGenerator.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<AssemblyName>Funcky.SourceGenerator.Test</AssemblyName>
55
<RootNamespace>Funcky.SourceGenerator.Test</RootNamespace>
6-
<TargetFramework>net9.0</TargetFramework>
6+
<TargetFramework>net10.0</TargetFramework>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
99
<LangVersion>preview</LangVersion>

Funcky.Test/Extensions/EnumerableExtensions/ShuffleTest.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
using FsCheck;
22
using FsCheck.Fluent;
33
using FsCheck.Xunit;
4+
#if !SHUFFLE_EXTENSION
45
using Funcky.Test.TestUtils;
56
using Xunit.Sdk;
7+
#endif
68

79
namespace Funcky.Test.Extensions.EnumerableExtensions;
810

911
public sealed class ShuffleTest
1012
{
13+
#if !SHUFFLE_EXTENSION
1114
[Fact]
1215
public void AShuffleIsEnumeratedEagerly()
1316
{
1417
var doNotEnumerate = new FailOnEnumerationSequence<object>();
1518

1619
Assert.Throws<XunitException>(() => doNotEnumerate.Shuffle());
1720
}
21+
#endif
1822

1923
[Fact]
2024
public void AShuffleWithASpecificRandomDistributionAlwaysReturnsTheSameShuffle()
2125
{
2226
var source = Enumerable.Range(0, 16);
2327

24-
Assert.Equal(Sequence.Return(3, 2, 6, 15, 14, 0, 5, 8, 11, 7, 9, 12, 1, 13, 10, 4), source.Shuffle(new System.Random(1337)));
28+
Assert.Equal(Sequence.Return(3, 2, 6, 15, 14, 0, 5, 8, 11, 7, 9, 12, 1, 13, 10, 4), source.Shuffle(new Random(1337)));
2529
}
2630

2731
[Property]
@@ -33,6 +37,6 @@ public Property AShuffleHasTheSameElementsAsTheSource(List<int> source)
3337

3438
[Property]
3539
public Property AShuffleHasTheSameLengthAsTheSource(List<int> source)
36-
=> (source.Shuffle().Count == source.Count)
40+
=> (source.Shuffle().Count() == source.Count)
3741
.ToProperty();
3842
}

Funcky.Test/Funcky.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0</TargetFrameworks>
3+
<TargetFrameworks>net10.0;net9.0;net8.0;net7.0;net6.0</TargetFrameworks>
44
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net4.8</TargetFrameworks>
55
<LangVersion>preview</LangVersion>
66
<Nullable>enable</Nullable>

Funcky.Xunit.Test/Funcky.Xunit.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net9.0</TargetFramework>
3+
<TargetFramework>net10.0</TargetFramework>
44
<LangVersion>preview</LangVersion>
55
<Nullable>enable</Nullable>
66
<IsPackable>false</IsPackable>

Funcky.Xunit.v3.Test/Funcky.Xunit.v3.Test.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net9.0</TargetFramework>
3+
<TargetFramework>net10.0</TargetFramework>
44
<LangVersion>preview</LangVersion>
55
<Nullable>enable</Nullable>
66
<IsPackable>false</IsPackable>

Funcky/CompatibilitySuppressions.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
<Left>lib/net5.0/Funcky.dll</Left>
88
<Right>lib/net6.0/Funcky.dll</Right>
99
</Suppression>
10+
<Suppression>
11+
<DiagnosticId>CP0002</DiagnosticId>
12+
<Target>M:Funcky.Extensions.EnumerableExtensions.Shuffle``1(System.Collections.Generic.IEnumerable{``0})</Target>
13+
<Left>lib/net9.0/Funcky.dll</Left>
14+
<Right>lib/net10.0/Funcky.dll</Right>
15+
</Suppression>
1016
<Suppression>
1117
<DiagnosticId>CP0021</DiagnosticId>
1218
<Target>M:Funcky.Extensions.DictionaryExtensions.GetValueOrNone``2(System.Collections.Generic.IDictionary{``0,``1},``0)``0:notnull</Target>

0 commit comments

Comments
 (0)