From 2b4beaf42d62ee191e0c174c09478cac5fb866e9 Mon Sep 17 00:00:00 2001 From: F# Software Foundation Date: Thu, 25 Sep 2014 18:41:41 +0100 Subject: [PATCH] Fix tutorial to be xplat --- docs/content/filesystem.fsx | 25 +++++++++++++++++++++---- docs/content/project.fsx | 28 ++++++++++++++++++++++------ docs/content/symbols.fsx | 4 ++-- 3 files changed, 45 insertions(+), 12 deletions(-) diff --git a/docs/content/filesystem.fsx b/docs/content/filesystem.fsx index af2f574ee5..06d4f85ac2 100644 --- a/docs/content/filesystem.fsx +++ b/docs/content/filesystem.fsx @@ -95,7 +95,24 @@ Doing a compilation with the FileSystem open Microsoft.FSharp.Compiler.SourceCodeServices let checker = InteractiveChecker.Create() + let projectOptions = + let sysLib nm = + if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows + System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86) + + @"\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\" + nm + ".dll" + else + let sysDir = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + let (++) a b = System.IO.Path.Combine(a,b) + sysDir ++ nm + ".dll" + + let fsCore4300() = + if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows + System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86) + + @"\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll" + else + sysLib "FSharp.Core" + let allFlags = [| yield "--simpleresolution"; yield "--noframework"; @@ -108,10 +125,10 @@ let projectOptions = yield "--flaterrors"; yield "--target:library"; let references = - [ @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll"; - @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll"; - @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll"; - @"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll"] + [ sysLib "mscorlib" + sysLib "System" + sysLib "System.Core" + fsCore4300() ] for r in references do yield "-r:" + r |] diff --git a/docs/content/project.fsx b/docs/content/project.fsx index e5f9194009..f025fa06b5 100644 --- a/docs/content/project.fsx +++ b/docs/content/project.fsx @@ -73,6 +73,22 @@ We use `GetProjectOptionsFromCommandLineArgs` to treat two files as a project: *) let projectOptions = + let sysLib nm = + if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows + System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86) + + @"\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\" + nm + ".dll" + else + let sysDir = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + let (++) a b = System.IO.Path.Combine(a,b) + sysDir ++ nm + ".dll" + + let fsCore4300() = + if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then // file references only valid on Windows + System.Environment.GetFolderPath(System.Environment.SpecialFolder.ProgramFilesX86) + + @"\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll" + else + sysLib "FSharp.Core" + checker.GetProjectOptionsFromCommandLineArgs (Inputs.projFileName, [| yield "--simpleresolution" @@ -88,12 +104,12 @@ let projectOptions = yield "--target:library" yield Inputs.fileName1 yield Inputs.fileName2 - let references = - [ @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" - @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" - @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" - @"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\4.3.0.0\FSharp.Core.dll"] - for r in references do + let references = + [ sysLib "mscorlib" + sysLib "System" + sysLib "System.Core" + fsCore4300() ] + for r in references do yield "-r:" + r |]) (** diff --git a/docs/content/symbols.fsx b/docs/content/symbols.fsx index 68e618616b..f6e335a39b 100644 --- a/docs/content/symbols.fsx +++ b/docs/content/symbols.fsx @@ -117,13 +117,13 @@ fnVal.IsActivePattern // false fnVal.IsCompilerGenerated // false fnVal.IsDispatchSlot // false fnVal.IsExtensionMember // false -fnVal.IsGetterMethod // false +fnVal.IsPropertyGetterMethod // false fnVal.IsImplicitConstructor // false fnVal.IsInstanceMember // false fnVal.IsMember // false fnVal.IsModuleValueOrMember // true fnVal.IsMutable // false -fnVal.IsSetterMethod // false +fnVal.IsPropertySetterMethod // false fnVal.IsTypeFunction // false (**