|
7 | 7 |
|
8 | 8 | namespace Microsoft.FSharp.Compiler.SourceCodeServices
|
9 | 9 | open System
|
| 10 | +open System.IO |
10 | 11 | open System.Collections.Generic
|
11 | 12 |
|
12 | 13 | open Microsoft.FSharp.Compiler
|
| 14 | +open Microsoft.FSharp.Compiler.Ast |
| 15 | +open Microsoft.FSharp.Compiler.Driver |
| 16 | +open Microsoft.FSharp.Compiler.ErrorLogger |
13 | 17 | open Microsoft.FSharp.Compiler.Range
|
14 | 18 | open Microsoft.FSharp.Compiler.TcGlobals
|
15 | 19 | open Microsoft.FSharp.Compiler.NameResolution
|
@@ -383,6 +387,15 @@ type FSharpProjectOptions =
|
383 | 387 | type IsResultObsolete =
|
384 | 388 | | IsResultObsolete of (unit->bool)
|
385 | 389 |
|
| 390 | +module internal CompileHelpers = |
| 391 | + val mkCompilationErorHandlers : unit -> List<FSharpErrorInfo> * ErrorLogger * ErrorLoggerProvider |
| 392 | + val tryCompile : errorLogger:ErrorLogger -> f:(Exiter -> unit) -> int |
| 393 | + val compileFromArgs : argv:string [] * tcImportsCapture:(TcImports -> unit) option * dynamicAssemblyCreator:(TcConfig * AbstractIL.IL.ILGlobals * ErrorLogger * string * string option * AbstractIL.IL.ILModuleDef * SigningInfo -> unit) option -> FSharpErrorInfo [] * int |
| 394 | + val compileFromAsts : asts:ParsedInput list * assemblyName:string * outFile:string * dependencies:string list * noframework:bool * pdbFile:string option * executable:bool option * tcImportsCapture:(TcImports -> unit) option * dynamicAssemblyCreator:(TcConfig * AbstractIL.IL.ILGlobals * ErrorLogger * string * string option * AbstractIL.IL.ILModuleDef * SigningInfo -> unit) option -> FSharpErrorInfo [] * int |
| 395 | + val dynamicAssemblyCreator<'a,'b,'c,'d,'e> : debugInfo:bool * tcImportsRef:TcImports option ref * execute:'a option * assemblyBuilderRef:Reflection.Emit.AssemblyBuilder option ref -> _tcConfig:'b * ilGlobals:AbstractIL.IL.ILGlobals * _errorLogger:'c * outfile:string * _pdbfile:'d * ilxMainModule:AbstractIL.IL.ILModuleDef * _signingInfo:'e -> unit |
| 396 | + val setOutputStreams : execute:(#TextWriter * #TextWriter) option -> unit |
| 397 | + |
| 398 | + |
386 | 399 | /// The result of calling TypeCheckResult including the possibility of abort and background compiler not caught up.
|
387 | 400 | [<RequireQualifiedAccess>]
|
388 | 401 | type FSharpCheckFileAnswer =
|
@@ -588,6 +601,29 @@ type FSharpChecker =
|
588 | 601 | /// <param name="options">The options for the project or script, used to determine active --define conditionals and other options relevant to parsing.</param>
|
589 | 602 | member GetBackgroundCheckResultsForFileInProject : filename : string * options : FSharpProjectOptions -> Async<FSharpParseFileResults * FSharpCheckFileResults>
|
590 | 603 |
|
| 604 | + /// Compile using the given flags. Source files names are resolved via the FileSystem API. |
| 605 | + /// The output file must be given by a -o flag. |
| 606 | + /// The first argument is ignored and can just be "fsc.exe". |
| 607 | + member Compile: argv:string [] -> FSharpErrorInfo [] * int |
| 608 | + |
| 609 | + /// TypeCheck and compile provided AST |
| 610 | + member Compile: ast:ParsedInput list * assemblyName:string * outFile:string * dependencies:string list * ?pdbFile:string * ?executable:bool * ?noframework:bool -> FSharpErrorInfo [] * int |
| 611 | + |
| 612 | + /// Compiles to a dynamic assembly usinng the given flags. |
| 613 | + /// |
| 614 | + /// The first argument is ignored and can just be "fsc.exe". |
| 615 | + /// |
| 616 | + /// Any source files names are resolved via the FileSystem API. An output file name must be given by a -o flag, but this will not |
| 617 | + /// be written - instead a dynamic assembly will be created and loaded. |
| 618 | + /// |
| 619 | + /// If the 'execute' parameter is given the entry points for the code are executed and |
| 620 | + /// the given TextWriters are used for the stdout and stderr streams respectively. In this |
| 621 | + /// case, a global setting is modified during the execution. |
| 622 | + member CompileToDynamicAssembly: otherFlags:string [] * execute:(TextWriter * TextWriter) option -> FSharpErrorInfo [] * int * System.Reflection.Assembly option |
| 623 | + |
| 624 | + /// TypeCheck and compile provided AST |
| 625 | + member CompileToDynamicAssembly: ast:ParsedInput list * assemblyName:string * dependencies:string list * execute:(TextWriter * TextWriter) option * ?debug:bool * ?noframework:bool -> FSharpErrorInfo [] * int * System.Reflection.Assembly option |
| 626 | + |
591 | 627 | /// <summary>
|
592 | 628 | /// Try to get type check results for a file. This looks up the results of recent type checks of the
|
593 | 629 | /// same file, regardless of contents. The version tag specified in the original check of the file is returned.
|
|
0 commit comments