This is part of the Fake.DotNet.Fsc module.

Fsc

Contains tasks to compiles F# source file with the FSharp.Compiler.Service.

Note: This documentation is for FAKE version 5.0 or later. The old documentation can be found here

Nested types and modules

TypeDescription
Access

Used to set the Accessiblity of an embeded or linked resource

BuildException

An exception type to signal build errors.

CompilerFunc

Type signature for a Compiler Function

DebugType

Specify debugging type: full, pdbonly. ('full' is the default and enables attaching a debugger to a running program).

FscParam
FscResultMessage

Common Error Result type for tracing errors

Optimization

Optimization options that can be disabled or enabled selectively by listing them with the optimize compiler flag

PlatformType

Limit which platforms the compiled code can run on: x86, Itanium, x64, anycpu32bitpreferred, or anycpu. The default is anycpu.

Profile

Specify target framework profile of this assembly. Valid values are mscorlib or netcore. Default - mscorlib

ResourceInfo

Specified path of a managed resource with an optional name alias and accessiblity flag resinfo format is [,[,public|private]] e.g. resource.dat,rezName,public

TargetType

Functions and values

Function or valueDescription
Fsc.compile fscParams inputFiles
Signature: fscParams:FscParam list -> inputFiles:string list -> unit

Compiles one or more F# source files with the specified parameters.

Parameters

  • setParams - Function used to overwrite the default Fsc parameters.
  • inputFiles - The F# input files.

Sample

1: 
2: 
3: 
4: 
5: 
6: 
7: 
["file1.fs"; "file2.fs"]
|> compile [Out "" 
            Target Exe
            Platform AnyCpu
            References []
            Debug false 
        ]
Fsc.compileExternal(...)
Signature: fscTool:string -> fscParams:FscParam list -> inputFiles:string list -> unit

Compiles one or more F# source files with the specified parameters using an existing fsc.exe installed on the system

Parameters

  • fscTool - Path to an existing fsc.exe executable
  • setParams - Function used to overwrite the default Fsc parameters.
  • inputFiles - The F# input files.

Sample

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
["file1.fs"; "file2.fs"]
|> compileExternal "path/to/fsc.exe" 
            [Out "" 
            Target Exe
            Platform AnyCpu
            References []
            Debug false 
        ]
Fsc.compileExternalWithResult(...)
Signature: fscTool:string -> fscParams:FscParam list -> inputFiles:string list -> int

Compiles the given F# source files with the specified parameters.

Parameters

  • fscTool - Path to an existing fsc.exe executable
  • setParams - Function used to overwrite the default Fsc parameters.
  • inputFiles - The F# input files.

Returns

The exit status code of the compile process.

Sample

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
["file1.fs"; "file2.fs"]
|> compileExternalWithResult "path/to/fsc.exe" 
            [Out "" 
            Target Exe
            Platform AnyCpu
            References []
            Debug false 
        ]          
Fsc.compileWithResult(...)
Signature: fscParams:FscParam list -> inputFiles:string list -> int

Compiles the given F# source files with the specified parameters.

Parameters

  • setParams - Function used to overwrite the default Fsc parameters.
  • inputFiles - The F# input files.

Returns

The exit status code of the compile process.

Sample

1: 
2: 
3: 
4: 
5: 
6: 
7: 
["file1.fs"; "file2.fs"]
|> compileWithResult [Out "" 
            Target Exe
            Platform AnyCpu
            References []
            Debug false 
        ]
Fsc.resourceStr(arg1, arg2, arg3)
Signature: (string * string option * Access option) -> string