Skip to content

Commit dd3b217

Browse files
authored
Feature/netcoreapp21 5x (#3282)
* Bump to SDK 2.1.300 bump netcoreapp2.0 to netcoreapp2.1 * no infer on types sdk version is parsed as date by Fsharp.Data * Update Bogus remove Randomizer.Seed usage Conflicts: src/Tests/Framework/MockData/Generators.cs src/Tests/Framework/MockData/Gimme.cs src/Tests/Framework/MockData/SimpleGeoPoint.cs src/Tests/Framework/TestClient.cs src/Tests/Tests.csproj * move doc and api gen over to netcoreapp21 * move to RazorLight.Unofficial for now and updated views to deal with slightly different spacing rules * sync 5.x <=> 6.x * great paket and fake sync across branches * update travis to 2.1.300 * FieldInference test used the wrong skip attribute Conflicts: src/Tests/ClientConcepts/HighLevel/Inference/FieldInference.doc.cs
1 parent 1600a4d commit dd3b217

File tree

78 files changed

+564
-771
lines changed

Some content is hidden

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

78 files changed

+564
-771
lines changed

.paket/Paket.Restore.targets

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@
7575

7676
<!-- Do a global restore if required -->
7777
<Exec Command='$(PaketBootStrapperCommand)' Condition="Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
78-
<Exec Command='$(PaketCommand) restore --target-framework "$(TargetFrameworks)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' == '' " ContinueOnError="false" />
79-
<Exec Command='$(PaketCommand) restore --target-framework "$(TargetFramework)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' != '' " ContinueOnError="false" />
78+
<Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" />
8079

8180
<!-- Step 2 Detect project specific changes -->
8281
<ItemGroup>

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
language: csharp
22
solution: src/Elasticsearch.sln
3-
script: ./build.sh test
3+
script: ./build.sh test-one skipdocs
44
dist: trusty
55
mono: 4.6.2
6-
dotnet: 2.0.3
6+
dotnet: 2.1.3
77
env:
88
global:
99
- DOTNET_CLI_TELEMETRY_OPTOUT: 1

build/Clients.Common.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<CurrentVersion>5.0.0</CurrentVersion>
66
<CurrentAssemblyVersion>5.0.0</CurrentAssemblyVersion>
77
<CurrentAssemblyFileVersion>5.0.0</CurrentAssemblyFileVersion>
8-
8+
99
<!-- Version and Informational reflect actual version -->
1010
<Version>$(CurrentVersion)</Version>
1111
<InformationalVersion>$(CurrentVersion)</InformationalVersion>
-18 KB
Binary file not shown.

build/scripts/Benchmarking.fsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ module Benchmarker =
143143
DotNetCli.RunCommand(fun p ->
144144
{ p with
145145
WorkingDir = testsProjectDirectory
146-
}) "run -f net46 -c Release Benchmark"
146+
}) "run -f netcoreapp2.1 -c Release Benchmark"
147147
else
148148
DotNetCli.RunCommand(fun p ->
149149
{ p with
150150
WorkingDir = testsProjectDirectory
151-
}) "run -f net46 -c Release Benchmark non-interactive"
151+
}) "run -f netcoreapp2.1 -c Release Benchmark non-interactive"
152152
finally
153153
// running benchmarks can timeout so clean up any generated benchmark files
154154
let benchmarkOutputFiles =

build/scripts/Building.fsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,26 @@ module Build =
2626

2727
let private runningRelease = hasBuildParam "version" || hasBuildParam "apikey" || getBuildParam "target" = "canary" || getBuildParam "target" = "release"
2828

29-
type private GlobalJson = JsonProvider<"../../global.json">
29+
type private GlobalJson = JsonProvider<"../../global.json", InferTypesFromValues=false>
3030
let private pinnedSdkVersion = GlobalJson.GetSample().Sdk.Version
3131
if isMono then setProcessEnvironVar "TRAVIS" "true"
32-
3332
let private buildingOnTravis = getEnvironmentVarAsBool "TRAVIS"
3433

