Skip to content

Commit

Permalink
Msbuild max cpu (updated) (fsprojects#2789)
Browse files Browse the repository at this point in the history
* Ability to set maxcpu in msbuild on unix
* Update tests

---------

Co-authored-by: Jimmy Byrd <[email protected]>
  • Loading branch information
Numpsy and TheAngryByrd authored Jul 27, 2024
1 parent 033ab08 commit c07ab63
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## 6.1.0 - 2024-07-27
* BUGFIX: MSBuild.build adds a bad string at the end of properties, thanks @0x53A - https://github.com/fsprojects/FAKE/issues/2738
* BUGFIX: Allow setting Msbuild max cpu on Linux, thanks @TheAngryByrd - https://github.com/fsprojects/FAKE/pull/2772
* ENHANCEMENT: Added shorthash to git functions, thanks @voronoipotato - https://github.com/fsprojects/FAKE/pull/2752
* ENHANCEMENT: Support for `/tl:[auto:on:off]` msbuild flag, thanks @smoothdeveloper - https://github.com/fsprojects/FAKE/pull/2768
* ENHANCEMENT: Fixes for usage in .NET 8.0 enviroment projects.
Expand Down
7 changes: 3 additions & 4 deletions src/app/Fake.DotNet.MSBuild/MSBuild.fs
Original file line number Diff line number Diff line change
Expand Up @@ -885,10 +885,9 @@ module MSBuild =

[ yield restoreFlag
yield targets
if not Environment.isUnix then
yield maxCpu
yield noLogo
yield nodeReuse
yield maxCpu
yield noLogo
yield nodeReuse
yield
(match p.TerminalLogger with
| MSBuildTerminalLoggerOption.Off -> Some("tl", "off")
Expand Down
17 changes: 3 additions & 14 deletions src/test/Fake.Core.UnitTests/Fake.DotNet.MSBuild.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ let tests =
else
expected.Trim()

let expected =
if Environment.isUnix then
$"{expected} /p:RestorePackages=False".Trim()
else
$"/m /nodeReuse:False {expected} /p:RestorePackages=False".Trim()
let expected = $"/m /nodeReuse:False {expected} /p:RestorePackages=False".Trim()

Expect.equal cmdLine expected $"Expected a given cmdLine '{expected}', but got '{cmdLine}'."

Expand All @@ -36,10 +32,7 @@ let tests =
Properties = [ "OutputPath", "C:\\Test\\" ] })

let expected =
if Environment.isUnix then
"/p:RestorePackages=False /p:OutputPath=C:%5CTest%5C"
else
"/m /nodeReuse:False /p:RestorePackages=False /p:OutputPath=C:%5CTest%5C"
"/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"
Expand All @@ -50,11 +43,7 @@ let tests =
ConsoleLogParameters = []
DoRestore = true })

let expected =
if Environment.isUnix then
"/restore /p:RestorePackages=False"
else
"/restore /m /nodeReuse:False /p:RestorePackages=False"
let expected = "/restore /m /nodeReuse:False /p:RestorePackages=False"

Expect.equal cmdLine expected "Expected a given cmdline."

Expand Down

0 comments on commit c07ab63

Please sign in to comment.