Saturday, October 20, 2007

Cohatoe 0.7 preview

This version mostly completes what I started in the 0.6 version, with a particular focus on the tool support that comes with the Cohatoe SDK. It introduces the notion of a Cohatoe Plugin project, i.e. a project that contains both Java code and Haskell code for an Eclipse plugin. I have also added some more developer documentation to the Cohatoe entry in the Eclipse Help system.

Cohatoe Plugin projects

A Cohatoe Plugin project is a special type of project in the workspace. It inherits from Eclipse's (PDEs) own plugin project, but in addition it 'knows' about Cohatoe-based extensions and facilitates their development. For instance, it gives a warning if there is no dependency to the Cohatoe server core plugin.

More important, once a project is marked as a Cohatoe project, it is ensured whenever files in the project change that the Haskell source files in hs-src/ get compiled and the object code is placed at the object code folder for the current platform (ignoring contents of the object code folder which belong to other platforms). This should facilitate a lot of handling (and you can ignore the details of the naming conventions for platform-specific folder names).

If you use the Cohatoe extension wizard for creating new extensions, the project where you do this is automatically marked as a Cohatoe project. You can also set and unset this mark by right-clicking a project in the workspace and selecting Toggle Cohatoe Nature.

Autobuild of Cohatoe projects

When you change someting in a Cohatoe project, an automatic build is triggered in the background that re-compiles (if necessary) the sources in hs-src/. For this purpose, a simple Cabal configuration is generated (into the INTERNAL/cohatoe/ subfolder of the project) and executed. The outputs of the build are displayed on the Console View. If Haskell source files from the hs-src folder are mentioned in the build output (normally in error and warning messages), you can click them and an editor opens on the respective source location. (It helps if you have EclipseFP installed, of course, since in this case the editor that opens is EclipseFP's Haskell source editor). If you want to configure compiler options or package dependencies for the autobuild, you can do so in the Cabal configuration file.

I think this is an important step for EclipseFP (of which Cohatoe is a part). On the way to transform it into a self-hosted IDE for Haskell that is partly implemented in Haskell, it is necessary to have better support for the development of the Haskell bits in the workspace. EclipseFP has good editing support, but since it is a more general IDE for Haskell development, it would not be good to build knowledge about Cohatoe structures directly into it. The Cohatoe SDK plugins now add this on top of EclipseFP and JDT/PDE.

Have fun :-)

No comments: