// On Windows PROCESSOR_ARCHITECTURE has the value AMD64 on 64 bit Intel Machines
let value =
let find s = envVars |> Map.tryFind s
[| "PROCESSOR_ARCHITECTURE" |] |> Seq.tryPick (fun s -> find s) |> function None -> "" | Some x -> x
value = "AMD64"
let getOperatingSystem () =
#if NETCOREAPP
let isPlatform p = RuntimeInformation.IsOSPlatform(p)
if isPlatform OSPlatform.Windows then "win"
elif isPlatform OSPlatform.Linux then "linux"
elif isPlatform OSPlatform.OSX then "osx"
else "unknown"
#else
"win"
#endif
type FSLibPaths =
module DotnetPlatform =
let Is64BitOperatingSystem envVars =
match getOperatingSystem () with
| "win" ->
// On Windows PROCESSOR_ARCHITECTURE has the value AMD64 on 64 bit Intel Machines
let value =
let find s = envVars |> Map.tryFind s
[| "PROCESSOR_ARCHITECTURE" |] |> Seq.tryPick (fun s -> find s) |> function None -> "" | Some x -> x
value = "AMD64"
| _ -> System.Environment.Is64BitOperatingSystem // As an alternative for netstandard1.4+: System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture
type FSLibPaths =
{ FSCOREDLLPATH : string }
let requireFile nm =
if Commands.fileExists __SOURCE_DIRECTORY__ nm |> Option.isSome then nm else failwith (sprintf "couldn'tfind%s.Running'buildtest'oncemightsolvethisissue" nm)
let packagesDir =
match Environment.GetEnvironmentVariable("NUGET_PACKAGES") with
// Linux filesystems are (in most cases) case-sensitive.
// However when nuget packages are installed to $HOME/.nuget/packages, it seems they are lowercased
let fullPath = (dir ++ path)
match Commands.fileExists __SOURCE_DIRECTORY__ fullPath with
| Some p -> p
| None ->
let fullPathLower = (dir ++ path.ToLower())
match Commands.fileExists __SOURCE_DIRECTORY__ fullPathLower with
| Some p -> p
| None -> failwith (sprintf "Couldn'tfind\"%s\" on the following paths: \"%s\", \"%s\". Running 'build test' once might solve this issue"pathfullPathfullPathLower)
letconfigconfigurationNameenvVars=
letSCRIPT_ROOT=__SOURCE_DIRECTORY__
#ifNET472
letfscArchitecture="net472"
...
...
@@ -171,12 +200,14 @@ let config configurationName envVars =