35-
let private sln = sprintf "src/Elasticsearch%s.sln" (if buildingOnTravis then ".DotNetCoreOnly" else "")
34+
let private sln = "src/Elasticsearch.sln"
3635

3736
let private compileCore incremental =
3837
if not (DotNetCli.isInstalled()) then failwith "You need to install the dotnet command line SDK to build for .NET Core"
3938
let runningSdkVersion = DotNetCli.getVersion()
4039
if (runningSdkVersion <> pinnedSdkVersion) then failwithf "Attempting to run with dotnet.exe with %s but global.json mandates %s" runningSdkVersion pinnedSdkVersion
41-
let incrementalFramework = DotNetFramework.Net46
40+
let incrementalFramework = DotNetFramework.NetStandard1_3
4241
let sourceLink = if not incremental && not isMono && runningRelease then "1" else ""
4342
let props =
4443
[
4544
"CurrentVersion", (Versioning.CurrentVersion.ToString());
4645
"CurrentAssemblyVersion", (Versioning.CurrentAssemblyVersion.ToString());
4746
"CurrentAssemblyFileVersion", (Versioning.CurrentAssemblyFileVersion.ToString());
4847
"DoSourceLink", sourceLink;
49-
"DotNetCoreOnly", if buildingOnTravis then "1" else "";
48+
"FakeBuild", "1";
5049
"OutputPathBaseDir", Path.GetFullPath Paths.BuildOutput;
5150
]
5251
|> List.map (fun (p,v) -> sprintf "%s=%s" p v)
@@ -153,7 +152,7 @@ module Build =
153152
trace "Finished rewriting namespaces"
154153

155154
let private ilRepackInternal() =
156-
let fw = if isMono then [DotNetFramework.NetStandard1_3] else DotNetFramework.All
155+
let fw = DotNetFramework.All
157156
for f in fw do
158157
let nest = Project Project.Nest
159158
let folder = Paths.ProjectOutputFolder nest f

build/scripts/Commandline.fsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@ Targets:
2828
* canary [apikey] [feed]
2929
- create a canary nuget package based on the current version if [feed] and [apikey] are provided
3030
also pushes to upstream (myget)
31-
* diff <github|nuget|directories|assemblies> <version|path 1> <version|path 2> [format]
31+
* diff <github|nuget|dir|assembly> <version|path 1> <version|path 2> [format]
3232
3333
NOTE: both the `test` and `integrate` targets can be suffixed with `-all` to force the tests against all suported TFM's
3434
3535
Execution hints can be provided anywhere on the command line
3636
- skiptests : skip running tests as part of the target chain
3737
- skipdocs : skip generating documentation
38-
- source_serialization : force tests to use a client with custom source serialization
3938
- seed:<N> : provide a seed to run the tests with.
4039
- random:<K><:B> : sets random K to bool B if if B is omitted will default to true
4140
K can be: sourceserializer, typedkeys or oldconnection (only valid on windows)
@@ -58,21 +57,30 @@ module Commandline =
5857
|> List.filter (fun x -> (x.StartsWith("random:")))
5958
|> List.map (fun x -> (x.Replace("random:", "")))
6059

60+
let docsBranch =
61+
match args |> List.tryFind (fun x -> x.StartsWith("docs:")) with
62+
| Some t -> t.Replace("docs:", "")
63+
| _ -> ""
64+
6165
let private filteredArgs =
6266
args
6367
|> List.filter (
6468
fun x ->
65-
x <> "skiptests" && x <> "skipdocs" && x <> "source_serialization" && not (x.StartsWith("seed:")) && not (x.StartsWith("random:"))
69+
x <> "skiptests" &&
70+
x <> "skipdocs" &&
71+
not (x.StartsWith("seed:")) &&
72+
not (x.StartsWith("random:")) &&
73+
not (x.StartsWith("docs:"))
6674
)
6775

6876
let multiTarget =
6977
match (filteredArgs |> List.tryHead) with
70-
| Some t when t.EndsWith("-all") -> MultiTarget.All
71-
| _ -> MultiTarget.One
78+
| Some t when t.EndsWith("-one") -> MultiTarget.One
79+
| _ -> MultiTarget.All
7280

