From 7493a799242e7444943a5a114456113eaf9f44bf Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Tue, 2 Mar 2021 16:19:16 +0000 Subject: [PATCH 1/4] Update locked mode settings --- Directory.Build.props | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Directory.Build.props b/Directory.Build.props index c6e4b63b181..78c1d56df56 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -33,6 +33,8 @@ $(OutputPathBaseDir)\$(MSBuildProjectName)\ $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.bat)) + true + true true $(DefineConstants);FULLFRAMEWORK From 8fc545b745ac413c8ac22a41d0ab25b0f14c2fcb Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 2 Mar 2021 18:11:56 +0100 Subject: [PATCH 2/4] --force-reeval on canary builds since these target local nuget packages not part of the locked packages --- build/scripts/Building.fs | 8 +++++++- build/scripts/Targets.fs | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build/scripts/Building.fs b/build/scripts/Building.fs index 6795d993ea5..cb6e98a3100 100644 --- a/build/scripts/Building.fs +++ b/build/scripts/Building.fs @@ -19,7 +19,13 @@ open System.IO.Compression module Build = - let Restore() = DotNet.Exec ["restore"; Paths.Solution; ] |> ignore + let Restore isCanary = + let args = + let a = ["restore"; Paths.Solution; ] + match isCanary with + | true -> a |> List.append [" --force-evaluate"] + | false -> a + DotNet.Exec args |> ignore let Compile _ version = let props = diff --git a/build/scripts/Targets.fs b/build/scripts/Targets.fs index c8aec684666..85ed2a0f64f 100644 --- a/build/scripts/Targets.fs +++ b/build/scripts/Targets.fs @@ -63,7 +63,7 @@ module Main = conditional "clean" parsed.ReleaseBuild <| fun _ -> Build.Clean parsed target "version" <| fun _ -> printfn "Artifacts Version: %O" artifactsVersion - target "restore" Build.Restore + target "restore" <| fun _ -> Build.Restore isCanary target "full-build" <| fun _ -> Build.Compile parsed artifactsVersion From 89b1c5b7a9685b996545a9c65c933299ba4e2274 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 2 Mar 2021 18:19:45 +0100 Subject: [PATCH 3/4] --force-evaluate only on restore for tests during release unit tests target --- build/scripts/Building.fs | 8 +------- build/scripts/Targets.fs | 5 ++--- build/scripts/Testing.fs | 3 ++- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/build/scripts/Building.fs b/build/scripts/Building.fs index cb6e98a3100..af4ba4d011e 100644 --- a/build/scripts/Building.fs +++ b/build/scripts/Building.fs @@ -19,13 +19,7 @@ open System.IO.Compression module Build = - let Restore isCanary = - let args = - let a = ["restore"; Paths.Solution; ] - match isCanary with - | true -> a |> List.append [" --force-evaluate"] - | false -> a - DotNet.Exec args |> ignore + let Restore () = DotNet.Exec ["restore"; Paths.Solution; ] |> ignore let Compile _ version = let props = diff --git a/build/scripts/Targets.fs b/build/scripts/Targets.fs index 85ed2a0f64f..7a7fa7e3cb4 100644 --- a/build/scripts/Targets.fs +++ b/build/scripts/Targets.fs @@ -63,8 +63,7 @@ module Main = conditional "clean" parsed.ReleaseBuild <| fun _ -> Build.Clean parsed target "version" <| fun _ -> printfn "Artifacts Version: %O" artifactsVersion - target "restore" <| fun _ -> Build.Restore isCanary - + target "restore" Build.Restore target "full-build" <| fun _ -> Build.Compile parsed artifactsVersion //TEST @@ -95,7 +94,7 @@ module Main = Fake.IO.Shell.cp_r Paths.BuildOutput path printfn "Finished Release Build %O, output copied to: %s" artifactsVersion path - conditional "test-nuget-package" (not parsed.SkipTests) <| fun _ -> Tests.RunReleaseUnitTests artifactsVersion parsed + conditional "test-nuget-package" (not parsed.SkipTests) <| fun _ -> Tests.RunReleaseUnitTests artifactsVersion parsed isCanary //CANARY command "canary" canaryChain <| fun _ -> printfn "Finished Release Build %O" artifactsVersion diff --git a/build/scripts/Testing.fs b/build/scripts/Testing.fs index b1b6864b12d..4ee2b6db4a2 100644 --- a/build/scripts/Testing.fs +++ b/build/scripts/Testing.fs @@ -70,7 +70,8 @@ module Tests = //package and not one from cache...y Environment.setEnvironVar "TestPackageVersion" (version.Full.ToString()) Tooling.DotNet.ExecIn "tests/Tests" ["clean";] |> ignore - Tooling.DotNet.ExecIn "tests/Tests" ["restore";] |> ignore + // needs forced eval because it picks up local nuget packages not part of package.lock.json + Tooling.DotNet.ExecIn "tests/Tests" ["restore"; "--force-evaluate"] |> ignore dotnetTest "tests/Tests/Tests.csproj" args let RunUnitTests args = From a1e37fa84ae927e17664c781a28f2d81c191df38 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Tue, 2 Mar 2021 18:22:46 +0100 Subject: [PATCH 4/4] trailing isCanary --- build/scripts/Targets.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/scripts/Targets.fs b/build/scripts/Targets.fs index 7a7fa7e3cb4..fc43a0b3a98 100644 --- a/build/scripts/Targets.fs +++ b/build/scripts/Targets.fs @@ -94,8 +94,8 @@ module Main = Fake.IO.Shell.cp_r Paths.BuildOutput path printfn "Finished Release Build %O, output copied to: %s" artifactsVersion path - conditional "test-nuget-package" (not parsed.SkipTests) <| fun _ -> Tests.RunReleaseUnitTests artifactsVersion parsed isCanary - + conditional "test-nuget-package" (not parsed.SkipTests) <| fun _ -> Tests.RunReleaseUnitTests artifactsVersion parsed + //CANARY command "canary" canaryChain <| fun _ -> printfn "Finished Release Build %O" artifactsVersion