Skip to content

Commit

Permalink
fix /restore not given in the msbuild command line
Browse files Browse the repository at this point in the history
  • Loading branch information
matthid committed Oct 15, 2018
1 parent 919b7c7 commit 871c298
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 2 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Release Notes

## 5.9.3-alpha - tbd
## 5.9.3 - 2018-10-15

* tbd
* BUGFIX: `/restore` was missing from msbuild command line - https://github.com/fsharp/FAKE/issues/2160

## 5.9.2 - 2018-10-14

Expand Down
7 changes: 6 additions & 1 deletion src/app/Fake.DotNet.MSBuild/MSBuild.fs
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,10 @@ module MSBuild =
| Some v -> v.ToString()
| _ -> "")

let restoreFlag =
if p.DoRestore then Some("restore", "")
else None

let noLogo =
if p.NoLogo then Some("nologo", "")
else None
Expand Down Expand Up @@ -638,7 +642,8 @@ module MSBuild =
dfls
|> List.map(fun (cl, fl) -> Some("dl", createLoggerString cl fl))

[ yield targets;
[ yield restoreFlag
yield targets
if not Environment.isUnix then
yield maxcpu
yield noLogo
Expand Down
10 changes: 10 additions & 0 deletions src/test/Fake.Core.UnitTests/Fake.DotNet.MSBuild.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,14 @@ let tests =
if Environment.isUnix then "/p:RestorePackages=False /p:OutputPath=C:%5CTest%5C"
else "/m /nodeReuse:False /p:RestorePackages=False /p:OutputPath=C:%5CTest%5C"
Expect.equal cmdLine expected "Expected a given cmdline."
testCase "Test that /restore is included #2160" <| fun _ ->
let _, cmdLine =
MSBuild.buildArgs (fun defaults ->
{ defaults with
ConsoleLogParameters = []
DoRestore = true })
let expected =
if Environment.isUnix then "/restore /p:RestorePackages=False"
else "/restore /m /nodeReuse:False /p:RestorePackages=False"
Expect.equal cmdLine expected "Expected a given cmdline."
]

0 comments on commit 871c298

Please sign in to comment.