From 27e186f4867c391d7679b926360bffe06f250489 Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Sat, 13 Jan 2018 20:11:44 +0100 Subject: [PATCH] Build: cleanup, fix F# NoWarn entries, pack using msbuild --- build.fsx | 33 ++++------------------ build/build-framework.fsx | 9 +++--- src/FSharp/FSharp.fsproj | 2 +- src/FSharpUnitTests/FSharpUnitTests.fsproj | 2 +- 4 files changed, 12 insertions(+), 34 deletions(-) diff --git a/build.fsx b/build.fsx index 3afcf2b4..72a9f526 100644 --- a/build.fsx +++ b/build.fsx @@ -344,22 +344,14 @@ Target "ApplyVersion" (fun _ -> patchVersionInResource "src/NativeProviders/CUDA/resource.rc" cudaRelease patchVersionInResource "src/NativeProviders/OpenBLAS/resource.rc" openBlasRelease) -Target "DotnetRestore" (fun _ -> +Target "Restore" (fun _ -> restore "MathNet.Numerics.sln" restore "MathNet.Numerics.Data.sln") - //DotNetCli.Restore (fun p -> - // { p with - // Project = "MathNet.Numerics.sln" - // NoCache = false }) - //DotNetCli.Restore (fun p -> - // { p with - // Project = "MathNet.Numerics.Data.sln" - // NoCache = false })) Target "Prepare" DoNothing "Start" =?> ("Clean", not (hasBuildParam "incremental")) - ==> "DotnetRestore" + ==> "Restore" ==> "ApplyVersion" ==> "Prepare" @@ -368,23 +360,8 @@ Target "Prepare" DoNothing // BUILD // -------------------------------------------------------------------------------------- -//let dotnetBuild configuration solution = DotNetCli.Build (fun p -> -// { p with -// Project = solution -// Configuration = configuration -// AdditionalArgs = ["--no-restore"]}) - Target "BuildMain" (fun _ -> build "MathNet.Numerics.sln") - - //MSBuildHelper.build (fun p -> - // { p with - // Targets = [ (if hasBuildParam "incremental" then "Build" else "Rebuild") ] - // Properties = [ "Configuration", "Release" ] - // RestorePackagesFlag = false - // Verbosity = Some MSBuildVerbosity.Minimal - // }) "MathNet.Numerics.sln") - //MSBuild "" (if hasBuildParam "incremental" then "Build" else "Rebuild") [ "Configuration", "Release" ] (!!"MathNet.Numerics.sln") |> ignore) //Target "BuildSigned" (fun _ -> dotnetBuild "Release-StrongName" "MathNet.Numerics.sln") Target "Build" DoNothing @@ -547,14 +524,14 @@ Target "OpenBlasWinZip" (fun _ -> // NUGET let dotnetPack solution = DotNetCli.Pack (fun p -> - let defaultArgs = ["--no-restore"; "--no-build" ] { p with Project = solution Configuration = "Release" - AdditionalArgs = defaultArgs}) + AdditionalArgs = ["--no-restore"; "--no-build" ]}) Target "NuGet" (fun _ -> - dotnetPack "MathNet.Numerics.sln" + pack "MathNet.Numerics.sln" + //dotnetPack "MathNet.Numerics.sln" CopyDir "out/packages/NuGet" "src/Numerics/bin/Release/" (fun n -> n.EndsWith(".nupkg")) CopyDir "out/packages/NuGet" "src/FSharp/bin/Release/" (fun n -> n.EndsWith(".nupkg"))) //CleanDir "out/packages/NuGet" diff --git a/build/build-framework.fsx b/build/build-framework.fsx index a4a26f95..199714d3 100644 --- a/build/build-framework.fsx +++ b/build/build-framework.fsx @@ -132,19 +132,20 @@ let patchVersionInProjectFile path (release:Release) = // BUILD // -------------------------------------------------------------------------------------- -let msbuild targets project = +let msbuild targets configuration project = MSBuildHelper.build (fun p -> { p with NoLogo = true NodeReuse = true Targets = targets - Properties = [ "Configuration", "Release" ] + Properties = [ "Configuration", configuration ] RestorePackagesFlag = false Verbosity = Some MSBuildVerbosity.Minimal }) project -let restore project = msbuild [ "Restore" ] project -let build project = msbuild [ (if hasBuildParam "incremental" then "Build" else "Rebuild") ] project +let restore project = msbuild [ "Restore" ] "Release" project +let build project = msbuild [ (if hasBuildParam "incremental" then "Build" else "Rebuild") ] "Release" project +let pack project = msbuild [ "Pack" ] "Release" project //let buildConfig config subject = MSBuild "" (if hasBuildParam "incremental" then "Build" else "Rebuild") [ "Configuration", config ] subject |> ignore //let build subject = buildConfig "Release" subject diff --git a/src/FSharp/FSharp.fsproj b/src/FSharp/FSharp.fsproj index 450679dc..beb132ac 100644 --- a/src/FSharp/FSharp.fsproj +++ b/src/FSharp/FSharp.fsproj @@ -37,7 +37,7 @@ BUG: Trigonometry: Fix imaginary part sign of complex hyperbolic cotangentfalse true false - FS2003 + 2003 NETSTANDARD diff --git a/src/FSharpUnitTests/FSharpUnitTests.fsproj b/src/FSharpUnitTests/FSharpUnitTests.fsproj index 9974ae4c..a2085f65 100644 --- a/src/FSharpUnitTests/FSharpUnitTests.fsproj +++ b/src/FSharpUnitTests/FSharpUnitTests.fsproj @@ -7,7 +7,7 @@ 2.0.0 false false - FS0044;FS2003 + 44;2003 NETSTANDARD