Skip to content

Commit cde055a

Browse files
use version-agnostic netstandard
1 parent cdfccaa commit cde055a

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

Diff for: paket-files/matthid/Yaaf.FSharp.Scripting/src/source/Yaaf.FSharp.Scripting/YaafFSharpScripting.fs

+18-18
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module internal Env =
66
let inline isNull o = obj.ReferenceEquals(null, o)
77
let isMono = try System.Type.GetType("Mono.Runtime") |> isNull |> not with _ -> false
88
let (++) a b = System.IO.Path.Combine(a,b)
9-
#if NETSTANDARD1_5
9+
#if NETSTANDARD
1010
let (=?) s1 s2 = System.String.Equals(s1, s2, System.StringComparison.OrdinalIgnoreCase)
1111
#else
1212
let (=?) s1 s2 = System.String.Equals(s1, s2, System.StringComparison.InvariantCultureIgnoreCase)
@@ -24,7 +24,7 @@ open System.Diagnostics
2424
module Log =
2525
let source = new TraceSource("Yaaf.FSharp.Scripting")
2626

27-
#if !NETSTANDARD1_5
27+
#if !NETSTANDARD
2828
let LogConsole levels =
2929
let consoleListener = new ConsoleTraceListener();
3030
consoleListener.TraceOutputOptions <- TraceOptions.DateTime
@@ -76,7 +76,7 @@ module internal CompilerServiceExtensions =
7676

