HaskTask

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.

Download

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.

Using

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" />

Documentation

The following options can be set when using the task:

AttributeDescriptionRequired
srcdirLocation of the Haskell files. Yes, unless nested filesets are present.
outputLocation of the executable to be built. No, but highly recommended.
compilerWhich compiler to use; defaults to ghc. No
mainmoduleThe name of the main module to use, running in make mode.No
verboseAsks the compiler for verbose output; defaults to no.No
optimizeIndicates whether source should be compiled with optimization; defaults to off.No