diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 00000000..840b4b3e --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,24 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "paket": { + "version": "5.219.6", + "commands": [ + "paket" + ] + }, + "fake-cli": { + "version": "5.16.1", + "commands": [ + "fake" + ] + }, + "nbgv": { + "version": "3.0.26", + "commands": [ + "nbgv" + ] + } + } +} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 04774bd4..518f0bb1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,7 +16,7 @@ Bug reports and feature proposals should be submitted on [the issue tracker](htt In the instructions below, `build` means `./build.sh` on Linux and OSX, and `.\build.cmd` on Windows. -Alternatively, you can install Fake globally with `dotnet tool install -g fake-cli`, and run `fake build`. +Alternatively, you can restore the dotnet tools with `dotnet tools restore`, and then build with `dotnet fake build`. ### How to build diff --git a/tools/Common.props b/Directory.Build.props similarity index 83% rename from tools/Common.props rename to Directory.Build.props index 216f5236..f69a2bf5 100644 --- a/tools/Common.props +++ b/Directory.Build.props @@ -1,5 +1,6 @@ + dotnet paket IntelliFactory false diff --git a/appveyor.yml b/appveyor.yml index 58140c70..7540b1cc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -25,8 +25,8 @@ build_script: - export NUGET_PACKAGES="$APPVEYOR_BUILD_FOLDER/.nuget" # Chrome on AV is not latest - - dotnet tool install paket --tool-path .paket - - .paket/paket add Selenium.WebDriver.ChromeDriver --version 76.0.3809.12600 + - dotnet tool restore + - dotnet paket add Selenium.WebDriver.ChromeDriver --version 76.0.3809.12600 - dotnet restore - '$BUILD_SCRIPT -t pack -c Release -v "$SEMVER" --sourceLink /p:GhPages=true' diff --git a/build.cmd b/build.cmd index 00502f2b..57aa2e18 100644 --- a/build.cmd +++ b/build.cmd @@ -1,8 +1,4 @@ @echo off -if not exist .paket\paket.exe dotnet tool install paket --tool-path .paket -if not exist .paket\fake.exe dotnet tool install fake-cli --tool-path .paket -if not exist .paket\nbgv.exe dotnet tool install nbgv --tool-path .paket - -.paket\fake build %* -if errorlevel 1 exit /b %errorlevel% +dotnet tool restore +dotnet fake build %* diff --git a/build.fsx b/build.fsx index 14677cf5..aac32d78 100644 --- a/build.fsx +++ b/build.fsx @@ -33,10 +33,7 @@ open Utility let config = getArg "-c" "Debug" let version = getArgOpt "-v" >> Option.defaultWith (fun () -> - CreateProcess.fromRawCommand ".paket/nbgv" ["get-version"; "-v"; "SemVer2"] - |> CreateProcess.redirectOutput - |> Proc.run - |> fun r -> r.Result.Output.Trim() + dotnetOutput "nbgv" "get-version -v SemVer2" |> List.head ) let testUploadUrl = getArgOpt "--push-tests" let verbosity = getFlag "--verbose" >> function @@ -48,7 +45,7 @@ let buildArgs o = Target.description "Run the compilation phase proper" Target.create "corebuild" (fun o -> - dotnet "build" "Bolero.sln %s" (buildArgs o) + dotnet "build" "Bolero.sln %s" (buildArgs o) ) let [] tagsFile = slnDir + "/src/Bolero/tags.csv" @@ -123,13 +120,7 @@ Target.create "build" (fun _ -> Target.description "Create the NuGet packages" Target.create "pack" (fun o -> - Fake.DotNet.Paket.pack (fun p -> - { p with - OutputPath = "build" - Version = version o - ToolPath = ".paket/paket" - } - ) + dotnet "paket" "pack build --version %s" (version o) ) Target.description "Run the Client test project" diff --git a/build.sh b/build.sh index a253879f..ed02b7e4 100755 --- a/build.sh +++ b/build.sh @@ -1,10 +1,5 @@ #!/bin/bash set -e -if [ "$OS" = "Windows_NT" ]; then EXE_EXT=.exe; else EXE_EXT=; fi - -if ! [ -f ".paket/paket$EXE_EXT" ]; then dotnet tool install paket --tool-path .paket; fi -if ! [ -f ".paket/fake$EXE_EXT" ]; then dotnet tool install fake-cli --tool-path .paket; fi -if ! [ -f ".paket/nbgv$EXE_EXT" ]; then dotnet tool install nbgv --tool-path .paket; fi - -.paket/fake build "$@" +dotnet tool restore +dotnet fake build "$@" diff --git a/paket.dependencies b/paket.dependencies index 413b432d..dc0689d9 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -1,4 +1,4 @@ -version 5.203.2 +version 5.216.0 source https://api.nuget.org/v3/index.json storage: none framework: netstandard2.0, netcoreapp3.0 diff --git a/src/Bolero.Build/Bolero.Build.csproj b/src/Bolero.Build/Bolero.Build.csproj index 62d2d213..1c2c5ce7 100644 --- a/src/Bolero.Build/Bolero.Build.csproj +++ b/src/Bolero.Build/Bolero.Build.csproj @@ -1,5 +1,4 @@ - netstandard2.0 true diff --git a/src/Bolero.Server/Bolero.Server.fsproj b/src/Bolero.Server/Bolero.Server.fsproj index 988a1d72..1e2a1e2b 100644 --- a/src/Bolero.Server/Bolero.Server.fsproj +++ b/src/Bolero.Server/Bolero.Server.fsproj @@ -1,6 +1,5 @@ - netcoreapp3.0 true diff --git a/src/Bolero/Bolero.fsproj b/src/Bolero/Bolero.fsproj index 108ad9b3..06ff6fb7 100644 --- a/src/Bolero/Bolero.fsproj +++ b/src/Bolero/Bolero.fsproj @@ -1,5 +1,4 @@ - netstandard2.0 true diff --git a/tests/Client/Client.fsproj b/tests/Client/Client.fsproj index caad6d46..cf5e4604 100644 --- a/tests/Client/Client.fsproj +++ b/tests/Client/Client.fsproj @@ -1,6 +1,5 @@ - netstandard2.0 $(DefineConstants);GHPAGES diff --git a/tests/Remoting.Client/Remoting.Client.fsproj b/tests/Remoting.Client/Remoting.Client.fsproj index a0aa23cb..09bec460 100644 --- a/tests/Remoting.Client/Remoting.Client.fsproj +++ b/tests/Remoting.Client/Remoting.Client.fsproj @@ -1,5 +1,4 @@ - netstandard2.0 $(MSBuildThisFileDirectory)..\..\src\Bolero.Build\bin\$(Configuration)\netstandard2.0\Bolero.Build.dll diff --git a/tests/Remoting.Server/Remoting.Server.fsproj b/tests/Remoting.Server/Remoting.Server.fsproj index dc8976b6..444e3ae0 100644 --- a/tests/Remoting.Server/Remoting.Server.fsproj +++ b/tests/Remoting.Server/Remoting.Server.fsproj @@ -1,6 +1,5 @@ - netcoreapp3.0 false @@ -15,4 +14,4 @@ - \ No newline at end of file + diff --git a/tests/Server/Server.fsproj b/tests/Server/Server.fsproj index f0696751..b9b7ea09 100644 --- a/tests/Server/Server.fsproj +++ b/tests/Server/Server.fsproj @@ -1,6 +1,5 @@ - netcoreapp3.0 false diff --git a/tests/Unit.Client/Unit.Client.fsproj b/tests/Unit.Client/Unit.Client.fsproj index 84324160..c1984827 100644 --- a/tests/Unit.Client/Unit.Client.fsproj +++ b/tests/Unit.Client/Unit.Client.fsproj @@ -1,6 +1,5 @@ - + - netstandard2.0 $(MSBuildThisFileDirectory)..\..\src\Bolero.Build\src\$(Configuration)\netstandard2.0\Bolero.Build.dll diff --git a/tests/Unit/Unit.fsproj b/tests/Unit/Unit.fsproj index fd6c6f3c..cdefabb9 100644 --- a/tests/Unit/Unit.fsproj +++ b/tests/Unit/Unit.fsproj @@ -1,6 +1,5 @@ - netcoreapp3.0 false diff --git a/tools/Utility.fsx b/tools/Utility.fsx index 64f83ec0..2543527c 100644 --- a/tools/Utility.fsx +++ b/tools/Utility.fsx @@ -33,25 +33,33 @@ open Fake.Core open Fake.DotNet open Fake.IO +let rundotnet dir env redirectOutput cmd args = + let env = + (Process.createEnvironmentMap(), env) + ||> List.fold (fun map (k, v) -> Map.add k v map) + DotNet.exec + (DotNet.Options.withWorkingDirectory dir + >> DotNet.Options.withEnvironment env + >> DotNet.Options.withRedirectOutput redirectOutput) + cmd args + let dotnet' dir env cmd args = - Printf.kprintf (fun args -> - let env = - (Process.createEnvironmentMap(), env) - ||> List.fold (fun map (k, v) -> Map.add k v map) - let r = - DotNet.exec - (DotNet.Options.withWorkingDirectory dir - >> DotNet.Options.withEnvironment env) - cmd args - for msg in r.Results do - eprintfn "%s" msg.Message - if not r.OK then - failwithf "dotnet %s failed" cmd + Printf.kprintf (rundotnet dir env false cmd >> fun r -> + if not r.OK then failwithf "dotnet %s failed" cmd ) args let dotnet cmd args = dotnet' slnDir [] cmd args +let dotnetOutput' dir env cmd args = + Printf.kprintf (rundotnet dir env true cmd >> fun r -> + if not r.OK then failwithf "dotnet %s failed" cmd + r.Messages + ) args + +let dotnetOutput cmd args = + dotnetOutput' slnDir [] cmd args + /// `cache f x` returns `f x` the first time, /// and re-returns the first result on subsequent calls. let cache f =