7381
let target =
7482
match (filteredArgs |> List.tryHead) with
75-
| Some t -> t.Replace("-all", "")
83+
| Some t -> t.Replace("-one", "")
7684
| _ -> "build"
7785

7886
let validMonoTarget =
@@ -206,6 +214,7 @@ module Commandline =
206214
setBuildParam "first" firstVersionOrPath
207215
setBuildParam "second" secondVersionOrPath
208216

217+
| ["touch"; ] -> ignore()
209218
| ["temp"; ] -> ignore()
210219
| ["canary"; ] -> ignore()
211220
| ["canary"; apiKey ] ->

build/scripts/Differ.fsx

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@
77
#load @"Tooling.fsx"
88
#load @"Projects.fsx"
99

10-
open Microsoft.FSharp.Reflection
1110
open System
12-
open System.Collections.Generic
11+
open System.IO
12+
13+
open Fake
14+
open System
1315
open System.IO
1416
open System.Linq
1517
open System.Net
1618
open System.Text
1719
open System.Text.RegularExpressions
1820
open System.Xml
1921
open System.Xml.Linq
20-
open Fake
2122
open Fake.Git.CommandHelper
23+
2224
open Paths
2325
open Projects
2426
open Tooling
@@ -262,63 +264,42 @@ module Differ =
262264
| :? XmlException -> ignore()
263265

264266
let private convertToAsciidoc path first second =
265-
let createDiffDescription description (writer:TextWriter) =
266-
let m = Regex.Match(description, "(.*?) changed from (.*?) to (.*).")
267-
if m.Success then
268-
let memberType = m.Groups.[1].Value
269-
let o = m.Groups.[2].Value
270-
let n = m.Groups.[3].Value
271-
writer.WriteLine("+")
272-
writer.WriteLine(sprintf "%s change" memberType)
273-
writer.WriteLine("+")
274-
writer.WriteLine("[source,csharp]")
275-
writer.WriteLine("----")
276-
writer.WriteLine(sprintf "// before in %s" first)
277-
writer.WriteLine(sprintf "%s" o)
278-
writer.WriteLine(sprintf "// now in %s" second)
279-
writer.WriteLine(sprintf "%s" n)
280-
writer.WriteLine("----")
281-
else
282-
writer.WriteLine(sprintf "%s" description)
283-
284267
let name = path |> Path.GetFileNameWithoutExtension
285268
try
286269
let doc = XDocument.Load path
287270
let output = Path.ChangeExtension(path, "asciidoc")
288271
DeleteFile output
289272
use file = File.OpenWrite <| output
290273
use writer = new StreamWriter(file)
291-
writer.WriteLine(name |> replace "." "-" |> toLower |> sprintf "[[%s-breaking-changes]]")
274+
writer.WriteLine(name |> replace "." "-" |> sprintf "[[%s-breaking-changes]]")
292275
writer.WriteLine(sprintf "== Breaking changes for %s between %s and %s" name first second)
293276
writer.WriteLine()
294277

