Skip to content

Commit d3f062d

Browse files
authored
Move to .NET 3.0 and C# 8.0 (#4097) (#4102)
* Move to .NET 3.0 and C# 8.0 (#4097) * initial move to .NET Core 3.0 * bump to .net sdk 3.0.100 and update our build files to install it for now while the images catch up * move scripts to 3.0 since we call dotnet run on them, exclude new types from codestandards test that all types live in Elasticsearch.Net/NEST namespace * build tooling moved from 2.2 to 3.0 * move all netcoreapp over to 3.0 * move to range on RegexCollection no longer accepts Last() * update our own dependencies * make 2.2 available for canary so that rewrite using 2.2 tools still works * fix yaml indentation * disable ingest-attachemnt for now, installl has stderr on 8.0.0 which abstractions does not yet handle * move rewriter and differ to local dotnet tools * no longer need to install 2.2 sdk for differ (cherry picked from commit 9bbffad) * Bump System.Buffers in Tests * Move library projects over to also build net461 on linux through Microsoft.NETFramework.ReferenceAssemblies like we do on 7.x and master * disable bullkallretries on CI for now, warrants deeper investigation issue to follow * update to latest abstractions * SkipOnCiAttribute over SkipOnTeamCityAttribute * enable ingest attachment on writable cluster * update abstractions * bulkinvalid should have skipversion
1 parent 1e45ee8 commit d3f062d

File tree

53 files changed

+164
-143
lines changed

Some content is hidden

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

53 files changed

+164
-143
lines changed

appveyor.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ test: off
44
environment:
55
DOTNET_CLI_TELEMETRY_OPTOUT: true
66
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
7+
install:
8+
- cmd: choco install dotnetcore-sdk --version 3.0.100
79
build_script:
810
- cmd: build.bat canary
911

azure-pipelines.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ jobs:
33
pool:
44
vmImage: 'ubuntu-16.04'
55
steps:
6+
- task: UseDotNet@2
7+
inputs:
8+
version: '3.0.100'
69
- script: ./build.sh test-one
710
displayName: 'build and unit test'
811
- task: PublishTestResults@2
@@ -15,6 +18,9 @@ jobs:
1518
pool:
1619
vmImage: 'vs2017-win2016'
1720
steps:
21+
- task: UseDotNet@2
22+
inputs:
23+
version: '3.0.100'
1824
- script: build.bat canary
1925
displayName: 'build and unit test'
2026
- task: PublishTestResults@2
@@ -49,6 +55,9 @@ jobs:
4955
es601:
5056
esVersion: '6.0.1'
5157
steps:
58+
- task: UseDotNet@2
59+
inputs:
60+
version: '3.0.100'
5261
- script: 'build.bat integrate-one $(esVersion) "readonly,writable,bool,xpack"'
5362
displayName: '$(esVersion) windows integration tests'
5463
- task: PublishTestResults@2
@@ -84,6 +93,9 @@ jobs:
8493
es601:
8594
esVersion: '6.0.1'
8695
steps:
96+
- task: UseDotNet@2
97+
inputs:
98+
version: '3.0.100'
8799
- script: './build.sh integrate-one $(esVersion) "readonly,writable"'
88100
displayName: '$(esVersion) linux integration tests'
89101
- task: PublishTestResults@2

build/scripts/Benchmarking.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module Benchmarker =
1414
let password = match args.CommandArguments with | Benchmark b -> b.Password | _ -> None
1515
let runInteractive = not args.NonInteractive
1616
let credentials = (username, password)
17-
let runCommandPrefix = "run -f netcoreapp2.1 -c Release"
17+
let runCommandPrefix = "run -f netcoreapp3.0 -c Release"
1818
let runCommand =
1919
match (runInteractive, url, credentials) with
2020
| (false, Some url, (Some username, Some password)) -> sprintf "%s -- --all \"%s\" \"%s\" \"%s\"" runCommandPrefix url username password

build/scripts/Cluster.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module Cluster =
1212
let clusterName = Option.defaultValue "" <| match args.CommandArguments with | Cluster c -> Some c.Name | _ -> None
1313
let clusterVersion = Option.defaultValue "" <|match args.CommandArguments with | Cluster c -> c.Version | _ -> None
1414

