mirror of
https://github.com/Smaug123/unofficial-nunit-runner
synced 2025-10-10 19:38:39 +00:00
Compare commits
1 Commits
WoofWare.N
...
WoofWare.N
Author | SHA1 | Date | |
---|---|---|---|
|
3d04199c56 |
@@ -7,11 +7,7 @@ open WoofWare.DotnetRuntimeLocator
|
|||||||
/// Functions for locating .NET runtimes.
|
/// Functions for locating .NET runtimes.
|
||||||
[<RequireQualifiedAccess>]
|
[<RequireQualifiedAccess>]
|
||||||
module DotnetRuntime =
|
module DotnetRuntime =
|
||||||
let private selectRuntime
|
let private selectRuntime (config : RuntimeOptions) (f : DotnetEnvironmentInfo) : DirectoryInfo list =
|
||||||
(config : RuntimeOptions)
|
|
||||||
(f : DotnetEnvironmentInfo)
|
|
||||||
: Choice<DotnetEnvironmentFrameworkInfo, DotnetEnvironmentSdkInfo> option
|
|
||||||
=
|
|
||||||
let rollForward =
|
let rollForward =
|
||||||
match Environment.GetEnvironmentVariable "DOTNET_ROLL_FORWARD" with
|
match Environment.GetEnvironmentVariable "DOTNET_ROLL_FORWARD" with
|
||||||
| null ->
|
| null ->
|
||||||
@@ -66,15 +62,13 @@ module DotnetRuntime =
|
|||||||
|
|
||||||
name, data.Installed
|
name, data.Installed
|
||||||
)
|
)
|
||||||
// TODO: how do we select between many available frameworks?
|
|> Seq.toList
|
||||||
|> Seq.tryHead
|
|
||||||
|
|
||||||
match available with
|
// TODO: maybe we can ask the SDK if we don't have any runtimes.
|
||||||
| Some (_, f) -> Some (Choice1Of2 f)
|
// But we keep on trucking: maybe we're self-contained, and we'll actually find all the runtime next to the
|
||||||
| None ->
|
// DLL.
|
||||||
// TODO: maybe we can ask the SDK. But we keep on trucking: maybe we're self-contained,
|
available
|
||||||
// and we'll actually find all the runtime next to the DLL.
|
|> List.map (fun (_name, runtime) -> DirectoryInfo $"%s{runtime.Path}/%s{runtime.Version}")
|
||||||
None
|
|
||||||
| _ -> failwith "non-minor RollForward not supported yet; please shout if you want it"
|
| _ -> failwith "non-minor RollForward not supported yet; please shout if you want it"
|
||||||
|
|
||||||
/// Given an executable DLL, locate the .NET runtime that can best run it.
|
/// Given an executable DLL, locate the .NET runtime that can best run it.
|
||||||
@@ -96,9 +90,4 @@ module DotnetRuntime =
|
|||||||
|
|
||||||
let runtime = selectRuntime runtimeConfig availableRuntimes
|
let runtime = selectRuntime runtimeConfig availableRuntimes
|
||||||
|
|
||||||
match runtime with
|
dll.Directory :: runtime
|
||||||
| None ->
|
|
||||||
// Keep on trucking: let's be optimistic and hope that we're self-contained.
|
|
||||||
[ dll.Directory ]
|
|
||||||
| Some (Choice1Of2 runtime) -> [ dll.Directory ; DirectoryInfo $"%s{runtime.Path}/%s{runtime.Version}" ]
|
|
||||||
| Some (Choice2Of2 sdk) -> [ dll.Directory ; DirectoryInfo sdk.Path ]
|
|
||||||
|
Reference in New Issue
Block a user