@@ -62,13 +62,14 @@ let fsCoreDefaultReference() =
62
62
sysLib " FSharp.Core"
63
63
64
64
let mkProjectCommandLineArgs ( dllName , fileNames ) =
65
+ let args =
65
66
[| yield " --simpleresolution"
66
67
yield " --noframework"
67
68
yield " --debug:full"
68
69
yield " --define:DEBUG"
69
- #if NETCOREAPP1_ 0
70
+ // #if NETCOREAPP1_0
70
71
yield " --targetprofile:netcore"
71
- #endif
72
+ // #endif
72
73
yield " --optimize-"
73
74
yield " --out:" + dllName
74
75
yield " --doc:test.xml"
@@ -79,26 +80,11 @@ let mkProjectCommandLineArgs (dllName, fileNames) =
79
80
for x in fileNames do
80
81
yield x
81
82
let references =
82
- #if TODO_ REWORK_ ASSEMBLY_ LOAD
83
- #if NETCOREAPP1_ 0
83
+ #if DOTNETCORE
84
84
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:" , " " ))
102
88
#else
103
89
[ yield sysLib " mscorlib"
104
90
yield sysLib " System"
@@ -108,6 +94,40 @@ let mkProjectCommandLineArgs (dllName, fileNames) =
108
94
for r in references do
109
95
yield " -r:" + r
110
96
|]
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
111
131
112
132
let parseSourceCode ( name : string , code : string ) =
113
133
let location = Path.Combine( Path.GetTempPath(), " test" + string( hash ( name, code)))
@@ -123,11 +143,13 @@ let parseSourceCode (name: string, code: string) =
123
143
124
144
let parseAndCheckScript ( file , input ) =
125
145
126
- #if TODO _ REWORK _ ASSEMBLY _ LOAD
146
+ #if DOTNETCORE
127
147
let dllName = Path.ChangeExtension( file, " .dll" )
128
148
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
130
151
let projectOptions = checker.GetProjectOptionsFromCommandLineArgs ( projName, args)
152
+
131
153
#else
132
154
let projectOptions = checker.GetProjectOptionsFromScript( file, input) |> Async.RunSynchronously
133
155
#endif
0 commit comments