15-
let testsProjectDirectory = Path.Combine(Path.GetFullPath(Paths.Output("Tests.ClusterLauncher")), "netcoreapp2.1")
15+
let testsProjectDirectory = Path.Combine(Path.GetFullPath(Paths.Output("Tests.ClusterLauncher")), "netcoreapp3.0")
1616
let tempDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
1717

1818
let sourceDir = Paths.Source("Tests/Tests.Configuration");

build/scripts/Differ.fs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ open Commandline
99
module Differ =
1010

1111
let Run args =
12+
Tooling.DotNet.Exec ["tool"; "restore"]
13+
1214
let differ = "assembly-differ"
1315
let args = args.RemainingArguments |> String.concat " "
1416
let command = sprintf @"%s %s -o ../../%s" differ args Paths.BuildOutput

build/scripts/Documentation.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module Documentation =
1111

1212
let Generate args =
1313
let docGenerator = PrivateProject(DocGenerator)
14-
let path = Paths.ProjectOutputFolder docGenerator DotNetFramework.NetCoreApp2_1
14+
let path = Paths.ProjectOutputFolder docGenerator DotNetFramework.NetCoreApp3_0
1515
let generator = sprintf "%s.dll" docGenerator.Name
1616

1717
let (|NotNullOrEmpty|_|) (candidate:string) =

build/scripts/Projects.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ module Projects =
77
type DotNetFramework =
88
| NetStandard2_0
99
| Net461
10-
| NetCoreApp2_1
10+
| NetCoreApp3_0
1111
static member All = [NetStandard2_0; Net461]
12-
static member AllTests = [NetCoreApp2_1; Net461]
12+
static member AllTests = [NetCoreApp3_0; Net461]
1313
member this.Identifier =
1414
match this with
1515
| NetStandard2_0 -> { MSBuild = "netstandard2.0"; Nuget = "netstandard2.0"; DefineConstants = ""; }
16-
| NetCoreApp2_1 -> { MSBuild = "netcoreapp2.1"; Nuget = "netcoreapp2.1"; DefineConstants = ""; }
16+
| NetCoreApp3_0 -> { MSBuild = "netcoreapp3.0"; Nuget = "netcoreapp3.0"; DefineConstants = ""; }
1717
| Net461 -> { MSBuild = "net461"; Nuget = "net461"; DefineConstants = ""; }
1818

1919
type Project =

build/scripts/ShadowDependencies.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ module ShadowDependencies =
88
let private assemblyRewriter = "assembly-rewriter"
99
let private keyFile = Paths.Keys "keypair.snk"
1010
let Rewrite majorVersion framework projects =
11+
12+
Tooling.DotNet.Exec ["tool"; "restore"]
13+
1114
let project = projects |> Seq.head
1215
let folder = Paths.ProjectOutputFolder project framework
1316

build/scripts/Testing.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module Tests =
4141
let p = ["test"; "."; "-c"; "RELEASE"]
4242
//make sure we only test netcoreapp on linux or requested on the command line to only test-one
4343
match (target, Environment.isLinux) with
44-
| (_, true) -> ["--framework"; "netcoreapp2.1"] |> List.append p
44+
| (_, true) -> ["--framework"; "netcoreapp3.0"] |> List.append p
4545
| (Commandline.MultiTarget.One, _) ->
4646
let random = new Random()
4747
let fw = DotNetFramework.AllTests |> List.sortBy (fun _ -> random.Next()) |> List.head

build/scripts/Tooling.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ module Tooling =
5858
member this.ExecIn workingDirectory arguments = this.ExecInWithTimeout workingDirectory arguments timeout
5959
member this.Exec arguments = this.ExecWithTimeout arguments timeout
6060

61-
let nugetFile = Path.GetFullPath "build/scripts/bin/Release/netcoreapp2.2/NuGet.exe"
61+
let nugetFile = Path.GetFullPath "build/scripts/bin/Release/netcoreapp3.0/NuGet.exe"
6262
let Nuget = BuildTooling(None, nugetFile)
63-
let ILRepack = BuildTooling(None, "build/scripts/bin/Release/netcoreapp2.2/ILRepack.exe")
63+
let ILRepack = BuildTooling(None, "build/scripts/bin/Release/netcoreapp3.0/ILRepack.exe")
6464
let DotNet = BuildTooling(Some <| TimeSpan.FromMinutes(5.), "dotnet")
6565

6666

0 commit comments

Comments
 (0)