Wednesday, June 30, 2010

New, new .ensime format

In my previous post I proposed a new ENSIME configuration format, to support the inclusion of Maven, Ivy, and sbt dependencies. Since then I've noticed that external build specifications are also useful for launching the REPL and the debugger. Specifically, one needs to know the runtime dependencies of the project, which are often different from the compilation dependencies (usually a super-set of). I've modified the .ensime file format so that Maven,Ivy and Sbt users are better able to utilize their existing build configurations in ENSIME.

Here's an example .ensime, for an sbt project:

(

:server-root "/home/aemon/src/misc/ensime/dist"
:server-cmd "bin/server.sh"

:use-sbt t
:sbt-compile-conf "compile"
:sbt-runtime-conf "runtime"

:project-package "com.ensime"
:debug-class "com.ensime.server.Server"
:debug-args ("/tmp/ensime_port.tmp")

)

This configuration will cause ENSIME to use the "compile" dependencies for building and the "runtime" dependencies when launching the REPL or debugger. The :use-sbt directive also sets default values for the :sources and :target directives (which can be overridden if needed).

A similiar maven configuration would look like this:
:use-maven t
:maven-compile-scopes "compile"
:maven-runtime-scopes "runtime"

And for Ivy:
:use-ivy t
:ivy-compile-conf "compile"
:ivy-runtime-conf "runtime"

The options available are fully explained in the .ensime.example file in the root of the distribution.

2 comments: