My favorites | Sign in
Project Home Downloads Wiki Issues
Search
for

sbt has moved

sbt has now completely moved to GitHub.

See https://github.com/harrah/xsbt/wiki.

Getting Started

IntegrationSupport  
Updated Jul 27, 2011 by dmhar...@gmail.com

sbt has moved

sbt has now completely moved to GitHub.

See https://github.com/harrah/xsbt/wiki/sbt-0.10-plugins-list.

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/

Comment by Ray.Rac...@gmail.com, Jul 21, 2009

If you are an emacs use, well of course you are, here is a small script to run sbt as an inferior-mode process from within emacs. It uses compile.el as well allowing one to migrate through the compiler errors.

http://github.com/RayRacine/scallap/tree/master/tools/emacs

Comment by project member dmhar...@gmail.com, Jul 21, 2009

Added, thanks!

-Mark

Comment by sean8...@gmail.com, Feb 12, 2010

A quick note for those trying to use Emacs + SBT + sbt.el on Windows. Be sure to disable JLine support by adding the system property -Djline.terminal=jline.UnsupportedTerminal? to your SBT invocation.

For whatever reason, Emacs can't handle subprocess I/O that goes through the Windows CON: device, which is what JLine seems to do.

Comment by project member dmhar...@gmail.com, Feb 12, 2010

Thanks for that tip. I've updated the page.

-Mark

Comment by allan.er...@gmail.com, Mar 24, 2010

Any luck for Aquamacs Emacs users on OS X? The only good results I've had are to disable formatting with the property -Dsbt.log.noformat=true in my sbt script.

I tried: (ansi-color-for-comint-mode-on)

in my .emacs -- no joy.

Comment by guybolto...@gmail.com, Apr 24, 2010

The stuff on integration via IvyDE works, but doesn't include test dependencies. Based on this list posting:

http://groups.google.com/group/simple-build-tool/msg/0cf2afcea582a8d2

...I've added this to my project file:

  def ivyPublishConfiguration = 
    new DefaultPublishConfiguration("local", "release") {
      override protected def deliveredPathPattern = 
        outputPath / "[artifact].[ext]" 
      override def configurations =
        Some(List(Configurations.Compile, Configurations.Test))
    }

  lazy val deliverIvy = deliverTask(deliverIvyModule, ivyPublishConfiguration, false)

deliver-ivy creates a scala-version-specific ivy.xml in target/SCALA-VER

Comment by wanahoga...@gmail.com, Jun 15, 2010

There is another way to run sbt wihtin Vim now: http://github.com/MarcWeber/vim-addon-sbt

Comment by wanahoga...@gmail.com, Jun 16, 2010

On scala I got the tip that there is a plugin for IDEA as well: http://github.com/mpeltonen/sbt-idea-plugin

Comment by wanahoga...@gmail.com, Jun 29, 2010

Vim users don't miss this: http://github.com/romanroe/codefellow

Comment by pab...@gmail.com, Nov 28, 2010

There is a sbt plugin for sbt that works along with the Scala bundle at: http://www.sidewayscoding.com/2010/08/using-textmate-for-scala-development.html

It basically is a shell window next to your editing window, which works pretty well.

Comment by project member dmhar...@gmail.com, Nov 29, 2010

Thanks, updated.

Comment by wyue...@gmail.com, Dec 19, 2010

Is there bash-completion support for sbt?

Comment by oatkin...@gmail.com, Jan 12, 2011

The sbt plugin for hudson should be probably be mentioned on this page as well. Here is the link. http://wiki.hudson-ci.org/display/HUDSON/sbt+plugin

Comment by project member dmhar...@gmail.com, Jan 21, 2011

Done, thanks.

Comment by sket....@gmail.com, Feb 17, 2011

Just for notes, I have recently started developing a plugin for jEdit. It is quickly improving, and is available at https://github.com/StefanE/SBT4jEdit

Comment by project member dmhar...@gmail.com, Feb 21, 2011

added, thanks.

Comment by leifwick...@gmail.com, May 5, 2011

To get the errorformat (efm) for vim to work correctly, I had to tell sbt not to output any color by changing the makeprg to include the -Dsbt.log.noformat=true switch, like

set makeprg=sbt\ -Dsbt.log.noformat=true\ compile
Comment by kjellwin...@gmail.com, May 13, 2011

I have created a text editor with sbt integration. It is useful if you want to set up a lightweight programming environment for Scala quickly. http://scala-edit.googlecode.com

Comment by project member dmhar...@gmail.com, May 14, 2011

Interesting thanks!

Comment by r.j.oo...@gmail.com, Jul 1, 2011

New SBT Eclipse plugin for SBT 0.10.x: https://github.com/typesafehub/sbteclipse

Powered by Google Project Hosting