org.apache.ant.dotnet.compile
Class FSharp

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.tools.ant.taskdefs.MatchingTask
              extended by org.apache.ant.dotnet.compile.DotnetBaseMatchingTask
                  extended by org.apache.ant.dotnet.compile.DotnetCompile
                      extended by org.apache.ant.dotnet.compile.FSharp
All Implemented Interfaces:
java.lang.Cloneable, org.apache.tools.ant.types.selectors.SelectorContainer

public class FSharp
extends DotnetCompile

This task compiles F# source into executables or modules. The task requires fsc.exe on the execute path, unless it or an equivalent program is specified in the executable parameter

All parameters are optional: <fsc/> should suffice to produce a debug build of all *.fs files.

The task is a directory based task, so attributes like includes="**\/*.fs" and excludes="broken.fs" can be used to control the files pulled in. By default, all *.fs files from the project folder down are included in the command. When this happens the destFile -if not specified- is taken as the first file in the list, which may be somewhat hard to control. Specifying the output file with destfile is prudent.

Also, dependency checking only works if destfile is set.

For historical reasons the pattern **/*.fs is preset as includes list and you can not override it with an explicit includes attribute. Use nested <src> elements instead of the basedir attribute if you need more control.

As with <csc> nested src filesets of source, reference filesets, definitions and resources can be provided.

Example

<fsc
   optimize="true"
   debug="false"
   warnLevel="4"
   targetType="exe"
   definitions="RELEASE"
   excludes="src/unicode_class.fs"
   destFile="NetApp.exe"
   tailcalls="true"
   references="System.Xml,System.Web.Xml"
   >
          <reference file="${testCSC.dll}" />
          <define name="RELEASE" />
          <define name="DEBUG" if="debug.property"/>
          <define name="def3" unless="def2.property"/>
   </fsc>
 


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.ant.dotnet.compile.DotnetCompile
DotnetCompile.TargetTypes
 
Field Summary
 
Fields inherited from class org.apache.ant.dotnet.compile.DotnetCompile
additionalModules, debug, definitionList, executable, extraOptions, mainClass, REFERENCE_OPTION, referenceFilesets, resources, targetType, utf8output
 
Fields inherited from class org.apache.ant.dotnet.compile.DotnetBaseMatchingTask
filesets, isWindows, outputFile, srcDir
 
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
fileset
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
FSharp()
           
 
Method Summary
protected  void addCompilerSpecificOptions(NetCommand command)
          implement FSC commands
 void clear()
          reset all contents.
protected  void createResourceParameter(NetCommand command, DotnetResource resource)
           
 boolean getCrossoptimize()
          Whether to enable cross-module optimizations.
 java.lang.String getCrossoptimizeParameter()
          Form the option string for cross-module optimizations.
 java.lang.String getFileExtension()
          Get the extension of filenames to compile.
 java.lang.String getReferenceDelimiter()
          Get the delimiter that the compiler uses between references.
 boolean getStandalone()
          Whether to create a standalone assembly.
 java.lang.String getStandaloneParameter()
          Form the option string for standalone.
 boolean getTailcalls()
          Whether to enable tailcalls.
 java.lang.String getTailcallsParameter()
          Form the option string for tailcalls.
 void setCrossoptimize(boolean b)
          Whether to enable cross-module optimizations.
 void setStandalone(boolean b)
          Whether to create a standalone assembly.
 void setTailcalls(boolean b)
          Whether to enable tailcalls.
 
Methods inherited from class org.apache.ant.dotnet.compile.DotnetCompile
addDefine, addReference, addReferenceFilesets, addResource, addResources, createNetCommand, execute, fillInSharedParameters, getAdditionalModulesParameter, getDebug, getDebugParameter, getDefinitionsDelimiter, getDefinitionsParameter, getDestFileParameter, getExecutable, getExtraOptions, getExtraOptionsParameter, getExtraOptionsParameters, getFailOnError, getFilePattern, getIncludeDefaultReferences, getIncludeDefaultReferencesParameter, getMainClass, getMainClassParameter, getOptimize, getOptimizeParameter, getReferenceFilesParameter, getReferencesParameter, getTargetType, getTargetTypeParameter, getUtf8OutputParameter, getWarnLevel, getWarnLevelParameter, getWin32IconParameter, getWin32Res, getWin32ResParameter, isFileManagedBinary, isUseResponseFile, notEmpty, setAdditionalModules, setDebug, setDestDir, setExecutable, setExtraOptions, setFailOnError, setIncludeDefaultReferences, setMainClass, setOptimize, setReferenceFiles, setReferences, setTargetType, setTargetType, setUseResponseFile, setUtf8Output, setWarnLevel, setWin32Icon, setWin32Res, validate
 
Methods inherited from class org.apache.ant.dotnet.compile.DotnetBaseMatchingTask
addFilesAndExecute, addFilesToCommand, addSrc, buildFileList, getDestFile, getOutputFileTimestamp, getSrcDir, setDestFile, setSrcDir
 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FSharp

public FSharp()
Method Detail

clear

public void clear()
reset all contents.

Overrides:
clear in class DotnetCompile

setTailcalls

public void setTailcalls(boolean b)
Whether to enable tailcalls.


getTailcalls

public boolean getTailcalls()
Whether to enable tailcalls.

Returns:
true if flag is turned on

getTailcallsParameter

public java.lang.String getTailcallsParameter()
Form the option string for tailcalls.

Returns:
The parameter string.

setCrossoptimize

public void setCrossoptimize(boolean b)
Whether to enable cross-module optimizations.


getCrossoptimize

public boolean getCrossoptimize()
Whether to enable cross-module optimizations.

Returns:
true if flag is turned on

getCrossoptimizeParameter

public java.lang.String getCrossoptimizeParameter()
Form the option string for cross-module optimizations.

Returns:
The parameter string.

setStandalone

public void setStandalone(boolean b)
Whether to create a standalone assembly.


getStandalone

public boolean getStandalone()
Whether to create a standalone assembly.

Returns:
true if flag is turned on

getStandaloneParameter

public java.lang.String getStandaloneParameter()
Form the option string for standalone.

Returns:
The parameter string.

addCompilerSpecificOptions

protected void addCompilerSpecificOptions(NetCommand command)
implement FSC commands

Specified by:
addCompilerSpecificOptions in class DotnetCompile
Parameters:
command -

getReferenceDelimiter

public java.lang.String getReferenceDelimiter()
Get the delimiter that the compiler uses between references.

Specified by:
getReferenceDelimiter in class DotnetCompile
Returns:
The string delimiter for the reference string.

getFileExtension

public java.lang.String getFileExtension()
Get the extension of filenames to compile.

Specified by:
getFileExtension in class DotnetCompile
Returns:
The string extension of files to compile.

createResourceParameter

protected void createResourceParameter(NetCommand command,
                                       DotnetResource resource)
Specified by:
createResourceParameter in class DotnetCompile