F# task extension for NAntInstallationThere are several steps in installation process: - Copy binary NAnt.FSharpTask.dll in nant\bin directory
- Insert this task description into NAnt.exe.config file under desired framework section:
- Platform "Win32"
<task name="fsc">
<attribute name="exename"> c:\Program Files\FSharp-1.9.4.19\bin\fsc.exe</attribute>
</task>
- Platform "Unix"
<task name="fsc">
<attribute name="exename"> fsc</attribute>
</task>
Note:
- Create script file named 'fsc' with following line 'mono /path/to/FSharp/compiler/fscp.exe $1'
- Copy this file to mono framework directory
Task Parameters| Attribute | Type | Description | Required | | output | file | The output file created by the compiler. | True | | target | string | Output type. Possible values are exe, winexe, dll or module. | True | | debug | DebugOutput | Specifies the type of debugging information generated by the compiler. | False | | define | string | Define conditional compilation symbol(s). | False | | doc | file | The name of the XML documentation file to generate. | False | | optimize | bool | Specifies whether the compiler should perform optimizations to the make output files smaller, faster, and more effecient. The default is false. Debug overrides optimization settings. | False |
Task Example<fsc target="exe" output="HelloWorld.exe" debug="true"> <sources>
<include name="HelloWorld.fs"> </include>
</sources>
<references>
<include name="System.dll"> </include>
</references>
</fsc> Notes1) F# compiler has annoying problem - you have to order source files for compiler input in order to preserve dependency (more info). To avoid error related to reordering of source files, use asis="true" parameter in include element. Example: <sources> <include name="source1.fs" asis="true"> </include>
<include name="source3.fs" asis="true"> </include>
<include name="main.fs" asis="true"> </include>
</sources> this example will be converted in following pattern "source1.fs source3.fs main.fs"
|