Skip to content

Commit

Permalink
Fix tutorial to be xplat
Browse files Browse the repository at this point in the history
  • Loading branch information
fsgit committed Sep 25, 2014
1 parent 360056e commit 2b4beaf
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 12 deletions.
25 changes: 21 additions & 4 deletions docs/content/filesystem.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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 |]

Expand Down
28 changes: 22 additions & 6 deletions docs/content/project.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 |])

(**
Expand Down
4 changes: 2 additions & 2 deletions docs/content/symbols.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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

(**
Expand Down

0 comments on commit 2b4beaf

Please sign in to comment.