HaskTask is an Ant task to compile Haskell code. Ant is a build tool, much like make. Haskell is a programming language which is awesome :). When I was working at TVWorks, I developed an affinity for Ant, such that I wanted to start using with my own code. Sadly, I could not find an Ant task for Haskell, my programming language of choice.
The eventual goal of HaskTask is to operate much like the javac task that comes standard with Ant. I'm not there yet; I only support one compiler, GHC, and I only support a few options, but it's good enough for my purposes right now.
To start using HaskTask, just download HaskTask-0.1.jar and include it with your Ant libs to start building. If you are really hardcore, you can download the source code and play with that.
To use HaskTask, put something like this in your build.xml, assuming HaskTask-0.1.jar is in the correct place:
<taskdef name="haskell" classname="ca.uwo.mikeburrell.haskell.Build"
classpath="${libdir}/HaskTask-0.1.jar" />
After this taskdef is introduced, you can use it to start building stuff. Example:
<haskell srcdir="${basedir}/src"
output="${basedir}/built/MyFunExecutable" />
The following options can be set when using the task:
| Attribute | Description | Required |
|---|---|---|
| srcdir | Location of the Haskell files. | Yes, unless nested filesets are present. |
| output | Location of the executable to be built. | No, but highly recommended. |
| compiler | Which compiler to use; defaults to ghc. | No |
| mainmodule | The name of the main module to use, running in make mode. | No |
| verbose | Asks the compiler for verbose output; defaults to no. | No |
| optimize | Indicates whether source should be compiled with optimization; defaults to off. | No |