Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable NodeReuse by default (FAKE 4) #1600

Merged
merged 1 commit into from
Jul 27, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions src/app/FakeLib/MSBuildHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ exception BuildException of string*list<string>
with
override x.ToString() = x.Data0.ToString() + "\r\n" + (separated "\r\n" x.Data1)


type MsBuildEntry = {
Version: string;
Paths: string list;
Expand Down Expand Up @@ -52,7 +51,7 @@ let monoVersionToUseMSBuildOn = System.Version("5.0")
/// Tries to detect the right version of MSBuild.
/// - On all OS's, we check a `MSBuild` environment variable which is either
/// * a direct path to a file to use, or
/// * a directory that contains a file called
/// * a directory that contains a file called
/// * `msbuild` on non-Windows systems with mono >= 5.0.0.0, or
/// * `xbuild` on non-Windows systems with mono < 5.0.0.0,
/// * `MSBuild.exe` on Windows systems, or
Expand All @@ -79,24 +78,24 @@ let msBuildExe =

let foundExe =
match isUnix, EnvironmentHelper.monoVersion with
| true, Some(_, Some(version)) when version >= monoVersionToUseMSBuildOn ->
| true, Some(_, Some(version)) when version >= monoVersionToUseMSBuildOn ->
let sources = [
msbuildEnvironVar |> Option.map (exactPathOrBinaryOnPath "msbuild")
msbuildEnvironVar |> Option.bind which
which "msbuild"
which "xbuild"
]
defaultArg (sources |> List.choose id |> List.tryHead) "msbuild"
| true, _ ->
| true, _ ->
let sources = [
msbuildEnvironVar |> Option.map (exactPathOrBinaryOnPath "xbuild")
msbuildEnvironVar |> Option.bind which
which "xbuild"
which "msbuild"
]
defaultArg (sources |> List.choose id |> List.tryHead) "xbuild"
| false, _ ->
| false, _ ->

let configIgnoreMSBuild =
if "true".Equals(ConfigurationManager.AppSettings.["IgnoreMSBuild"], StringComparison.OrdinalIgnoreCase)
then Some ""
Expand All @@ -106,17 +105,17 @@ let msBuildExe =
let vsVersionPaths =
defaultArg (EnvironmentHelper.environVarOrNone "VisualStudioVersion" |> Option.bind dict.TryFind) getAllKnownPaths
|> List.map ((@@) ProgramFilesX86)

ProcessHelper.tryFindFileInDirsThenPath vsVersionPaths "MSBuild.exe"

let sources = [
msbuildEnvironVar |> Option.map (exactPathOrBinaryOnPath "MSBuild.exe")
msbuildEnvironVar |> Option.bind which
configIgnoreMSBuild
findOnVSPathsThenSystemPath
]
defaultArg (sources |> List.choose id |> List.tryHead) "MSBuild.exe"

if foundExe.Contains @"\BuildTools\" then
traceFAKE "If you encounter msbuild errors make sure you have copied the required SDKs, see https://github.com/Microsoft/msbuild/issues/1697"
elif foundExe.Contains @"\2017\" then
Expand Down Expand Up @@ -236,7 +235,7 @@ let mutable MSBuildDefaults =
Properties = []
MaxCpuCount = Some None
NoLogo = false
NodeReuse = not (buildServer = TeamCity || buildServer = TeamFoundation || buildServer = Jenkins)
NodeReuse = false
ToolsVersion = None
Verbosity = None
NoConsoleLogger = false
Expand Down Expand Up @@ -268,8 +267,6 @@ let serializeMSBuildParams (p : MSBuildParams) =
| Detailed -> "d"
| Diagnostic -> "diag"



let targets =
match p.Targets with
| [] -> None
Expand Down Expand Up @@ -471,7 +468,7 @@ let MSBuildWithProjectProperties outputPath (targets : string) (properties : (st
|> Set.unionMany

let setBuildParam project projectParams =
{ projectParams with
{ projectParams with
Targets = targets |> split ';' |> List.filter ((<>) "")
Properties = projectParams.Properties @ properties project }

Expand Down