From 51158691dc56ea19053c18e53d726d96544a7a37 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 11 Dec 2019 12:30:38 +0100 Subject: [PATCH 01/18] CI: tests and canary builds - Adds tests to build targets, picks up all tests projects under /tests - Adds `scripts` to the solution. - build.bat test simply tests all projects without other target - Update fsproj file so it works on .net core sdk 3.0 and up --- build.sh | 0 build/scripts/Commandline.fs | 3 +++ build/scripts/Targets.fs | 4 ++- build/scripts/Testing.fs | 39 +++++++++++++++++++++++++++ build/scripts/Tooling.fs | 3 +-- build/scripts/scripts.fsproj | 51 ++++-------------------------------- src/ecs-dotnet.sln | 6 +++++ 7 files changed, 57 insertions(+), 49 deletions(-) mode change 100644 => 100755 build.sh create mode 100644 build/scripts/Testing.fs diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 diff --git a/build/scripts/Commandline.fs b/build/scripts/Commandline.fs index 1fc1a311..17cd7d9c 100644 --- a/build/scripts/Commandline.fs +++ b/build/scripts/Commandline.fs @@ -18,6 +18,8 @@ Targets: - default target if non provided. * clean - cleans build output folders +* tests + - tests all the projects under /tests * release - 0 create a release worthy nuget packages for [version] under build\output * canary @@ -88,6 +90,7 @@ Targets: match arguments with | [] | ["build"] | ["clean"] | ["touch"; ] | ["temp"; ] | ["canary"; ] -> parsed | "diff" :: tail -> { parsed with RemainingArguments = tail } + | "test" :: tail -> { parsed with RemainingArguments = tail } | ["release"; version] -> { parsed with CommandArguments = SetVersion { Version = version } } | _ -> diff --git a/build/scripts/Targets.fs b/build/scripts/Targets.fs index 106f967a..cbf003ee 100644 --- a/build/scripts/Targets.fs +++ b/build/scripts/Targets.fs @@ -53,9 +53,11 @@ module Main = // the following are expected to be called as targets directly let buildChain = [ - "clean"; "version"; "restore"; "full-build"; + "clean"; "version"; "restore"; "full-build"; "test" ] command "build" buildChain <| fun _ -> printfn "STARTING BUILD" + + target "test" Tests.TestAll command "canary" [ "version"; "release";] <| fun _ -> printfn "Finished Release Build %O" artifactsVersion diff --git a/build/scripts/Testing.fs b/build/scripts/Testing.fs new file mode 100644 index 00000000..4e879b20 --- /dev/null +++ b/build/scripts/Testing.fs @@ -0,0 +1,39 @@ +namespace Scripts + +open System +open Tooling +open Fake.Core +open Fake.IO.Globbing.Operators +open System.IO +open Commandline +open Versioning + +module Tests = + + let TestAll () = + Directory.CreateDirectory Paths.BuildOutput |> ignore + let command = + let p = ["test"; "."; "-c"; "RELEASE"] + //make sure we only test netcoreapp on linux or requested on the command line to only test-one + match Environment.isLinux with + | true -> + printfn "Running on linux defaulting tests to .NET Core only" + ["--framework"; "netcoreapp3.0"] |> List.append p + | _ -> p + let commandWithCodeCoverage = + // TODO /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura + // Using coverlet.msbuild package + // https://github.com/tonerdo/coverlet/issues/110 + // Bites us here as well a PR is up already but not merged will try again afterwards + // https://github.com/tonerdo/coverlet/pull/329 + match false with + | true -> [ "--logger"; "trx"; "--collect"; "\"Code Coverage\""; "-v"; "m"] |> List.append command + | _ -> command + + let testProjects = !! "tests/**/*.csproj" + + for projectFile in testProjects do + let folder = (FileInfo projectFile).Directory.FullName + printfn "Running tests in %s" folder + + Tooling.DotNet.ExecInWithTimeout folder commandWithCodeCoverage (TimeSpan.FromMinutes 30.) diff --git a/build/scripts/Tooling.fs b/build/scripts/Tooling.fs index 92ac0f7a..0e068677 100644 --- a/build/scripts/Tooling.fs +++ b/build/scripts/Tooling.fs @@ -1,6 +1,5 @@ namespace Scripts -open Elastic.Managed.ConsoleWriters open System open System.IO open ProcNet @@ -17,7 +16,7 @@ module Tooling = if (Option.isSome workinDir) then startArgs.WorkingDirectory <- Option.defaultValue "" workinDir if Commandline.isMono then startArgs.WaitForStreamReadersTimeout <- Nullable() - let result = Proc.StartRedirected(startArgs, timeout, LineHighlightWriter()) + let result = Proc.StartRedirected(startArgs, timeout) if not result.Completed then failwithf "process failed to complete within %O: %s" timeout bin if not result.ExitCode.HasValue then failwithf "process yielded no exit code: %s" bin { ExitCode = result.ExitCode.Value; Output = seq []} diff --git a/build/scripts/scripts.fsproj b/build/scripts/scripts.fsproj index b1f3ce1f..7b1f668b 100644 --- a/build/scripts/scripts.fsproj +++ b/build/scripts/scripts.fsproj @@ -1,6 +1,6 @@  - netcoreapp2.2 + netcoreapp3.0 Exe $(NoWarn);NU1701 @@ -15,6 +15,7 @@ + @@ -22,61 +23,19 @@ build.bat appveyor.yml - - - true - true - true - - - C:\Program Files (x86)\Microsoft SDKs\F#\4.1\Framework\v4.0 - fsc.exe - - - C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\CommonExtensions\Microsoft\FSharp - fsc.exe - - - C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp - fsc.exe - - - C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\FSharp - fsc.exe - - - C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\FSharp - fsc.exe - - - C:\Program Files (x86)\Microsoft SDKs\F#\10.1\Framework\v4.0 - fsc.exe - - - /Library/Frameworks/Mono.framework/Versions/Current/Commands - fsharpc - - - /usr/bin - fsharpc - - - + + + - - - - - diff --git a/src/ecs-dotnet.sln b/src/ecs-dotnet.sln index 9d9c5a10..a418d4f6 100644 --- a/src/ecs-dotnet.sln +++ b/src/ecs-dotnet.sln @@ -38,6 +38,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.Apm.SerilogEnricher EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.Apm.SerilogEnricher.Test", "..\tests\Elastic.Apm.SerilogEnricher.Test\Elastic.Apm.SerilogEnricher.Test.csproj", "{D8117E06-8856-4D61-A02E-570E9B6C3646}" EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "scripts", "..\build\scripts\scripts.fsproj", "{4779DD6F-AE49-4A80-9F67-D9F2DB05E557}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -78,6 +80,10 @@ Global {D8117E06-8856-4D61-A02E-570E9B6C3646}.Debug|Any CPU.Build.0 = Debug|Any CPU {D8117E06-8856-4D61-A02E-570E9B6C3646}.Release|Any CPU.ActiveCfg = Release|Any CPU {D8117E06-8856-4D61-A02E-570E9B6C3646}.Release|Any CPU.Build.0 = Release|Any CPU + {4779DD6F-AE49-4A80-9F67-D9F2DB05E557}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4779DD6F-AE49-4A80-9F67-D9F2DB05E557}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4779DD6F-AE49-4A80-9F67-D9F2DB05E557}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4779DD6F-AE49-4A80-9F67-D9F2DB05E557}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution {21FD7B39-5FDD-4432-B25E-8425D3EC46A3} = {432D5575-2347-4D3C-BF8C-3E38410C46CA} From 299ceac2ede7d641eafa58d236111c2500dc8cc6 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 11 Dec 2019 12:49:55 +0100 Subject: [PATCH 02/18] clean up solution folders/items a bit, grouped more under RelatedFiles/Build --- src/ecs-dotnet.sln | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ecs-dotnet.sln b/src/ecs-dotnet.sln index a418d4f6..0b0b528f 100644 --- a/src/ecs-dotnet.sln +++ b/src/ecs-dotnet.sln @@ -8,14 +8,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RelatedFiles", "RelatedFile ..\src\PublishArtifacts.build.props = ..\src\PublishArtifacts.build.props ..\src\Artifacts.build.props = ..\src\Artifacts.build.props ..\src\Library.build.props = ..\src\Library.build.props - Directory.Build.props = Directory.Build.props ..\global.json = ..\global.json ..\.editorconfig = ..\.editorconfig ..\.gitattributes = ..\.gitattributes ..\.gitignore = ..\.gitignore - ..\appveyor.yml = ..\appveyor.yml - ..\build.bat = ..\build.bat - ..\build.sh = ..\build.sh ..\README.md = ..\README.md ..\license.txt = ..\license.txt EndProjectSection @@ -40,6 +36,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.Apm.SerilogEnricher EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "scripts", "..\build\scripts\scripts.fsproj", "{4779DD6F-AE49-4A80-9F67-D9F2DB05E557}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{2A5FBCFE-1BDB-47DC-B577-387F950F5AFB}" +ProjectSection(SolutionItems) = preProject + Library.build.props = Library.build.props + Artifacts.build.props = Artifacts.build.props + Directory.Build.props = Directory.Build.props + PublishArtifacts.build.props = PublishArtifacts.build.props +EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -87,5 +91,7 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {21FD7B39-5FDD-4432-B25E-8425D3EC46A3} = {432D5575-2347-4D3C-BF8C-3E38410C46CA} + {2A5FBCFE-1BDB-47DC-B577-387F950F5AFB} = {432D5575-2347-4D3C-BF8C-3E38410C46CA} + {4779DD6F-AE49-4A80-9F67-D9F2DB05E557} = {2A5FBCFE-1BDB-47DC-B577-387F950F5AFB} EndGlobalSection EndGlobal From 557af08326c560383ff95ea320f64694a36bb386 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 11 Dec 2019 14:59:43 +0100 Subject: [PATCH 03/18] Move to dotnet pack --- build/scripts/Releasing.fs | 6 +-- src/Artifacts.build.props | 11 ----- src/Directory.Build.props | 5 --- .../Elastic.Apm.SerilogEnricher.csproj | 20 +++++---- .../Elastic.CommonSchema.Serilog.csproj | 7 ++- .../Elastic.CommonSchema.csproj | 19 ++++---- src/Library.build.props | 24 +++++++--- src/PublishArtifacts.build.props | 45 +++++++++---------- src/ecs-dotnet.sln | 10 +---- .../Elastic.Apm.SerilogEnricher.Test.csproj | 2 +- 10 files changed, 72 insertions(+), 77 deletions(-) delete mode 100644 src/Artifacts.build.props delete mode 100644 src/Directory.Build.props diff --git a/build/scripts/Releasing.fs b/build/scripts/Releasing.fs index 9869671a..6500a05c 100644 --- a/build/scripts/Releasing.fs +++ b/build/scripts/Releasing.fs @@ -32,10 +32,10 @@ module Release = |> addKeyValue "year" year let pack file n properties version = - Tooling.Nuget.Exec [ "pack"; file; + Tooling.DotNet.Exec [ "pack"; file; + "--no-build"; "-version"; version.Full.ToString(); - "-outputdirectory"; Paths.BuildOutput; - "-properties"; properties; + "-output"; Paths.BuildOutput; ] |> ignore printfn "%s" Paths.BuildOutput let file = sprintf "%s.%O.nupkg" n version.Full diff --git a/src/Artifacts.build.props b/src/Artifacts.build.props deleted file mode 100644 index 3c08b9e3..00000000 --- a/src/Artifacts.build.props +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - $(OutputPathBaseDir)\$(MSBuildProjectName)\ - - \ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props deleted file mode 100644 index 022c43e8..00000000 --- a/src/Directory.Build.props +++ /dev/null @@ -1,5 +0,0 @@ - - - latest - - \ No newline at end of file diff --git a/src/Elastic.Apm.SerilogEnricher/Elastic.Apm.SerilogEnricher.csproj b/src/Elastic.Apm.SerilogEnricher/Elastic.Apm.SerilogEnricher.csproj index 1ed802ee..8b5c2ce1 100644 --- a/src/Elastic.Apm.SerilogEnricher/Elastic.Apm.SerilogEnricher.csproj +++ b/src/Elastic.Apm.SerilogEnricher/Elastic.Apm.SerilogEnricher.csproj @@ -1,12 +1,16 @@ - + - - netstandard2.0;net461 - + + netstandard2.0;net461 - - - - + Elastic APM Serilog Enricher + Enrich your logs with APM TraceId and TransactionId automatically + + + + + + + diff --git a/src/Elastic.CommonSchema.Serilog/Elastic.CommonSchema.Serilog.csproj b/src/Elastic.CommonSchema.Serilog/Elastic.CommonSchema.Serilog.csproj index 52e4e66a..74a196a6 100644 --- a/src/Elastic.CommonSchema.Serilog/Elastic.CommonSchema.Serilog.csproj +++ b/src/Elastic.CommonSchema.Serilog/Elastic.CommonSchema.Serilog.csproj @@ -3,14 +3,17 @@ netstandard2.0;netstandard2.1;net461 + + Elastic Common Schema (ECS) Serilog Formatter + Serilog TextFormatter that emits Elastic Common Schema (ECS) json, in a human scanable form. + - - + diff --git a/src/Elastic.CommonSchema/Elastic.CommonSchema.csproj b/src/Elastic.CommonSchema/Elastic.CommonSchema.csproj index 975ea55b..ec82bbac 100644 --- a/src/Elastic.CommonSchema/Elastic.CommonSchema.csproj +++ b/src/Elastic.CommonSchema/Elastic.CommonSchema.csproj @@ -1,11 +1,14 @@  - - - netstandard2.0;netstandard2.1;net461 - 8.0 - - - - + + + netstandard2.0;netstandard2.1;net461 + + Elastic Common Schema (ECS) Types + Maps ECS to .NET types including (de)serialization using System.Text.Json + + + + + diff --git a/src/Library.build.props b/src/Library.build.props index e665a771..19e073a5 100644 --- a/src/Library.build.props +++ b/src/Library.build.props @@ -1,7 +1,14 @@ - + + + true + 1591,1572,1571,1573,1587,1570 + false + true + portable + + - 1.0.0 1.0.0 1.0.0 @@ -14,15 +21,20 @@ $(CurrentAssemblyFileVersion) true - $(DefineConstants);FULLFRAMEWORK + $(DefineConstants);FULLFRAMEWORK + + + + false https://raw.githubusercontent.com/elastic/ecs-dotnet - Elasticsearch BV + Elastic and contributors Elasticsearch BV + Apache-2.0 + $(OutputPathBaseDir) + https://github.com/elastic/ecs-dotnet - https://github.com/elastic/ecs-dotnet/blob/master/license.txt See https://github.com/elastic/ecs-dotnet/releases - https://raw.githubusercontent.com/elastic/ecs-dotnet/master/build/nuget-icon.png latest diff --git a/src/PublishArtifacts.build.props b/src/PublishArtifacts.build.props index c0df5891..7352b2df 100644 --- a/src/PublishArtifacts.build.props +++ b/src/PublishArtifacts.build.props @@ -1,35 +1,30 @@ - + - + - + true true $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.bat))\build\keys\keypair.snk - true - 1591,1572,1571,1573,1587,1570 - false - true - portable - latest - - $(BaseIntermediateOutputPath)\sl-$(MsBuildProjectName)-$(TargetFramework).json - - true + $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb + true + nuget-icon.png - - - - - - - - - - + + + + + + True + nuget-icon.png + + + True + license.txt + + + diff --git a/src/ecs-dotnet.sln b/src/ecs-dotnet.sln index 0b0b528f..48e5acfe 100644 --- a/src/ecs-dotnet.sln +++ b/src/ecs-dotnet.sln @@ -24,8 +24,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.CommonSchemaNEST", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.CommonSchema.Serilog", "Elastic.CommonSchema.Serilog\Elastic.CommonSchema.Serilog.csproj", "{45BC8315-6AD6-4F3C-B590-7B52D19ED401}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.CommonSchema.Serilog.Test", "Elastic.CommonSchema.Serilog.Test\Elastic.CommonSchema.Serilog.Test.csproj", "{F3EECF86-A950-4CDE-82DD-DF270AFE86E2}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.CommonSchema.Serilog.Tests", "..\tests\Elastic.CommonSchema.Serilog.Tests\Elastic.CommonSchema.Serilog.Tests\Elastic.CommonSchema.Serilog.Tests.csproj", "{D7BA6070-909F-402E-A6F4-1CE54A7BE0B7}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Specification", "Specification\Specification.csproj", "{21FD7B39-5FDD-4432-B25E-8425D3EC46A3}" @@ -39,9 +37,9 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{2A5FBCFE-1BDB-47DC-B577-387F950F5AFB}" ProjectSection(SolutionItems) = preProject Library.build.props = Library.build.props - Artifacts.build.props = Artifacts.build.props - Directory.Build.props = Directory.Build.props PublishArtifacts.build.props = PublishArtifacts.build.props + ..\build\Elastic.CommonSchema.nuspec = ..\build\Elastic.CommonSchema.nuspec + ..\build\Elastic.CommonSchema.Serilog.nuspec = ..\build\Elastic.CommonSchema.Serilog.nuspec EndProjectSection EndProject Global @@ -66,10 +64,6 @@ Global {45BC8315-6AD6-4F3C-B590-7B52D19ED401}.Debug|Any CPU.Build.0 = Debug|Any CPU {45BC8315-6AD6-4F3C-B590-7B52D19ED401}.Release|Any CPU.ActiveCfg = Release|Any CPU {45BC8315-6AD6-4F3C-B590-7B52D19ED401}.Release|Any CPU.Build.0 = Release|Any CPU - {F3EECF86-A950-4CDE-82DD-DF270AFE86E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F3EECF86-A950-4CDE-82DD-DF270AFE86E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F3EECF86-A950-4CDE-82DD-DF270AFE86E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F3EECF86-A950-4CDE-82DD-DF270AFE86E2}.Release|Any CPU.Build.0 = Release|Any CPU {D7BA6070-909F-402E-A6F4-1CE54A7BE0B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D7BA6070-909F-402E-A6F4-1CE54A7BE0B7}.Debug|Any CPU.Build.0 = Debug|Any CPU {D7BA6070-909F-402E-A6F4-1CE54A7BE0B7}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/tests/Elastic.Apm.SerilogEnricher.Test/Elastic.Apm.SerilogEnricher.Test.csproj b/tests/Elastic.Apm.SerilogEnricher.Test/Elastic.Apm.SerilogEnricher.Test.csproj index 90b6ecc2..2a5cda9e 100644 --- a/tests/Elastic.Apm.SerilogEnricher.Test/Elastic.Apm.SerilogEnricher.Test.csproj +++ b/tests/Elastic.Apm.SerilogEnricher.Test/Elastic.Apm.SerilogEnricher.Test.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.0 + netcoreapp3.0 From 08e213cb8cde0b17390d395b7743ce4ef4b26cb3 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 11 Dec 2019 15:25:19 +0100 Subject: [PATCH 04/18] package icon and url, scripts no longer pack and we validate artifacts again --- build/scripts/Releasing.fs | 10 ++++++++-- build/scripts/Versioning.fs | 4 ++-- build/scripts/scripts.fsproj | 1 + src/Elastic.CommonSchemaNEST/TypeMappings.Generated.cs | 9 ++++----- src/PublishArtifacts.build.props | 1 + 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/build/scripts/Releasing.fs b/build/scripts/Releasing.fs index 6500a05c..8ffb682c 100644 --- a/build/scripts/Releasing.fs +++ b/build/scripts/Releasing.fs @@ -63,5 +63,11 @@ module Release = callback p nugetId nuspec properties version ) - let NugetPack (ArtifactsVersion(version)) = packProjects version nugetPackMain - + let NugetPack (ArtifactsVersion(version)) = + + Tooling.DotNet.ExecIn "src" [ "pack"; + "-c"; "Release"; + "--no-build"; + (sprintf "-p:Version=%s" <| version.Full.ToString()); + "--output"; (sprintf "../%s" <| Paths.BuildOutput) + ] |> ignore diff --git a/build/scripts/Versioning.fs b/build/scripts/Versioning.fs index 6c261fa4..7030073f 100644 --- a/build/scripts/Versioning.fs +++ b/build/scripts/Versioning.fs @@ -135,8 +135,8 @@ module Versioning = let ValidateArtifacts (ArtifactsVersion(version)) = let fileVersion = version.AssemblyFile - let tmp = "build/output/_packages/tmp" - !! "build/output/_packages/*.nupkg" + let tmp = "build/output/tmp" + !! "build/output/*.nupkg" |> Seq.iter(fun f -> Zip.unzip tmp f !! (sprintf "%s/**/*.dll" tmp) diff --git a/build/scripts/scripts.fsproj b/build/scripts/scripts.fsproj index 7b1f668b..c8cc6308 100644 --- a/build/scripts/scripts.fsproj +++ b/build/scripts/scripts.fsproj @@ -1,4 +1,5 @@  + netcoreapp3.0 Exe diff --git a/src/Elastic.CommonSchemaNEST/TypeMappings.Generated.cs b/src/Elastic.CommonSchemaNEST/TypeMappings.Generated.cs index f3fb0abf..bf49fa49 100644 --- a/src/Elastic.CommonSchemaNEST/TypeMappings.Generated.cs +++ b/src/Elastic.CommonSchemaNEST/TypeMappings.Generated.cs @@ -5,7 +5,7 @@ /* IMPORTANT NOTE ============== -This file has been generated. +This file has been generated. If you wish to submit a PR please modify the original csharp file and submit the PR with that change. Thanks! */ @@ -46,7 +46,7 @@ public static PutIndexTemplateDescriptor GetIndexTemplate(Name name) indexTemplate.IndexPatterns("ecs-*"); indexTemplate.Order(1); indexTemplate.Settings(s => - s.Setting("index", + s.Setting("index", new { refresh_interval = "5s", @@ -60,7 +60,7 @@ public static PutIndexTemplateDescriptor GetIndexTemplate(Name name) })); indexTemplate.Map(GetTypeMappingDescriptor()); - + return indexTemplate; } @@ -68,7 +68,6 @@ public static PutIndexTemplateDescriptor GetIndexTemplate(Name name) /// Get a type mapping descriptor for use with /// designed for use with Elastic Common Schema version 1.3.0 /// - /// An instance of . public static Func, ITypeMapping> GetTypeMappingDescriptor() { return map => @@ -420,4 +419,4 @@ public static Func, ITypeMapping> GetTypeMappingDesc ); } } -} \ No newline at end of file +} diff --git a/src/PublishArtifacts.build.props b/src/PublishArtifacts.build.props index 7352b2df..5cced4eb 100644 --- a/src/PublishArtifacts.build.props +++ b/src/PublishArtifacts.build.props @@ -11,6 +11,7 @@ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb true + https://raw.githubusercontent.com/elastic/ecs-dotnet/master/build/nuget-icon.png nuget-icon.png From 53662f04aac38fb569738fea536bfce18b89e02b Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 11 Dec 2019 15:31:58 +0100 Subject: [PATCH 05/18] remove the notion of Projects.fsx, handled in csproj files now --- build/scripts/Building.fs | 5 --- build/scripts/Commandline.fs | 2 -- build/scripts/Paths.fs | 8 ----- build/scripts/Projects.fs | 63 ------------------------------------ build/scripts/Releasing.fs | 59 --------------------------------- build/scripts/Tooling.fs | 5 ++- build/scripts/scripts.fsproj | 1 - 7 files changed, 2 insertions(+), 141 deletions(-) delete mode 100644 build/scripts/Projects.fs diff --git a/build/scripts/Building.fs b/build/scripts/Building.fs index 8fa9f6a5..59a0504c 100644 --- a/build/scripts/Building.fs +++ b/build/scripts/Building.fs @@ -3,7 +3,6 @@ open System.IO open Paths -open Projects open Tooling open Versioning open Fake.Core @@ -15,14 +14,11 @@ module Build = let Restore() = DotNet.Exec ["restore"; Solution; ] |> ignore let Compile args (ArtifactsVersion(version)) = - let sourceLink = if args.DoSourceLink then "1" else "" let props = [ "CurrentVersion", (version.Full.ToString()); "CurrentAssemblyVersion", (version.Assembly.ToString()); "CurrentAssemblyFileVersion", (version.AssemblyFile.ToString()); - "DoSourceLink", sourceLink; - "FakeBuild", "1"; "OutputPathBaseDir", Path.GetFullPath Paths.BuildOutput; ] |> List.map (fun (p,v) -> sprintf "%s=%s" p v) @@ -35,4 +31,3 @@ module Build = printfn "Cleaning known output folders" Shell.cleanDir Paths.BuildOutput DotNet.Exec ["clean"; Solution; "-c"; "Release"] |> ignore - DotNetProject.All |> Seq.iter(fun p -> Shell.cleanDir (Paths.BinFolder p.Name)) diff --git a/build/scripts/Commandline.fs b/build/scripts/Commandline.fs index 17cd7d9c..3b9a7221 100644 --- a/build/scripts/Commandline.fs +++ b/build/scripts/Commandline.fs @@ -41,7 +41,6 @@ Targets: ValidMonoTarget: bool; NeedsFullBuild: bool; NeedsClean: bool; - DoSourceLink: bool; CommandArguments: CommandArguments; } @@ -77,7 +76,6 @@ Targets: | ("diff") -> false | _ -> true; CommandArguments = Unknown - DoSourceLink = false } let arguments = diff --git a/build/scripts/Paths.fs b/build/scripts/Paths.fs index 67faeea4..cbe03a46 100644 --- a/build/scripts/Paths.fs +++ b/build/scripts/Paths.fs @@ -1,7 +1,5 @@ namespace Scripts -open Projects - module Paths = let OwnerName = "elastic" @@ -12,9 +10,6 @@ module Paths = let TargetsFolder = "build/scripts" let BuildOutput = sprintf "%s/output" BuildFolder - let ProjectOutputFolder (project:DotNetProject) (framework:DotNetFramework) = - sprintf "%s/%s/%s" BuildOutput project.Name framework.Identifier.Nuget - let Tool tool = sprintf "packages/build/%s" tool let CheckedInToolsFolder = "build/tools" let KeysFolder = sprintf "%s/keys" BuildFolder @@ -28,9 +23,6 @@ module Paths = let Output(folder) = sprintf "%s/%s" BuildOutput folder let Source(folder) = sprintf "%s/%s" SourceFolder folder - let ProjFile(project:DotNetProject) = - sprintf "%s/%s/%s.csproj" SourceFolder project.Name project.Name - let BinFolder (folder:string) = let f = folder.Replace(@"\", "/") sprintf "%s/%s/bin/Release" SourceFolder f diff --git a/build/scripts/Projects.fs b/build/scripts/Projects.fs deleted file mode 100644 index be2d942c..00000000 --- a/build/scripts/Projects.fs +++ /dev/null @@ -1,63 +0,0 @@ -namespace Scripts - -[] -module Projects = - type DotNetFrameworkIdentifier = { MSBuild: string; Nuget: string; DefineConstants: string; } - - type DotNetFramework = - | NetStandard2_0 - | Net461 - | NetCoreApp2_1 - static member All = [NetStandard2_0; Net461] - member this.Identifier = - match this with - | NetStandard2_0 -> { MSBuild = "netstandard2.0"; Nuget = "netstandard2.0"; DefineConstants = ""; } - | NetCoreApp2_1 -> { MSBuild = "netcoreapp2.1"; Nuget = "netcoreapp2.1"; DefineConstants = ""; } - | Net461 -> { MSBuild = "net461"; Nuget = "net461"; DefineConstants = ""; } - - type Project = - | CommonSchema - | CommonSchemaSerilog - - type PrivateProject = - | Generator - - type DotNetProject = - | Project of Project - | PrivateProject of PrivateProject - - static member All = - seq [ - Project Project.CommonSchema; - Project Project.CommonSchemaSerilog; - PrivateProject PrivateProject.Generator - ] - static member AllPublishable = - seq [ - Project Project.CommonSchema - Project Project.CommonSchemaSerilog - ] - - member this.Name = - match this with - | Project CommonSchema -> "Elastic.CommonSchema" - | Project CommonSchemaSerilog -> "Elastic.CommonSchema.Serilog" - | PrivateProject Generator -> "Generator" - - member this.NugetId = - match this with - | Project CommonSchema -> "Elastic.CommonSchema" - | Project CommonSchemaSerilog -> "Elastic.CommonSchema.Serilog" - | _ -> this.Name - - member this.Versioned name version = - match version with - | Some s -> sprintf "%s%s" name s - | None -> name - - type DotNetFrameworkProject = { framework: DotNetFramework; project: DotNetProject } - let AllPublishableProjectsWithSupportedFrameworks = seq { - for framework in DotNetFramework.All do - for project in DotNetProject.AllPublishable do - yield { framework = framework; project= project} - } diff --git a/build/scripts/Releasing.fs b/build/scripts/Releasing.fs index 8ffb682c..147ae512 100644 --- a/build/scripts/Releasing.fs +++ b/build/scripts/Releasing.fs @@ -1,68 +1,9 @@ namespace Scripts -open System -open System.IO -open System.Linq -open System.Text -open System.Xml -open System.Xml.Linq -open System.Xml.XPath -open Fake.Core; - -open Projects open Versioning module Release = - let private year = sprintf "%i" DateTime.UtcNow.Year - - let private addKeyValue key value (builder:StringBuilder) = - if (not (String.IsNullOrEmpty value)) then builder.AppendFormat("{0}=\"{1}\";", key, value) - else builder - - let private currentMajorVersion version = sprintf "%i" <| version.Full.Major - let private nextMajorVersion version = sprintf "%i" <| version.Full.Major + 1u - - let private props version = - let currentMajorVersion = currentMajorVersion version - let nextMajorVersion = nextMajorVersion version - new StringBuilder() - |> addKeyValue "currentMajorVersion" currentMajorVersion - |> addKeyValue "nextMajorVersion" nextMajorVersion - |> addKeyValue "year" year - - let pack file n properties version = - Tooling.DotNet.Exec [ "pack"; file; - "--no-build"; - "-version"; version.Full.ToString(); - "-output"; Paths.BuildOutput; - ] |> ignore - printfn "%s" Paths.BuildOutput - let file = sprintf "%s.%O.nupkg" n version.Full - let nugetOutFile = Paths.Output(file) - let outputFile = Path.Combine(Paths.NugetOutput, file) - - File.Move(nugetOutFile, outputFile) - - let private nugetPackMain (_:DotNetProject) nugetId nuspec properties version = - pack nuspec nugetId properties version - - let private packProjects version callback = - Directory.CreateDirectory Paths.NugetOutput |> ignore - - DotNetProject.AllPublishable - |> Seq.iter(fun p -> - - let properties = - props version - |> StringBuilder.toText - - let nugetId = p.NugetId - let nuspec = (sprintf @"build/%s.nuspec" nugetId) - - callback p nugetId nuspec properties version - ) - let NugetPack (ArtifactsVersion(version)) = Tooling.DotNet.ExecIn "src" [ "pack"; diff --git a/build/scripts/Tooling.fs b/build/scripts/Tooling.fs index 0e068677..1dd301fa 100644 --- a/build/scripts/Tooling.fs +++ b/build/scripts/Tooling.fs @@ -57,7 +57,6 @@ module Tooling = member this.ExecIn workingDirectory arguments = this.ExecInWithTimeout workingDirectory arguments timeout member this.Exec arguments = this.ExecWithTimeout arguments timeout - let nugetFile = Path.GetFullPath "build/scripts/bin/Release/netcoreapp2.2/NuGet.exe" - let Nuget = BuildTooling(None, nugetFile) - let ILRepack = BuildTooling(None, "build/scripts/bin/Release/netcoreapp2.2/ILRepack.exe") + //used by differ + let nugetFile = Path.GetFullPath "build/scripts/bin/Release/netcoreapp3.0/NuGet.exe" let DotNet = BuildTooling(Some <| TimeSpan.FromMinutes(5.), "dotnet") diff --git a/build/scripts/scripts.fsproj b/build/scripts/scripts.fsproj index c8cc6308..1ceddd3f 100644 --- a/build/scripts/scripts.fsproj +++ b/build/scripts/scripts.fsproj @@ -8,7 +8,6 @@ - From 5277fb637a3ab899e8d72c76e90b86a2e7d52f91 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 11 Dec 2019 15:36:24 +0100 Subject: [PATCH 06/18] clean up Paths --- build/scripts/Paths.fs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/build/scripts/Paths.fs b/build/scripts/Paths.fs index cbe03a46..ab44ba43 100644 --- a/build/scripts/Paths.fs +++ b/build/scripts/Paths.fs @@ -6,23 +6,11 @@ module Paths = let RepositoryName = "ecs-dotnet" let Repository = sprintf "https://github.com/%s/%s" OwnerName RepositoryName - let BuildFolder = "build" + let private buildFolder = "build" let TargetsFolder = "build/scripts" - let BuildOutput = sprintf "%s/output" BuildFolder - - let Tool tool = sprintf "packages/build/%s" tool - let CheckedInToolsFolder = "build/tools" - let KeysFolder = sprintf "%s/keys" BuildFolder - let NugetOutput = sprintf "%s/_packages" BuildOutput - let SourceFolder = "src" + let BuildOutput = sprintf "%s/output" buildFolder let Solution = "src/ecs-dotnet.sln" - let CheckedInTool(tool) = sprintf "%s/%s" CheckedInToolsFolder tool - let Keys(keyFile) = sprintf "%s/%s" KeysFolder keyFile let Output(folder) = sprintf "%s/%s" BuildOutput folder - let Source(folder) = sprintf "%s/%s" SourceFolder folder - let BinFolder (folder:string) = - let f = folder.Replace(@"\", "/") - sprintf "%s/%s/bin/Release" SourceFolder f From a31472ecb5e10b2a09460f877dbb44cde5731ecb Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 11 Dec 2019 15:40:35 +0100 Subject: [PATCH 07/18] allow on nuget publishing on this branch temporarily --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index de80dc97..f20bf62c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,14 +10,14 @@ install: build_script: - cmd: build.bat canary -nuget: - disable_publish_on_pr: true +#nuget: +# disable_publish_on_pr: true for: - branches: only: - - /^(master|\d+\.x)$/ + - /^(master|\d+\.x|feature\/ci)$/ artifacts: - path: .\build\output\_packages\*.nupkg name: NuGet From ec5ccac487fc734f716c9068357c4ccac02cf5ab Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 11 Dec 2019 15:49:26 +0100 Subject: [PATCH 08/18] add azure-pipelines.yml --- azure-pipelines.yml | 30 ++++++++++++++++++++++++++++++ build/scripts/Testing.fs | 5 +++-- build/scripts/scripts.fsproj | 3 +++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..a65b7794 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,30 @@ +jobs: +- job: LinuxUnitTests + pool: + vmImage: 'ubuntu-16.04' + steps: + - task: UseDotNet@2 + inputs: + version: '3.0.100' + - script: ./build.sh test + displayName: 'build and unit test' + - task: PublishTestResults@2 + inputs: + testRunner: VSTest + testResultsFiles: 'tests/**/*.trx' + testRunTitle: Linux Unit Tests + +- job: WindowsUnitTests + pool: + vmImage: 'vs2017-win2016' + steps: + - task: UseDotNet@2 + inputs: + version: '3.0.100' + - script: build.bat test + displayName: 'build and unit test' + - task: PublishTestResults@2 + inputs: + testRunner: VSTest + testResultsFiles: 'tests/**/*.trx' + testRunTitle: Windows Unit Tests diff --git a/build/scripts/Testing.fs b/build/scripts/Testing.fs index 4e879b20..e9db9782 100644 --- a/build/scripts/Testing.fs +++ b/build/scripts/Testing.fs @@ -9,7 +9,8 @@ open Commandline open Versioning module Tests = - + let private buildingOnAzurePipeline = Environment.environVarAsBool "TF_BUILD" + let TestAll () = Directory.CreateDirectory Paths.BuildOutput |> ignore let command = @@ -26,7 +27,7 @@ module Tests = // https://github.com/tonerdo/coverlet/issues/110 // Bites us here as well a PR is up already but not merged will try again afterwards // https://github.com/tonerdo/coverlet/pull/329 - match false with + match buildingOnAzurePipeline with | true -> [ "--logger"; "trx"; "--collect"; "\"Code Coverage\""; "-v"; "m"] |> List.append command | _ -> command diff --git a/build/scripts/scripts.fsproj b/build/scripts/scripts.fsproj index 1ceddd3f..031501c3 100644 --- a/build/scripts/scripts.fsproj +++ b/build/scripts/scripts.fsproj @@ -22,6 +22,9 @@ build.sh build.bat appveyor.yml + + azure-pipelines.yml + From 359ce0f4aacbbcde9b06c1bf0d6e8db498c6e9e6 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 11 Dec 2019 15:53:13 +0100 Subject: [PATCH 09/18] skip unit tests that does IO --- .../Elastic.CommonSchema.Serilog.Tests/FileOutputTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Elastic.CommonSchema.Serilog.Tests/Elastic.CommonSchema.Serilog.Tests/FileOutputTests.cs b/tests/Elastic.CommonSchema.Serilog.Tests/Elastic.CommonSchema.Serilog.Tests/FileOutputTests.cs index 3c2b8b8e..2dabe498 100644 --- a/tests/Elastic.CommonSchema.Serilog.Tests/Elastic.CommonSchema.Serilog.Tests/FileOutputTests.cs +++ b/tests/Elastic.CommonSchema.Serilog.Tests/Elastic.CommonSchema.Serilog.Tests/FileOutputTests.cs @@ -24,7 +24,7 @@ public FileOutputTests(ITestOutputHelper output) : base(output) => //TODO not a unit test does IO //Run only on CI with a skip attribute - [Fact] + [Fact(Skip = "This does actual IO and will fail on CI")] public void WritesToFileUsingStream() => TestLogger((logger, getLogEvents) => { try From d9c3d3e4a98a7c2dfaf7dfdfdc759501ed1851c3 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 11 Dec 2019 16:02:16 +0100 Subject: [PATCH 10/18] make sure tests build with version too --- build/scripts/Targets.fs | 2 +- build/scripts/Testing.fs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build/scripts/Targets.fs b/build/scripts/Targets.fs index cbf003ee..3aebd504 100644 --- a/build/scripts/Targets.fs +++ b/build/scripts/Targets.fs @@ -57,7 +57,7 @@ module Main = ] command "build" buildChain <| fun _ -> printfn "STARTING BUILD" - target "test" Tests.TestAll + target "test" <| fun _ -> Tests.TestAll artifactsVersion command "canary" [ "version"; "release";] <| fun _ -> printfn "Finished Release Build %O" artifactsVersion diff --git a/build/scripts/Testing.fs b/build/scripts/Testing.fs index e9db9782..e770a5e6 100644 --- a/build/scripts/Testing.fs +++ b/build/scripts/Testing.fs @@ -11,10 +11,13 @@ open Versioning module Tests = let private buildingOnAzurePipeline = Environment.environVarAsBool "TF_BUILD" - let TestAll () = + let TestAll (ArtifactsVersion(version)) = Directory.CreateDirectory Paths.BuildOutput |> ignore let command = - let p = ["test"; "."; "-c"; "RELEASE"] + let p = [ + "test"; "."; "-c"; "RELEASE"; + (sprintf "-p:Version=%s" <| version.Full.ToString()); + ] //make sure we only test netcoreapp on linux or requested on the command line to only test-one match Environment.isLinux with | true -> From 2a1c1493d49b9e56e51d4caeb743e61e41dadbb3 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 11 Dec 2019 16:18:40 +0100 Subject: [PATCH 11/18] remove no build from pack --- build/scripts/Releasing.fs | 1 - 1 file changed, 1 deletion(-) diff --git a/build/scripts/Releasing.fs b/build/scripts/Releasing.fs index 147ae512..ac61e484 100644 --- a/build/scripts/Releasing.fs +++ b/build/scripts/Releasing.fs @@ -8,7 +8,6 @@ module Release = Tooling.DotNet.ExecIn "src" [ "pack"; "-c"; "Release"; - "--no-build"; (sprintf "-p:Version=%s" <| version.Full.ToString()); "--output"; (sprintf "../%s" <| Paths.BuildOutput) ] |> ignore From 7c9d883f8428e55a6f6890030ed5b8c859a89cb3 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 11 Dec 2019 16:28:22 +0100 Subject: [PATCH 12/18] pass explicit version information to pack --- build/scripts/Releasing.fs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/scripts/Releasing.fs b/build/scripts/Releasing.fs index ac61e484..096c4441 100644 --- a/build/scripts/Releasing.fs +++ b/build/scripts/Releasing.fs @@ -9,5 +9,8 @@ module Release = Tooling.DotNet.ExecIn "src" [ "pack"; "-c"; "Release"; (sprintf "-p:Version=%s" <| version.Full.ToString()); + (sprintf "-p:CurrentVersion=%s" <| version.Full.ToString()); + (sprintf "-p:CurrentAssemblyVersion=%s" <| version.Assembly.ToString()); + (sprintf "-p:CurrentAssemblyFileVersion=%s" <| version.AssemblyFile.ToString()); "--output"; (sprintf "../%s" <| Paths.BuildOutput) ] |> ignore From 8da8155a867448bca13acf00f342efe10e8973d7 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 11 Dec 2019 16:39:22 +0100 Subject: [PATCH 13/18] Azure devops linking is broken so removing that integration for now (wanted to use coverage view) --- azure-pipelines.yml | 30 ------------------------------ build/scripts/Testing.fs | 3 +-- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index a65b7794..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,30 +0,0 @@ -jobs: -- job: LinuxUnitTests - pool: - vmImage: 'ubuntu-16.04' - steps: - - task: UseDotNet@2 - inputs: - version: '3.0.100' - - script: ./build.sh test - displayName: 'build and unit test' - - task: PublishTestResults@2 - inputs: - testRunner: VSTest - testResultsFiles: 'tests/**/*.trx' - testRunTitle: Linux Unit Tests - -- job: WindowsUnitTests - pool: - vmImage: 'vs2017-win2016' - steps: - - task: UseDotNet@2 - inputs: - version: '3.0.100' - - script: build.bat test - displayName: 'build and unit test' - - task: PublishTestResults@2 - inputs: - testRunner: VSTest - testResultsFiles: 'tests/**/*.trx' - testRunTitle: Windows Unit Tests diff --git a/build/scripts/Testing.fs b/build/scripts/Testing.fs index e770a5e6..86486f1a 100644 --- a/build/scripts/Testing.fs +++ b/build/scripts/Testing.fs @@ -9,7 +9,6 @@ open Commandline open Versioning module Tests = - let private buildingOnAzurePipeline = Environment.environVarAsBool "TF_BUILD" let TestAll (ArtifactsVersion(version)) = Directory.CreateDirectory Paths.BuildOutput |> ignore @@ -30,7 +29,7 @@ module Tests = // https://github.com/tonerdo/coverlet/issues/110 // Bites us here as well a PR is up already but not merged will try again afterwards // https://github.com/tonerdo/coverlet/pull/329 - match buildingOnAzurePipeline with + match false with | true -> [ "--logger"; "trx"; "--collect"; "\"Code Coverage\""; "-v"; "m"] |> List.append command | _ -> command From 47f3c39fe65ac08a4f2f0d5a248617745f96b326 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 11 Dec 2019 16:47:40 +0100 Subject: [PATCH 14/18] unlink azure-pipelines.yml from solution --- build/scripts/scripts.fsproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/build/scripts/scripts.fsproj b/build/scripts/scripts.fsproj index 031501c3..1ceddd3f 100644 --- a/build/scripts/scripts.fsproj +++ b/build/scripts/scripts.fsproj @@ -22,9 +22,6 @@ build.sh build.bat appveyor.yml - - azure-pipelines.yml - From 646e210650284aa7106196d8135e3ffa6fb5280d Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 11 Dec 2019 16:48:44 +0100 Subject: [PATCH 15/18] remove nuspec files --- build/Elastic.CommonSchema.Serilog.nuspec | 44 ----------------------- build/Elastic.CommonSchema.nuspec | 34 ------------------ src/ecs-dotnet.sln | 2 -- 3 files changed, 80 deletions(-) delete mode 100644 build/Elastic.CommonSchema.Serilog.nuspec delete mode 100644 build/Elastic.CommonSchema.nuspec diff --git a/build/Elastic.CommonSchema.Serilog.nuspec b/build/Elastic.CommonSchema.Serilog.nuspec deleted file mode 100644 index e0645b78..00000000 --- a/build/Elastic.CommonSchema.Serilog.nuspec +++ /dev/null @@ -1,44 +0,0 @@ - - - - Elastic.CommonSchema.Serilog - $version$ - Elastic Common Schema Serilog integration - Elastic and contributors - Elastic - license.txt - https://github.com/elastic/ecs-dotnet - https://raw.githubusercontent.com/elastic/ecs-dotnet/master/build/nuget-icon.png - false - Elastic.CommonSchema.Serilog - The Elastic Common Schema (ECS) defines a common set of fields for ingesting data into Elasticsearch. A common schema helps you correlate data from sources like logs and metrics or IT operations analytics and security analytics. This package contains a Serilog integration for formatting errors in ECS JSON format. - See https://github.com/elastic/ecs-dotnet/releases/tag/$version$ - 2018-$year$ Elasticsearch BV - elasticsearch,elastic,ecs,elasticcommonschema - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/Elastic.CommonSchema.nuspec b/build/Elastic.CommonSchema.nuspec deleted file mode 100644 index e93d0960..00000000 --- a/build/Elastic.CommonSchema.nuspec +++ /dev/null @@ -1,34 +0,0 @@ - - - - Elastic.CommonSchema - $version$ - Elastic Common Schema .NET types - Elastic and contributors - Elastic - license.txt - https://github.com/elastic/ecs-dotnet - https://raw.githubusercontent.com/elastic/ecs-dotnet/master/build/nuget-icon.png - images\nuget-icon.png - false - Elastic.CommonSchema - The Elastic Common Schema (ECS) defines a common set of fields for ingesting data into Elasticsearch. A common schema helps you correlate data from sources like logs and metrics or IT operations analytics and security analytics. This package contains .NET types that conform to this schema. - See https://github.com/elastic/ecs-dotnet/releases/tag/$version$ - 2018-$year$ Elasticsearch BV - elasticsearch,elastic,ecs,elasticcommonschema - - - - - - - - - - - - - - - - diff --git a/src/ecs-dotnet.sln b/src/ecs-dotnet.sln index 48e5acfe..f5590bca 100644 --- a/src/ecs-dotnet.sln +++ b/src/ecs-dotnet.sln @@ -38,8 +38,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{2A5FBCFE ProjectSection(SolutionItems) = preProject Library.build.props = Library.build.props PublishArtifacts.build.props = PublishArtifacts.build.props - ..\build\Elastic.CommonSchema.nuspec = ..\build\Elastic.CommonSchema.nuspec - ..\build\Elastic.CommonSchema.Serilog.nuspec = ..\build\Elastic.CommonSchema.Serilog.nuspec EndProjectSection EndProject Global From 11fa4ff8a5dfd23592024b55ffd744675babf4cf Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Thu, 12 Dec 2019 08:22:07 +0100 Subject: [PATCH 16/18] fix formatting of build.props --- src/Library.build.props | 46 ++++++++++++++++---------------- src/PublishArtifacts.build.props | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/Library.build.props b/src/Library.build.props index 19e073a5..3364b01d 100644 --- a/src/Library.build.props +++ b/src/Library.build.props @@ -8,18 +8,18 @@ portable - - 1.0.0 - 1.0.0 - 1.0.0 - - $(CurrentVersion) - $(CurrentVersion) - - $(CurrentAssemblyVersion) - - $(CurrentAssemblyFileVersion) - true + + 1.0.0 + 1.0.0 + 1.0.0 + + $(CurrentVersion) + $(CurrentVersion) + + $(CurrentAssemblyVersion) + + $(CurrentAssemblyFileVersion) + true $(DefineConstants);FULLFRAMEWORK @@ -27,18 +27,18 @@ false - https://raw.githubusercontent.com/elastic/ecs-dotnet + https://raw.githubusercontent.com/elastic/ecs-dotnet Elastic and contributors - Elasticsearch BV + Elasticsearch BV Apache-2.0 $(OutputPathBaseDir) - - https://github.com/elastic/ecs-dotnet - See https://github.com/elastic/ecs-dotnet/releases - - latest - - - - + + https://github.com/elastic/ecs-dotnet + See https://github.com/elastic/ecs-dotnet/releases + + latest + + + + \ No newline at end of file diff --git a/src/PublishArtifacts.build.props b/src/PublishArtifacts.build.props index 5cced4eb..f6fb21e8 100644 --- a/src/PublishArtifacts.build.props +++ b/src/PublishArtifacts.build.props @@ -2,7 +2,7 @@ - + true true From 60e7db5c03872a1afd30b6869f8afa244182730b Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Thu, 12 Dec 2019 08:22:49 +0100 Subject: [PATCH 17/18] move appveyor only to integration branches --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f20bf62c..de80dc97 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,14 +10,14 @@ install: build_script: - cmd: build.bat canary -#nuget: -# disable_publish_on_pr: true +nuget: + disable_publish_on_pr: true for: - branches: only: - - /^(master|\d+\.x|feature\/ci)$/ + - /^(master|\d+\.x)$/ artifacts: - path: .\build\output\_packages\*.nupkg name: NuGet From 80c7807f0f378fc949ad8d1fd186711a8104f202 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Thu, 12 Dec 2019 08:23:36 +0100 Subject: [PATCH 18/18] remove from generator cshtml as well --- src/Generator/Views/TypeMappings.Generated.cshtml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Generator/Views/TypeMappings.Generated.cshtml b/src/Generator/Views/TypeMappings.Generated.cshtml index cb2507b0..0064aa90 100644 --- a/src/Generator/Views/TypeMappings.Generated.cshtml +++ b/src/Generator/Views/TypeMappings.Generated.cshtml @@ -75,7 +75,6 @@ namespace Elastic.CommonSchema.Elasticsearch /// Get a type mapping descriptor for use with /// designed for use with Elastic Common Schema version @(Model.YamlSchemas.First().FullVersion) /// - /// An instance of . public static Func@(Raw(", ITypeMapping>")) GetTypeMappingDescriptor() { return map =>