Browse Source

Build Framework: switch build functions to dotnet build

pull/697/head
Christoph Ruegg 6 years ago
parent
commit
ddd2a1c81e
  1. 3
      build.fsx
  2. 68
      build/build-framework.fsx
  3. 2
      src/Benchmark/LinearAlgebra/DenseVector.cs

3
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

68
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)

2
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
}
}

Loading…
Cancel
Save