I have started to add some helpful tools to the Plugin Development Environment (PDE) in Eclipse to facilitate working with Cohatoe. One of the things that still take some time (in my experience when implementing the examples) is creating the source files and manifest entries that are needed for a new Haskell contribution via Cohatoe. It's not much (and mostly boilerplate that is always almost the same stuff), and it can actually be generated from very little input by the user.
So I have first added a wizard for creating a new Cohatoe extension. Suppose that you already have a plugin project. Then you can now just go to the Extensions Tab on the Plugin Manifest editor, click Add > Extension Wizards > Cohatoe Development Tools > Haskell Contribution, and you get a wizard that generates all the files and manifest entries that you need, namely:
- It adds the dependency to the Cohatoe Core plugin to the
META-INF/Manifest.mffile (if it is not already there).
- It adds an extension in the
plugin.xmlfile and declares the Haskell source file along with the Java implementation and interface types.
- It generates the Java interface and implementation types, together with the code necessary to call the server (i.e. what happens inside the implementation class) and with a usage example that can be copied to where you want to call the function from your Java code.
- It generates the skeleton source file for the Haskell module that is called.
For the time being, this supports only contributing source files, if you want to change this into an object file contribution, you have to enter the path to the object files manually in the
plugin.xml, in the
codeFileattribute (where originally the source file is specified in what the wizard has generated).
I think this should considerably ease and speed up the process of creating the plumbing for a new Haskell contribution, and help you to focus on the actually more interesting bits, namely the Haskell code itself, and the places where it is eventually called in the Eclipse plugin :-)
(NB: this is not yet in the downloadable preview, but in the Darcs repo. But I think I'll do another preview build soon.)