295278
for element in (doc |> descendents "Type") do
296279
let typeName = element |> attributeValue "Name" |> replace (sprintf "%s." name) ""
297280
let diffType = element |> attributeValue "DiffType" |> convertDiffType
298-
299281
match diffType with
300-
| Deleted -> writer.WriteLine(sprintf "`%s`:: deleted" typeName)
301-
| New -> writer.WriteLine(sprintf "`%s`:: added" typeName)
282+
| Deleted -> writer.WriteLine(sprintf "[float]%s=== `%s` is deleted" Environment.NewLine typeName)
283+
| New -> writer.WriteLine(sprintf "[float]%s=== `%s` is added" Environment.NewLine typeName)
302284
| Modified ->
303285
let members = Seq.append (element |> elements "Method") (element |> elements "Property")
304286
if Seq.isEmpty members |> not then
305-
writer.WriteLine(sprintf "`%s`::" typeName)
287+
writer.WriteLine(sprintf "[float]%s=== `%s`" Environment.NewLine typeName)
306288
for m in members do
307289
let memberName = m |> attributeValue "Name"
308290
if isNotNullOrEmpty memberName then
309291
let diffType = m |> attributeValue "DiffType"
310292
if isNotNullOrEmpty diffType then
311293
match convertDiffType diffType with
312-
| Deleted -> writer.WriteLine(sprintf " * `%s` deleted" memberName)
313-
| New -> writer.WriteLine(sprintf " * `%s` added" memberName)
294+
| Deleted -> writer.WriteLine(sprintf "[float]%s==== `%s` is deleted" Environment.NewLine memberName)
295+
| New -> writer.WriteLine(sprintf "[float]%s==== `%s` is added" Environment.NewLine memberName)
314296
| Modified ->
315297
match (m.Descendants(XName.op_Implicit "DiffItem") |> Seq.tryHead) with
316298
| Some diffItem ->
317-
writer.WriteLine(sprintf " * `%s`" memberName)
299+
writer.WriteLine(sprintf "[float]%s==== `%s`" Environment.NewLine memberName)
318300
let diffDescription = diffItem.Value
319-
writer |> createDiffDescription diffDescription
301+
writer.WriteLine(Regex.Replace(diffDescription, "changed from (.*?) to (.*).", "changed from `$1` to `$2`."))
320302
| None -> ()
321-
writer.WriteLine()
322303
with
323304
| :? XmlException -> ignore()
324305

build/scripts/Documentation.fsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#nowarn "0044" //TODO sort out FAKE 5
44

55
#load @"Paths.fsx"
6+
#load @"Commandline.fsx"
67

78
open System
89
open System.IO
@@ -11,17 +12,19 @@ open Fake
1112

1213
open Paths
1314
open Projects
15+
open Commandline
1416

1517
module Documentation =
1618

1719
let Generate() =
1820
let docGenerator = PrivateProject(DocGenerator)
19-
let path = Paths.ProjectOutputFolder docGenerator DotNetFramework.Net46
20-
let generator = sprintf "%s/%s.exe" path docGenerator.Name
21-
ExecProcess (fun p ->
22-
p.WorkingDirectory <- Paths.Source("CodeGeneration") @@ docGenerator.Name
23-
p.FileName <- generator
24-
) (TimeSpan.FromMinutes 3.) |> ignore
21+
let path = Paths.ProjectOutputFolder docGenerator DotNetFramework.NetCoreApp2_1
22+
let generator = sprintf "%s.dll %s" docGenerator.Name Commandline.docsBranch
23+
24+
DotNetCli.RunCommand(fun p ->
25+
{ p with
26+
WorkingDir = path
27+
}) generator
2528

2629
// TODO: hook documentation validation into the process
2730
let Validate() =

build/scripts/Projects.fsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ module Projects =
1616
type DotNetFramework =
1717
| Net46
1818
| NetStandard1_3
19-
| NetCoreApp2_0
19+
| NetCoreApp2_1
2020
static member All = [Net46; NetStandard1_3]
2121
member this.Identifier =
2222
match this with
23-
| Net46 -> { MSBuild = "v4.6"; Nuget = "net46"; DefineConstants = if not isMono then "TRACE;NET46" else "NET46"; }
24-
| NetStandard1_3 -> { MSBuild = "netstandard1.3"; Nuget = "netstandard1.3"; DefineConstants = if not isMono then "TRACE;DOTNETCORE" else "DOTNETCORE"; }
25-
| NetCoreApp2_0 -> { MSBuild = "netcoreapp2.0"; Nuget = "netcoreapp2.0"; DefineConstants = if not isMono then "TRACE;DOTNETCORE" else "DOTNETCORE"; }
23+
| Net46 -> { MSBuild = "v4.6"; Nuget = "net46"; DefineConstants = ""; }
24+
| NetStandard1_3 -> { MSBuild = "netstandard1.3"; Nuget = "netstandard1.3"; DefineConstants = ""; }
25+
| NetCoreApp2_1 -> { MSBuild = "netcoreapp2.1"; Nuget = "netcoreapp2.1"; DefineConstants = ""; }
2626

2727
type Project =
2828
| Nest

0 commit comments

Comments
 (0)