Skip to content

Commit 7e2a163

Browse files
committed
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)
1 parent 25c0019 commit 7e2a163

35 files changed

+89
-45
lines changed

NuGet.config

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<packageSources>
4-
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
5-
<add key="Elastic Abstractions CI" value="https://ci.appveyor.com/nuget/elasticsearch-net-abstractions" />
6-
<add key="AssemblyRewriter" value="https://ci.appveyor.com/nuget/assemblyrewriter" />
7-
<add key="AssemblyDiffer" value="https://ci.appveyor.com/nuget/assemblydiffer" />
8-
</packageSources>
3+
<packageSources>
4+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
5+
</packageSources>
96
</configuration>

appveyor.yml

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

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
@@ -39,6 +45,9 @@ jobs:
3945
latest7:
4046
esVersion: 'latest-7'
4147
steps:
48+
- task: UseDotNet@2
49+
inputs:
50+
version: '3.0.100'
4251
- script: 'build.bat integrate-one $(esVersion) "readonly,writable,bool,xpack"'
4352
displayName: '$(esVersion) windows integration tests'
4453
- task: PublishTestResults@2
@@ -64,6 +73,9 @@ jobs:
6473
latest7:
6574
esVersion: 'latest-7'
6675
steps:
76+
- task: UseDotNet@2
77+
inputs:
78+
version: '3.0.100'
6779
- script: './build.sh integrate-one $(esVersion) "readonly,writable"'
6880
displayName: '$(esVersion) linux integration tests'
6981
- 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/Differ.fs

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

88
let Run args =
9+
Tooling.DotNet.Exec ["tool"; "restore"]
10+
911
let differ = "assembly-differ"
1012
let args = args.RemainingArguments |> String.concat " "
1113
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
@@ -10,7 +10,7 @@ module Documentation =
1010

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

1616
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/ReposTooling.fs

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

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

1717
printfn "%s" testsProjectDirectory

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
@@ -40,7 +40,7 @@ module Tests =
4040
let p = ["test"; "."; "-c"; "RELEASE"]
4141
//make sure we only test netcoreapp on linux or requested on the command line to only test-one
4242
match (target, Environment.isLinux) with
43-
| (_, true) -> ["--framework"; "netcoreapp2.1"] |> List.append p
43+
| (_, true) -> ["--framework"; "netcoreapp3.0"] |> List.append p
4444
| (Commandline.MultiTarget.One, _) ->
4545
let random = new Random()
4646
let fw = DotNetFramework.AllTests |> List.sortBy (fun _ -> random.Next()) |> List.head

0 commit comments

Comments
 (0)