7777
let getLib dir nm =
7878
dir ++ nm + ".dll"
79-
#if !NETSTANDARD1_5
79+
#if !NETSTANDARD
8080
let referenceAssemblyDirectory frameworkVersion =
8181
let isWindows = System.Environment.OSVersion.Platform = System.PlatformID.Win32NT
8282
let baseDir =
@@ -115,7 +115,7 @@ module internal CompilerServiceExtensions =
115115
#endif
116116
let fscoreResolveDirs libDirs =
117117
[
118-
#if !NETSTANDARD1_5
118+
#if !NETSTANDARD
119119
yield System.AppDomain.CurrentDomain.BaseDirectory
120120
yield referenceAssemblyDirectory defaultFrameworkVersion
121121
yield System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()
@@ -124,7 +124,7 @@ module internal CompilerServiceExtensions =
124124
#endif
125125
yield! libDirs
126126
yield System.IO.Directory.GetCurrentDirectory()
127-
#if !NETSTANDARD1_5
127+
#if !NETSTANDARD
128128
// Prefer the currently loaded version
129129
yield fsCore "4.0" loadedFsCoreVersion
130130
yield fsCore4400Dir
@@ -166,7 +166,7 @@ module internal CompilerServiceExtensions =
166166
[ "FSharp.Core"
167167
"System.EnterpriseServices.Thunk" // See #4
168168
"System.EnterpriseServices.Wrapper" ] // See #4
169-
#if !NETSTANDARD1_5
169+
#if !NETSTANDARD
170170
let getDefaultSystemReferences frameworkVersion =
171171
Directory.EnumerateFiles(referenceAssemblyDirectory frameworkVersion)
172172
|> Seq.filter (fun file -> Path.GetExtension file =? ".dll")
@@ -190,7 +190,7 @@ module internal CompilerServiceExtensions =
190190
//yield "--optimize-"
191191
yield "--nooptimizationdata"
192192
yield "--noframework"
193-
#if !NETSTANDARD1_5
193+
#if !NETSTANDARD
194194
yield sprintf "-I:%s" (referenceAssemblyDirectory frameworkVersion)
195195
for ref in defaultReferences do
196196
yield sprintf "-r:%s" (referenceAssembly frameworkVersion ref)
@@ -214,7 +214,7 @@ module internal CompilerServiceExtensions =
214214
projFileName, args
215215

216216
let findAssemblyVersion (assembly:Assembly) =
217-
#if !NETSTANDARD1_5
217+
#if !NETSTANDARD
218218
let customAttributes = assembly.GetCustomAttributesData()
219219
let targetFramework =
220220
customAttributes
@@ -264,7 +264,7 @@ module internal CompilerServiceExtensions =
264264
Some (findFSCore dllFiles libDirs)
265265
else None
266266

267-
#if !NETSTANDARD1_5
267+
#if !NETSTANDARD
268268
let defaultReferences =
269269
getDefaultSystemReferences frameworkVersion
270270
|> Seq.filter (not << hasAssembly)
@@ -382,7 +382,7 @@ module internal CompilerServiceExtensions =
382382
t.Name
383383
and getFSharpTypeName (t:System.Type) =
384384
let optFsharpName =
385-
#if !NETSTANDARD1_5
385+
#if !NETSTANDARD
386386
match FSharpAssembly.FromAssembly t.Assembly with
387387
#else
388388
match FSharpAssembly.FromAssembly (t.GetTypeInfo().Assembly) with
@@ -403,7 +403,7 @@ module internal CompilerServiceExtensions =
403403
member x.FSharpFullName = x.Namespace + "." + x.FSharpName
404404

405405
module internal TypeParamHelper =
406-
#if !NETSTANDARD1_5
406+
#if !NETSTANDARD
407407
let rec getFSharpTypeParameterList (t:System.Type) =
408408
#else
409409
let rec getFSharpTypeParameterList (tk:System.Type) =
@@ -437,7 +437,7 @@ type internal InteractionResult =
437437
#endif
438438
{ Output : OutputData; Error : OutputData }
439439

440-
#if !NETSTANDARD1_5
440+
#if !NETSTANDARD
441441
// Thank you for http://www.blogs.sigristsoftware.com/marcsigrist/post/F-for-C-developers-Creating-escaped-concatsplit-functions-in-F.aspx
442442
module internal StringHelpers =
443443
[<RequireQualifiedAccess>]
@@ -563,7 +563,7 @@ open StringHelpers
563563
#endif
564564

565565
/// This exception indicates that an exception happened while compiling or executing given F# code.
566-
#if !NETSTANDARD1_5
566+
#if !NETSTANDARD
567567
[<System.Serializable>]
568568
#endif
569569
#if YAAF_FSHARP_SCRIPTING_PUBLIC
@@ -580,7 +580,7 @@ type internal FsiEvaluationException =
580580
input = input
581581
result = result
582582
arguments = args }
583-
#if !NETSTANDARD1_5
583+
#if !NETSTANDARD
584584
new (info:System.Runtime.Serialization.SerializationInfo, context:System.Runtime.Serialization.StreamingContext) = {
585585
inherit System.Exception(info, context)
586586
input = info.GetString("Input")
@@ -628,7 +628,7 @@ type internal FsiEvaluationException =
628628

629629

630630
/// Exception for invalid expression types
631-
#if !NETSTANDARD1_5
631+
#if !NETSTANDARD
632632
[<System.Serializable>]
633633
#endif
634634
#if YAAF_FSHARP_SCRIPTING_PUBLIC
@@ -643,7 +643,7 @@ type internal FsiExpressionTypeException =
643643
inherit FsiEvaluationException(msg, input, None, result, null)
644644
expected = expect
645645
value = value }
646-
#if !NETSTANDARD1_5
646+
#if !NETSTANDARD
647647
new (info:System.Runtime.Serialization.SerializationInfo, context:System.Runtime.Serialization.StreamingContext) = {
648648
inherit FsiEvaluationException(info, context)
649649
expected = null
@@ -937,7 +937,7 @@ type internal FsiOptions =
937937
WarnAsErrorList = []
938938
ScriptArgs = [] }
939939
static member Default =
940-
#if !NETSTANDARD1_5
940+
#if !NETSTANDARD
941941
// find a FSharp.Core.dll
942942
let runtimeDir = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()
943943
let includes =
@@ -1342,7 +1342,7 @@ module internal Helper =
13421342
// We just compile ourself a forwarder to fix that.
13431343
//session.Reference (typeof<FSharp.Compiler.Interactive.Shell.Settings.InteractiveSettings>.Assembly.Location)
13441344
//session.Let "fsi" fsi
1345-
#if !NETSTANDARD1_5 // Currently this is broken on netcore
1345+
#if !NETSTANDARD // Currently this is broken on netcore
13461346
session.Let "__rawfsi" (box fsi)
13471347
session.EvalInteraction """
13481348
module __ReflectHelper =

0 commit comments

Comments
 (0)