Skip to content

Commit

Permalink
Merge branch 'dev' into dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkatufus authored Jul 8, 2021
2 parents d0a22fc + 77770e4 commit e46f7f6
Show file tree
Hide file tree
Showing 65 changed files with 2,250 additions and 209 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: nuget
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
18 changes: 15 additions & 3 deletions Hyperion.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2005
# Visual Studio Version 16
VisualStudioVersion = 16.0.31112.23
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hyperion", "src\Hyperion\Hyperion.csproj", "{7AF8D2B6-9F1F-4A1C-8673-48E533108385}"
EndProject
Expand All @@ -19,7 +19,11 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Hyperion.Tests.FSharpData",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hyperion.Benchmarks", "src\Hyperion.Benchmarks\Hyperion.Benchmarks.csproj", "{CAE2DB69-0BE7-4B11-96DB-D5B61D35607F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hyperion.Tests", "src\Hyperion.Tests\Hyperion.Tests.csproj", "{EA096BA2-3B4C-4878-B9AD-5A88D164EBF0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hyperion.Tests", "src\Hyperion.Tests\Hyperion.Tests.csproj", "{EA096BA2-3B4C-4878-B9AD-5A88D164EBF0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hyperion.Akka.Integration.Tests", "src\Hyperion.Akka.Integration.Tests\Hyperion.Akka.Integration.Tests.csproj", "{3DA946AF-0CCD-49A9-AA77-67FA515A83EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hyperion.API.Tests", "src\Hyperion.API.Tests\Hyperion.API.Tests.csproj", "{767FBBD2-869C-4AAD-ABF4-F23EC0D381AA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -43,6 +47,14 @@ Global
{EA096BA2-3B4C-4878-B9AD-5A88D164EBF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA096BA2-3B4C-4878-B9AD-5A88D164EBF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA096BA2-3B4C-4878-B9AD-5A88D164EBF0}.Release|Any CPU.Build.0 = Release|Any CPU
{3DA946AF-0CCD-49A9-AA77-67FA515A83EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3DA946AF-0CCD-49A9-AA77-67FA515A83EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3DA946AF-0CCD-49A9-AA77-67FA515A83EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3DA946AF-0CCD-49A9-AA77-67FA515A83EE}.Release|Any CPU.Build.0 = Release|Any CPU
{767FBBD2-869C-4AAD-ABF4-F23EC0D381AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{767FBBD2-869C-4AAD-ABF4-F23EC0D381AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{767FBBD2-869C-4AAD-ABF4-F23EC0D381AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{767FBBD2-869C-4AAD-ABF4-F23EC0D381AA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

[![Join the chat at https://gitter.im/akkadotnet/Hyperion](https://badges.gitter.im/akkadotnet/Hyperion.svg)](https://gitter.im/akkadotnet/Hyperion?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

A high performance polymorphic serializer for the .NET framework, fork of the [Wire](https://github.com/rogeralsing/Wire) serializer.
A high performance polymorphic serializer for the .NET framework.

Current status: **BETA** (v0.9.7).
Current status: **BETA** (v0.9.14).

## License
Licensed under Apache 2.0, see [LICENSE](LICENSE) for the full text.
Expand Down
7 changes: 5 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 0.9.11 November 13 2019 ####
### 0.10.2 June 30 2021 ####
* [Update Akka version to 1.4.21](https://github.com/akkadotnet/akka.net/releases/tag/1.4.21)
* [Add exception rethrow to help with debugging](https://github.com/akkadotnet/Hyperion/pull/229)

[Hyperion now targets .NET 4.5 again so it can be included inside Akka.NET v1.3.* releases](https://github.com/akkadotnet/Hyperion/pull/141).
### 0.10.1 April 20 2021 ####
* [Fix SerializerOptions constructor backward compatibility issue with Akka.NET](https://github.com/akkadotnet/Hyperion/pull/214)
9 changes: 9 additions & 0 deletions build-system/azure-pipeline.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ jobs:
clean: false # whether to fetch clean each time
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
persistCredentials: true
- task: UseDotNet@2
displayName: 'Use .NET 5 SDK 5.0.101'
inputs:
version: 5.0.101
- task: UseDotNet@2
displayName: 'Use .NET Core Runtime 3.1.10'
inputs:
packageType: runtime
version: 3.1.10
# Linux or macOS
- task: Bash@3
displayName: Linux / OSX Build
Expand Down
4 changes: 2 additions & 2 deletions build-system/windows-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ steps:
displayName: 'FAKE Build'
inputs:
filename: build.cmd
arguments: 'All SignClientUser=$(signingUsername) SignClientSecret=$(signingPassword) nugetpublishurl=https://www.nuget.org/api/v2/package nugetkey=$(hyperionKey)'
arguments: 'nuget nugetpublishurl=https://www.nuget.org/api/v2/package nugetkey=$(hyperionKey)'

- task: GitHubRelease@0
displayName: 'GitHub release (create)'
Expand All @@ -35,4 +35,4 @@ steps:
title: '$(projectName) v$(Build.SourceBranchName)'
releaseNotesFile: 'RELEASE_NOTES.md'
assets: |
bin\nuget\*.nupkg
bin\nuget\*.nupkg
171 changes: 124 additions & 47 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ open System.Text
open Fake
open Fake.DotNetCli
open Fake.DocFxHelper
open Fake.NuGet.Install

// Information about the project for Nuget and Assembly info files
let product = "Hyperion"
Expand All @@ -18,36 +19,58 @@ let signingName = "Hyperion"
let signingDescription = "A high performance polymorphic serializer for the .NET framework"
let signingUrl = ""

// Directories
let toolsDir = __SOURCE_DIRECTORY__ @@ "tools"
let output = __SOURCE_DIRECTORY__ @@ "bin"
let outputTests = __SOURCE_DIRECTORY__ @@ "TestResults"
let outputPerfTests = __SOURCE_DIRECTORY__ @@ "PerfResults"
let outputBinaries = output @@ "binaries"
let outputBinariesNet461 = outputBinaries @@ "net461"
let outputBinariesNetStandard = outputBinaries @@ "netstandard2.0"
let outputBinariesNet = outputBinaries @@ "net5.0"
let outputNuGet = output @@ "nuget"

// Read release notes and version
let solutionFile = FindFirstMatchingFile "*.sln" __SOURCE_DIRECTORY__ // dynamically look up the solution
let buildNumber = environVarOrDefault "BUILD_NUMBER" "0"
let hasTeamCity = (not (buildNumber = "0")) // check if we have the TeamCity environment variable for build # set
let preReleaseVersionSuffix = "beta" + (if (not (buildNumber = "0")) then (buildNumber) else DateTime.UtcNow.Ticks.ToString())
let versionSuffix =
match (getBuildParam "nugetprerelease") with
| "dev" -> preReleaseVersionSuffix
| _ -> ""

let releaseNotes =
File.ReadLines "./RELEASE_NOTES.md"
File.ReadLines (__SOURCE_DIRECTORY__ @@ "RELEASE_NOTES.md")
|> ReleaseNotesHelper.parseReleaseNotes

// Directories
let toolsDir = __SOURCE_DIRECTORY__ @@ "tools"
let output = __SOURCE_DIRECTORY__ @@ "bin"
let outputTests = __SOURCE_DIRECTORY__ @@ "TestResults"
let outputPerfTests = __SOURCE_DIRECTORY__ @@ "PerfResults"
let outputNuGet = output @@ "nuget"
let versionFromReleaseNotes =
match releaseNotes.SemVer.PreRelease with
| Some r -> r.Origin
| None -> ""

let versionSuffix =
match (getBuildParam "nugetprerelease") with
| "dev" -> preReleaseVersionSuffix
| "" -> versionFromReleaseNotes
| str -> str

// Configuration values for tests
let testNetFrameworkVersion = "net461"
let testNetCoreVersion = "netcoreapp3.1"
let testNetVersion = "net5.0"

Target "Clean" (fun _ ->
ActivateFinalTarget "KillCreatedProcesses"

CleanDir output
CleanDir outputTests
CleanDir outputPerfTests
CleanDir outputBinaries
CleanDir outputNuGet
CleanDir outputBinariesNet461
CleanDir outputBinariesNetStandard
CleanDir outputBinariesNet
CleanDir "docs/_site"

CleanDirs !! "./**/bin"
CleanDirs !! "./**/obj"
)

Target "AssemblyInfo" (fun _ ->
Expand All @@ -56,17 +79,20 @@ Target "AssemblyInfo" (fun _ ->
)

Target "Build" (fun _ ->
let additionalArgs = if versionSuffix.Length > 0 then [sprintf "/p:VersionSuffix=%s" versionSuffix] else []
DotNetCli.Build
(fun p ->
{ p with
Project = solutionFile
Configuration = configuration }) // "Rebuild"
Configuration = configuration
AdditionalArgs = additionalArgs }) // "Rebuild"
)


//--------------------------------------------------------------------------------
// Tests targets
//--------------------------------------------------------------------------------

module internal ResultHandling =
let (|OK|Failure|) = function
| 0 -> OK
Expand Down Expand Up @@ -94,8 +120,32 @@ Target "RunTests" (fun _ ->
let runSingleProject project =
let arguments =
match (hasTeamCity) with
| true -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --results-directory %s -- -parallel none -teamcity" (outputTests))
| false -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --results-directory %s -- -parallel none" (outputTests))
| true -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none -teamcity" testNetFrameworkVersion outputTests)
| false -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none" testNetFrameworkVersion outputTests)

let result = ExecProcess(fun info ->
info.FileName <- "dotnet"
info.WorkingDirectory <- (Directory.GetParent project).FullName
info.Arguments <- arguments) (TimeSpan.FromMinutes 30.0)

ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result

CreateDir outputTests
projects |> Seq.iter (log)
projects |> Seq.iter (runSingleProject)
)

Target "RunTestsNetCore" (fun _ ->
let projects =
match (isWindows) with
| true -> !! "./src/**/*.Tests.csproj"
| _ -> !! "./src/**/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here

let runSingleProject project =
let arguments =
match (hasTeamCity) with
| true -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none -teamcity" testNetCoreVersion outputTests)
| false -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none" testNetCoreVersion outputTests)

let result = ExecProcess(fun info ->
info.FileName <- "dotnet"
Expand All @@ -104,44 +154,64 @@ Target "RunTests" (fun _ ->

ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result

CreateDir outputTests
projects |> Seq.iter (log)
projects |> Seq.iter (runSingleProject)
)

Target "RunTestsNet" (fun _ ->
let projects =
match (isWindows) with
| true -> !! "./src/**/*.Tests.csproj"
| _ -> !! "./src/**/*.Tests.csproj" // if you need to filter specs for Linux vs. Windows, do it here

let runSingleProject project =
let arguments =
match (hasTeamCity) with
| true -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none -teamcity" testNetVersion outputTests)
| false -> (sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none" testNetVersion outputTests)

let result = ExecProcess(fun info ->
info.FileName <- "dotnet"
info.WorkingDirectory <- (Directory.GetParent project).FullName
info.Arguments <- arguments) (TimeSpan.FromMinutes 30.0)

ResultHandling.failBuildIfXUnitReportedError TestRunnerErrorLevel.Error result

CreateDir outputTests
projects |> Seq.iter (log)
projects |> Seq.iter (runSingleProject)
)

Target "NBench" <| fun _ ->
let nbenchTestPath = findToolInSubPath "NBench.Runner.exe" (toolsDir @@ "NBench.Runner*")
printfn "Using NBench.Runner: %s" nbenchTestPath

let nbenchTestAssemblies = !! "./src/**/bin/**/*Tests.Performance.dll" // doesn't support .NET Core at the moment

let runNBench assembly =
let includes = getBuildParam "include"
let excludes = getBuildParam "exclude"
let teamcityStr = (getBuildParam "teamcity")
let enableTeamCity =
match teamcityStr with
| null -> false
| "" -> false
| _ -> bool.Parse teamcityStr

let args = StringBuilder()
|> append assembly
|> append (sprintf "output-directory=\"%s\"" outputPerfTests)
|> append (sprintf "concurrent=\"%b\"" true)
|> append (sprintf "trace=\"%b\"" true)
|> append (sprintf "teamcity=\"%b\"" enableTeamCity)
|> appendIfNotNullOrEmpty includes "include="
|> appendIfNotNullOrEmpty excludes "include="
ensureDirectory outputPerfTests
let projects =
match (isWindows) with
| true -> !! "./src/**/*Tests.Performance.csproj"
| _ -> !! "./src/**/*Tests.Performance.csproj" // if you need to filter specs for Linux vs. Windows, do it here

projects |> Seq.iter(fun project ->
let args = new StringBuilder()
|> append "run"
|> append "--no-build"
|> append "-c"
|> append configuration
|> append " -- "
|> append "--output"
|> append outputPerfTests
|> append "--concurrent"
|> append "true"
|> append "--trace"
|> append "true"
|> append "--diagnostic"
|> toText

let result = ExecProcess(fun info ->
info.FileName <- nbenchTestPath
info.WorkingDirectory <- (Path.GetDirectoryName (FullName nbenchTestPath))
info.Arguments <- args) (System.TimeSpan.FromMinutes 45.0) (* Reasonably long-running task. *)

if result <> 0 then failwithf "NBench.Runner failed. %s %s" nbenchTestPath args

nbenchTestAssemblies |> Seq.iter runNBench
let result = ExecProcess(fun info ->
info.FileName <- "dotnet"
info.WorkingDirectory <- (Directory.GetParent project).FullName
info.Arguments <- args) (System.TimeSpan.FromMinutes 15.0) (* Reasonably long-running task. *)
if result <> 0 then failwithf "NBench.Runner failed. %s %s" "dotnet" args
)


//--------------------------------------------------------------------------------
Expand Down Expand Up @@ -301,23 +371,30 @@ Target "Help" <| fun _ ->
Target "BuildRelease" DoNothing
Target "All" DoNothing
Target "Nuget" DoNothing
Target "RunTestsFull" DoNothing
Target "RunTestsNetCoreFull" DoNothing

// build dependencies
"Clean" ==> "AssemblyInfo" ==> "Build" ==> "BuildRelease"

// tests dependencies
"Build" ==> "RunTests"
"Build" ==> "RunTestsNetCore"
"Build" ==> "RunTestsNet"
"Build" ==> "NBench"

// nuget dependencies
"Clean" ==> "Build" ==> "CreateNuget"
"BuildRelease" ==> "CreateNuget"
"CreateNuget" ==> "SignPackages" ==> "PublishNuget" ==> "Nuget"

// docs
"Clean" ==> "BuildRelease" ==> "Docfx"
"BuildRelease" ==> "Docfx"

// all
"BuildRelease" ==> "All"
"RunTests" ==> "All"
"RunTestsNetCore" ==> "All"
"RunTestsNet" ==> "All"
"NBench" ==> "All"
"Nuget" ==> "All"

Expand Down
Loading

0 comments on commit e46f7f6

Please sign in to comment.