From ddd2a1c81ed69e2b6475d2055a5744f8f945d19f Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Sun, 12 Apr 2020 17:05:50 +0200 Subject: [PATCH] Build Framework: switch build functions to dotnet build --- build.fsx | 3 +- build/build-framework.fsx | 68 ++++------------------ src/Benchmark/LinearAlgebra/DenseVector.cs | 2 +- 3 files changed, 13 insertions(+), 60 deletions(-) diff --git a/build.fsx b/build.fsx index a9caebd0..b70f4d95 100644 --- a/build.fsx +++ b/build.fsx @@ -163,8 +163,7 @@ Target "Clean" (fun _ -> DeleteDirs (!! "src/**/obj/" ++ "src/**/bin/" ) CleanDirs [ "out/api"; "out/docs" ] CleanDirs [ "out/MKL"; "out/ATLAS"; "out/CUDA"; "out/OpenBLAS" ] // Native Providers - allSolutions |> List.iter (fun solution -> CleanDirs [ solution.OutputZipDir; solution.OutputNuGetDir; solution.OutputLibDir; solution.OutputLibStrongNameDir ]) - allSolutions |> List.iter clean) + allSolutions |> List.iter (fun solution -> CleanDirs [ solution.OutputZipDir; solution.OutputNuGetDir; solution.OutputLibDir; solution.OutputLibStrongNameDir ])) Target "ApplyVersion" (fun _ -> allProjects |> List.iter patchVersionInProjectFile diff --git a/build/build-framework.fsx b/build/build-framework.fsx index a351c20f..40588698 100644 --- a/build/build-framework.fsx +++ b/build/build-framework.fsx @@ -31,58 +31,12 @@ trace rootDir // .Net SDK // -------------------------------------------------------------------------------------- -let msbuild targets configuration project = - let properties = - [ - yield "Configuration", configuration - ] - MSBuildHelper.build (fun p -> - { p with - NoLogo = true - NodeReuse = false - Targets = targets - Properties = properties - RestorePackagesFlag = false - Verbosity = Some MSBuildVerbosity.Minimal - }) project - -let msbuildWeak targets configuration project = - let properties = - [ - yield "Configuration", configuration - yield "StrongName", "False" - ] - MSBuildHelper.build (fun p -> - { p with - NoLogo = true - NodeReuse = false - Targets = targets - Properties = properties - RestorePackagesFlag = false - Verbosity = Some MSBuildVerbosity.Minimal - }) project - -let msbuildStrong targets configuration project = - let properties = - [ - yield "Configuration", configuration - yield "StrongName", "True" - ] - MSBuildHelper.build (fun p -> - { p with - NoLogo = true - NodeReuse = false - Targets = targets - Properties = properties - RestorePackagesFlag = false - Verbosity = Some MSBuildVerbosity.Minimal - }) project let dotnet workingDir command = let properties = [ ] - let suffix = properties |> List.map (fun (name, value) -> sprintf """ /p:%s="%s" """ name value) |> String.concat "" + let suffix = properties |> List.map (fun (name, value) -> sprintf """ /p:%s="%s" /nr:false """ name value) |> String.concat "" DotNetCli.RunCommand (fun c -> { c with WorkingDir = workingDir}) (command + suffix) @@ -92,9 +46,9 @@ let dotnetWeak workingDir command = [ yield "StrongName", "False" ] - let suffix = properties |> List.map (fun (name, value) -> sprintf """ /p:%s="%s" """ name value) |> String.concat "" + let suffix = properties |> List.map (fun (name, value) -> sprintf """ /p:%s="%s" /nr:false """ name value) |> String.concat "" DotNetCli.RunCommand - (fun c -> { c with WorkingDir = workingDir}) + (fun c -> { c with WorkingDir = workingDir }) (command + suffix) let dotnetStrong workingDir command = @@ -102,7 +56,7 @@ let dotnetStrong workingDir command = [ yield "StrongName", "True" ] - let suffix = properties |> List.map (fun (name, value) -> sprintf """ /p:%s="%s" """ name value) |> String.concat "" + let suffix = properties |> List.map (fun (name, value) -> sprintf """ /p:%s="%s" /nr:false """ name value) |> String.concat "" DotNetCli.RunCommand (fun c -> { c with WorkingDir = workingDir}) (command + suffix) @@ -306,16 +260,16 @@ let patchVersionInProjectFile (project:Project) = // BUILD // -------------------------------------------------------------------------------------- -let clean (solution:Solution) = msbuild [ "Clean" ] "Release" solution.SolutionFile +let clean (solution:Solution) = dotnet rootDir (sprintf "clean %s --configuration Release --verbosity minimal" solution.SolutionFile) -let restoreWeak (solution:Solution) = msbuildWeak [ "Restore" ] "Release" solution.SolutionFile -let restoreStrong (solution:Solution) = msbuildStrong [ "Restore" ] "Release" solution.SolutionFile +let restoreWeak (solution:Solution) = dotnetWeak rootDir (sprintf "restore %s --verbosity minimal" solution.SolutionFile) +let restoreStrong (solution:Solution) = dotnetStrong rootDir (sprintf "restore %s --verbosity minimal" solution.SolutionFile) -let buildWeak (solution:Solution) = msbuildWeak [ (if hasBuildParam "incremental" then "Build" else "Rebuild") ] "Release" solution.SolutionFile -let buildStrong (solution:Solution) = msbuildStrong [ (if hasBuildParam "incremental" then "Build" else "Rebuild") ] "Release" solution.SolutionFile +let buildWeak (solution:Solution) = dotnetWeak rootDir (sprintf "build %s --configuration Release --no-incremental --no-restore --verbosity minimal" solution.SolutionFile) +let buildStrong (solution:Solution) = dotnetStrong rootDir (sprintf "build %s --configuration Release --no-incremental --no-restore --verbosity minimal" solution.SolutionFile) -let packWeak (solution:Solution) = dotnetWeak rootDir (sprintf "pack %s --configuration Release --no-restore" solution.SolutionFile) -let packStrong (solution:Solution) = dotnetStrong rootDir (sprintf "pack %s --configuration Release --no-restore" solution.SolutionFile) +let packWeak (solution:Solution) = dotnetWeak rootDir (sprintf "pack %s --configuration Release --no-restore --verbosity minimal" solution.SolutionFile) +let packStrong (solution:Solution) = dotnetStrong rootDir (sprintf "pack %s --configuration Release --no-restore --verbosity minimal" solution.SolutionFile) let packProjectWeak = function | VisualStudio p -> dotnetWeak rootDir (sprintf "pack %s --configuration Release --no-restore --no-build" p.ProjectFile) diff --git a/src/Benchmark/LinearAlgebra/DenseVector.cs b/src/Benchmark/LinearAlgebra/DenseVector.cs index e8bd1425..2511daed 100644 --- a/src/Benchmark/LinearAlgebra/DenseVector.cs +++ b/src/Benchmark/LinearAlgebra/DenseVector.cs @@ -20,7 +20,7 @@ namespace Benchmark.LinearAlgebra AddJob(Job.Default.WithRuntime(ClrRuntime.Net461).WithPlatform(Platform.X64).WithJit(Jit.RyuJit)); AddJob(Job.Default.WithRuntime(ClrRuntime.Net461).WithPlatform(Platform.X86).WithJit(Jit.LegacyJit)); #if !NET461 - AddJob(Job.Default.WithRuntime(CoreRuntime.Core31).With(Platform.X64).WithJit(Jit.RyuJit)); + AddJob(Job.Default.WithRuntime(CoreRuntime.Core31).WithPlatform(Platform.X64).WithJit(Jit.RyuJit)); #endif } }