@@ -62,13 +62,14 @@ let fsCoreDefaultReference() =
6262 sysLib " FSharp.Core"
6363
6464let mkProjectCommandLineArgs ( dllName , fileNames ) =
65+ let args =
6566 [| yield " --simpleresolution"
6667 yield " --noframework"
6768 yield " --debug:full"
6869 yield " --define:DEBUG"
69- #if NETCOREAPP1_ 0
70+ // #if NETCOREAPP1_0
7071 yield " --targetprofile:netcore"
71- #endif
72+ // #endif
7273 yield " --optimize-"
7374 yield " --out:" + dllName
7475 yield " --doc:test.xml"
@@ -79,26 +80,11 @@ let mkProjectCommandLineArgs (dllName, fileNames) =
7980 for x in fileNames do
8081 yield x
8182 let references =
82- #if TODO_ REWORK_ ASSEMBLY_ LOAD
83- #if NETCOREAPP1_ 0
83+ #if DOTNETCORE
8484 Path.Combine(__ SOURCE_ DIRECTORY__, " ../projects/Sample_NETCoreSDK_FSharp_Library_netstandard1.6/obj/Debug/netstandard1.6/dotnet-compile-fsc.rsp" )
85- |> File.ReadAllLines
86- |> Array.filter ( fun s -> s.StartsWith( " -r:" ))
87- |> Array.map ( fun s -> s.Replace( " -r:" , " " ))
88- #else
89- [ yield typeof< System.Object>. Assembly.Location; // mscorlib
90- yield typeof< System.Console>. Assembly.Location; // System.Console
91- yield typeof< System.ComponentModel.DefaultValueAttribute>. Assembly.Location; // System.Runtime
92- yield typeof< System.ComponentModel.PropertyChangedEventArgs>. Assembly.Location; // System.ObjectModel
93- yield typeof< System.IO.BufferedStream>. Assembly.Location; // System.IO
94- yield typeof< System.Linq.Enumerable>. Assembly.Location; // System.Linq
95- yield typeof< System.Xml.Linq.XDocument>. Assembly.Location; // System.Xml.Linq
96- yield typeof< System.Net.WebRequest>. Assembly.Location; // System.Net.Requests
97- yield typeof< System.Numerics.BigInteger>. Assembly.Location; // System.Runtime.Numerics
98- yield typeof< System.Threading.Tasks.TaskExtensions>. Assembly.Location; // System.Threading.Tasks
99- yield typeof< Microsoft.FSharp.Core.MeasureAttribute>. Assembly.Location; // FSharp.Core
100- ]
101- #endif
85+ |> File.ReadAllLines
86+ |> Array.filter ( fun s -> s.StartsWith( " -r:" ))
87+ |> Array.map ( fun s -> s.Replace( " -r:" , " " ))
10288#else
10389 [ yield sysLib " mscorlib"
10490 yield sysLib " System"
@@ -108,6 +94,40 @@ let mkProjectCommandLineArgs (dllName, fileNames) =
10894 for r in references do
10995 yield " -r:" + r
11096 |]
97+ printfn " dllName = %A , args = %A " dllName args
98+ args
99+
100+ #if DOTNETCORE
101+ let mkProjectCommandLineArgsForScript ( dllName , fileNames ) =
102+ [| yield " --simpleresolution"
103+ yield " --noframework"
104+ yield " --debug:full"
105+ yield " --define:DEBUG"
106+ //#if NETCOREAPP1_0
107+ yield " --targetprofile:netcore"
108+ //#endif
109+ yield " --optimize-"
110+ yield " --out:" + dllName
111+ yield " --doc:test.xml"
112+ yield " --warn:3"
113+ yield " --fullpaths"
114+ yield " --flaterrors"
115+ yield " --target:library"
116+ for x in fileNames do
117+ yield x
118+ let implDir = Path.GetDirectoryName( typeof< System.Object>. Assembly.Location)
119+ let references =
120+ [ yield Path.Combine( implDir, " mscorlib.dll" );
121+ yield Path.Combine( implDir, " System.Private.CoreLib.dll" );
122+ yield ! Path.Combine(__ SOURCE_ DIRECTORY__, " ../projects/Sample_NETCoreSDK_FSharp_Library_netstandard1.6/obj/Debug/netstandard1.6/dotnet-compile-fsc.rsp" )
123+ |> File.ReadAllLines
124+ |> Array.filter ( fun s -> s.StartsWith( " -r:" ))
125+ |> Array.map ( fun s -> s.Replace( " -r:" , " " ))
126+ |> Array.map ( fun s -> Path.Combine( implDir, s)) ]
127+ for r in references do
128+ yield " -r:" + r
129+ |]
130+ #endif
111131
112132let parseSourceCode ( name : string , code : string ) =
113133 let location = Path.Combine( Path.GetTempPath(), " test" + string( hash ( name, code)))
@@ -123,11 +143,13 @@ let parseSourceCode (name: string, code: string) =
123143
124144let parseAndCheckScript ( file , input ) =
125145
126- #if TODO _ REWORK _ ASSEMBLY _ LOAD
146+ #if DOTNETCORE
127147 let dllName = Path.ChangeExtension( file, " .dll" )
128148 let projName = Path.ChangeExtension( file, " .fsproj" )
129- let args = mkProjectCommandLineArgs ( dllName, [ file])
149+ let args = mkProjectCommandLineArgsForScript ( dllName, [ file])
150+ printfn " file = %A , args = %A " file args
130151 let projectOptions = checker.GetProjectOptionsFromCommandLineArgs ( projName, args)
152+
131153#else
132154 let projectOptions = checker.GetProjectOptionsFromScript( file, input) |> Async.RunSynchronously
133155#endif
0 commit comments