Skip to content

Commit

Permalink
Update build.fsx
Browse files Browse the repository at this point in the history
  • Loading branch information
CumpsD authored Feb 27, 2023
1 parent d8cd212 commit 54eb406
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ let versionSuffix =

// Configuration values for tests
let testNetFrameworkVersion = "net48"
let testNetCoreVersion = "net7.0"
let testNetVersion = "net7.0"

printfn "Assembly version: %s\nNuget version; %s\n" releaseNotes.AssemblyVersion releaseNotes.NugetVersion
Expand Down Expand Up @@ -115,22 +114,6 @@ Target "Build" (fun _ ->
// Run tests
//--------------------------------------------------------------------------------

type Runtime =
| NetCore
| Net
| NetFramework

let getTestAssembly runtime project =
let assemblyPath = match runtime with
| NetCore -> !! ("src" @@ "**" @@ "bin" @@ "Release" @@ testNetCoreVersion @@ fileNameWithoutExt project + ".dll")
| NetFramework -> !! ("src" @@ "**" @@ "bin" @@ "Release" @@ testNetFrameworkVersion @@ fileNameWithoutExt project + ".dll")
| Net -> !! ("src" @@ "**" @@ "bin" @@ "Release" @@ testNetVersion @@ fileNameWithoutExt project + ".dll")

if Seq.isEmpty assemblyPath then
None
else
Some (assemblyPath |> Seq.head)

module internal ResultHandling =
let (|OK|Failure|) = function
| 0 -> OK
Expand Down Expand Up @@ -171,7 +154,7 @@ Target "RunTests" <| fun _ ->
CreateDir outputTests
projects |> Seq.iter (runSingleProject)

Target "RunTestsNetCore" <| fun _ ->
Target "RunTestsNet" <| fun _ ->
let projects =
match (isWindows) with
| true -> !! "./src/**/*.Tests.*sproj"
Expand All @@ -181,7 +164,7 @@ Target "RunTestsNetCore" <| fun _ ->

let runSingleProject project =
let arguments =
(sprintf "test -c Release --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s --results-directory \"%s\" -- -parallel none" testNetCoreVersion outputTests)
(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"
Expand Down Expand Up @@ -364,15 +347,15 @@ Target "Nuget" DoNothing

// test dependencies
"Build" ==> "RunTests"
"Build" ==> "RunTestsNetCore"
"Build" ==> "RunTestsNet"

// nuget dependencies
"BuildRelease" ==> "CreateNuget"
"CreateNuget" ==> "PublishNuget" ==> "Nuget"

"BuildRelease" ==> "All"
"RunTests" ==> "All"
"RunTestsNetCore" ==> "All"
"RunTestsNet" ==> "All"
"Nuget" ==> "All"

RunTargetOrDefault "Help"

0 comments on commit 54eb406

Please sign in to comment.