diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index 674b0f90..c62a77c6 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -45,6 +45,12 @@ jobs: with: dotnet-version: 5.0.* + - name: Setup .NET 6.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.* + include-prerelease: true + - name: Cache .nuke/temp, ~/.nuget/packages uses: actions/cache@v2 with: diff --git a/.github/workflows/continuousCore.yml b/.github/workflows/continuousCore.yml index bfe4a242..578b0867 100644 --- a/.github/workflows/continuousCore.yml +++ b/.github/workflows/continuousCore.yml @@ -45,6 +45,12 @@ jobs: with: dotnet-version: 5.0.* + - name: Setup .NET 6.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.* + include-prerelease: true + - name: Cache .nuke/temp, ~/.nuget/packages uses: actions/cache@v2 with: @@ -86,6 +92,12 @@ jobs: with: dotnet-version: 5.0.* + - name: Setup .NET 6.0 + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.* + include-prerelease: true + - name: Cache .nuke/temp, ~/.nuget/packages uses: actions/cache@v2 with: diff --git a/Build/Nuke/NukeBuild.csproj b/Build/Nuke/NukeBuild.csproj index ae63f921..c6a2e7d6 100644 --- a/Build/Nuke/NukeBuild.csproj +++ b/Build/Nuke/NukeBuild.csproj @@ -2,7 +2,7 @@ Exe - net5.0 + net6.0 CS0649;CS0169 false ..\.. diff --git a/Build/Nuke/ProjectExtensions.cs b/Build/Nuke/ProjectExtensions.cs index 21cda71c..4c4d19a3 100644 --- a/Build/Nuke/ProjectExtensions.cs +++ b/Build/Nuke/ProjectExtensions.cs @@ -11,7 +11,7 @@ public static IReadOnlyCollection GetTargetFrameworks(this Project proje var frameworks = project.GetTargetFrameworks(); if (!excludeNetFramework) return frameworks.ToList(); - return frameworks.Where(x => x.Contains("standard") || x.Contains("core") || x.Contains("net50")).ToList(); + return frameworks.Where(x => x.Contains("standard") || x.Contains("core") || x.Contains("net50") || x.Contains("net60")).ToList(); } public static IReadOnlyCollection GetPlatforms(this Project project) @@ -50,7 +50,7 @@ public static IReadOnlyCollection GetPlatformsForTests(this Project proj if (azurePipelines != null && x.framework.Contains("2.2")) return false; - //exclude netcore 2.1 and 2.2 in x86 because is not well handle by azure pipelines and github actions on windows + //exclude netcore 2.1, 2.2, 60 in x86 because is not well handle by azure pipelines and github actions on windows if (x.platform != "x86") return true; if (x.framework == null) @@ -59,6 +59,8 @@ public static IReadOnlyCollection GetPlatformsForTests(this Project proj return false; if (x.framework.Contains("2.2")) return false; + if (x.framework.Contains("60")) + return false; return true; }); } @@ -76,4 +78,4 @@ public static IReadOnlyCollection GetPlatformsForTests(this Project proj yield return toList.Where(x => !x.project.Name.Contains("StructLinq.Tests")); } -} \ No newline at end of file +} diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 72b8ace5..6c5b4013 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,21 +21,23 @@ stages: pool: vmImage: 'windows-latest' jobs: - - job: Setup - displayName: 'Setup' - dependsOn: [ ] - steps: - - task: UseDotNet@2 - displayName: 'Setup .NET Core 2.2' - inputs: - packageType: runtime - version: 2.2.x - performMultiLevelLookup: true - - job: Compile displayName: '⚙️ Compile' - dependsOn: [ Setup ] + dependsOn: [ ] steps: + - task: UseDotNet@2 + displayName: 'Setup .NET 5.0' + inputs: + packageType: sdk + version: 5.0.x + performMultiLevelLookup: true + - task: UseDotNet@2 + displayName: 'Setup .NET 6.0' + inputs: + packageType: sdk + version: 6.0.x + includePreviewVersions: true + performMultiLevelLookup: true - task: CmdLine@2 inputs: script: './build.cmd Restore Compile --skip' @@ -45,6 +47,43 @@ stages: strategy: parallel: 4 steps: + - task: UseDotNet@2 + displayName: 'Setup .NET Core 2.1' + inputs: + packageType: sdk + version: 2.1.x + performMultiLevelLookup: true + - task: UseDotNet@2 + displayName: 'Setup .NET Core 2.2' + inputs: + packageType: sdk + version: 2.2.x + performMultiLevelLookup: true + - task: UseDotNet@2 + displayName: 'Setup .NET Core 3.0' + inputs: + packageType: sdk + version: 3.0.x + performMultiLevelLookup: true + - task: UseDotNet@2 + displayName: 'Setup .NET Core 3.1' + inputs: + packageType: sdk + version: 3.1.x + performMultiLevelLookup: true + - task: UseDotNet@2 + displayName: 'Setup .NET 5.0' + inputs: + packageType: sdk + version: 5.0.x + performMultiLevelLookup: true + - task: UseDotNet@2 + displayName: 'Setup .NET 6.0' + inputs: + packageType: sdk + version: 6.0.x + includePreviewVersions: true + performMultiLevelLookup: true - task: CmdLine@2 inputs: script: './build.cmd Test --skip --test-partition $(System.JobPositionInPhase)' @@ -56,6 +95,19 @@ stages: displayName: '📦 Pack' dependsOn: [ Compile ] steps: + - task: UseDotNet@2 + displayName: 'Setup .NET 5.0' + inputs: + packageType: sdk + version: 5.0.x + performMultiLevelLookup: true + - task: UseDotNet@2 + displayName: 'Setup .NET 6.0' + inputs: + packageType: sdk + version: 6.0.x + includePreviewVersions: true + performMultiLevelLookup: true - task: CmdLine@2 inputs: script: './build.cmd Pack --skip' diff --git a/src/StructLinq.BCL.Tests/StructLinq.BCL.x64.Tests.csproj b/src/StructLinq.BCL.Tests/StructLinq.BCL.x64.Tests.csproj index 9a458af1..199da3e2 100644 --- a/src/StructLinq.BCL.Tests/StructLinq.BCL.x64.Tests.csproj +++ b/src/StructLinq.BCL.Tests/StructLinq.BCL.x64.Tests.csproj @@ -1,7 +1,7 @@  - net472;net48;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net50 + net472;net48;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net50;net60 x64 true x64 diff --git a/src/StructLinq.BCL.Tests/StructLinq.BCL.x86.Tests.csproj b/src/StructLinq.BCL.Tests/StructLinq.BCL.x86.Tests.csproj index bd5da08b..b50522a0 100644 --- a/src/StructLinq.BCL.Tests/StructLinq.BCL.x86.Tests.csproj +++ b/src/StructLinq.BCL.Tests/StructLinq.BCL.x86.Tests.csproj @@ -1,7 +1,7 @@  - net472;net48;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net50 + net472;net48;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net50;net60 x86 true x86 diff --git a/src/StructLinq/Dictionary/DictionaryLayout.cs b/src/StructLinq/Dictionary/DictionaryLayout.cs index fc960fe1..1dfecff3 100644 --- a/src/StructLinq/Dictionary/DictionaryLayout.cs +++ b/src/StructLinq/Dictionary/DictionaryLayout.cs @@ -7,26 +7,25 @@ internal class DictionaryLayout public Entry[] Entries; } -#if (NETCOREAPP3_0 || NETCOREAPP3_1) +#if (NET5_0_OR_GREATER) internal struct Entry { - public int Next; public uint HashCode; + public int Next; internal TKey Key; // Key of entry internal TValue Value; // Value of entry } -#else -#if (NET5_0) - +#elif NETCOREAPP3_0_OR_GREATER + internal struct Entry { - public uint HashCode; public int Next; + public uint HashCode; internal TKey Key; // Key of entry internal TValue Value; // Value of entry } -#else +#else internal struct Entry { public int HashCode; @@ -34,7 +33,6 @@ internal struct Entry internal TKey Key; // Key of entry internal TValue Value; // Value of entry } - #endif #endif } #endif \ No newline at end of file diff --git a/src/StructLinq/List/ListLayout.cs b/src/StructLinq/List/ListLayout.cs index f620505b..d813461d 100644 --- a/src/StructLinq/List/ListLayout.cs +++ b/src/StructLinq/List/ListLayout.cs @@ -5,7 +5,7 @@ namespace StructLinq.List { -#if (NETCOREAPP3_0 || NETCOREAPP3_1 || NET5_0) +#if (NETCOREAPP3_0_OR_GREATER) internal class ListLayout { diff --git a/src/StructLinq/StructLinq.csproj b/src/StructLinq/StructLinq.csproj index 25b9b1e3..3f0a5dfa 100644 --- a/src/StructLinq/StructLinq.csproj +++ b/src/StructLinq/StructLinq.csproj @@ -1,7 +1,7 @@  - netstandard1.1;net452;net472;net48;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net50 + netstandard1.1;net452;net472;net48;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;netcoreapp3.1;net50;net60