Building projects in Eclipse relies on the Haskell Cabal, and to allow you to easily view and modify your project's Cabal file, there is an editor that supports Cabal's package description files.
Note that saving changes to the Cabal file will trigger a rebuild of the project. Also note that the Cabal file is THE source for the configuration of the your project, so for example all dependencies on external packages need to be made explicit in that file (build-depends field).
In the Package you can change the Cabal properties that affect the entire project. This includes descriptive properties such as project name, version, author, maintainer, license, description, homepage; and also properties that affect the build, such as minimal Cabal version.
Some packages need to access data files during its execution. The way Cabal has to deal with them can be configured in the Cabal editor:
Paths_<package>
module which tells the paths to
the files in the installed system,Cabal deals with three kinds of components, that is, objects created from the source code. Those kinds are libraries, executables and test suites, and can be configured thorugh their respective tab in the Cabal editor.
In general, there are four configuration sections for each component:
src
folder will be created, and it's recommended to place your
files in that folder.Each project can have at most one library. You can decide whether or not to build one in the Library tab.
On the other hand, the Executables and Test suites tabs allow to have as many components as you want for that type. On the left of the window you will find the list of components that you already have in your project. You can add more clicking the + button above the list.
For test suites, you can also select the type of test you are creating. Currently ony executable tests that use Test-framework can be run withing EclipseFP.
The source tab provides and editor with syntax coloring, code folding, and makes also some templates available that let you easily create a new Cabal package description.
The editor is by default registered for the file extension
.cabal
. To trigger a template, hit Control+SPACE
at any (non-comment) position in such a file. For some entries (e.g. the
license-file
entry, you can also hold the Control
key and point with the mouse on the value - the entry is then changed into
a link that takes you directly to the referenced file (if it exists) when
you click on it.