IntegrationSupport  

Introduction

This page describes approaches to using sbt with third-party tools. It is a work in progress.

Emacs

There is a script to run sbt as an inferior-mode process from within emacs. It uses compile.el, allowing one to migrate through the compiler errors.

On Windows, disable the native JLine interface using by adding the system property

-Djline.WindowsTerminal.directConsole=false

to your sbt startup script or disable JLine support completely with the system property:

-Djline.terminal=jline.UnsupportedTerminal

You may want to make your sbt startup script look something like the following:

if "%TERM%"=="emacs" set jlineopt=-Djline.WindowsTerminal.directConsole=false
java -Xmx512M %jlineopt% -jar ...

(From the comments in #63)

Vim

See http://github.com/MarcWeber/vim-addon-sbt

Alternatively: In Vim, you can add the following to your .vimrc file to support building via :make and navigating to errors and warnings:

set makeprg=sbt\ compile
set efm=%E\ %#[error]\ %f:%l:\ %m,%C\ %#[error]\ %p^,%-C%.%#,%Z,
       \%W\ %#[warn]\ %f:%l:\ %m,%C\ %#[warn]\ %p^,%-C%.%#,%Z,
       \%-G%.%#

You'll need to cd into your project root to issue the :make command.

TextMate

See http://www.sidewayscoding.com/2010/08/using-textmate-for-scala-development.html.

IDEA

sbt plugin/processor: https://github.com/mpeltonen/sbt-idea

IDEA plugin: http://plugins.intellij.net/plugin/?idea&id=5007

Netbeans

https://github.com/remeniuk/sbt-netbeans-plugin

Eclipse

There are currently three options for Eclipse integration.

  1. There is an Eclipse plugin to pick up dependencies from your lib_managed directory.
  2. There is another Eclipse plugin to create an Eclipse project from an sbt project. See the mailing list post for details.
  3. Use IvyDE as described below.

IvyDE approach

Initial Setup

  1. Install IvyDE
  2. Set up your sbt project (dependencies, repos, settings, ...)
  3. Issue reload and deliver-local at the sbt prompt.
  4. Set up the Eclipse classpath container using IvyDE as follows:
    1. Go to project properties -> Java Build Path. Make sure you use the same version of Scala in both Eclipse and sbt.
    2. Then, Add Library... -> IvyDE managed dependencies -> Ivy file: target/ivy-1.0.xml. Select appropriate configurations.

Updating

  1. Add/remove dependencies in your project definition.
  2. Issue reload and deliver-local in the sbt console
  3. Update Eclipse classpath container as follows: right-click on the Ivy container in your project (should look like: target/ivy-1.0.xml [compile]) and click on the bottommost Refresh (not the one with F5, but just below Resolve)

Jenkins

Jenkins plugin: http://wiki.jenkins-ci.org/display/JENKINS/sbt+plugin.

JEdit

JEdit plugin: https://github.com/StefanE/SBT4jEdit

ScalaEdit

A text editor for Scala programmers with support for sbt: http://code.google.com/p/scala-edit/