SBT Plugin for IntelliJ IDEA Nightly Builds

SBT build definitionWe know that you have been waiting for SBT project support in IDEA too long. That’s why we make SBT plugin nightly builds available even before an actual release of the plugin.

Features

Though work on SBT plugin is still in progress, the following features are already available:

  • SBT project import.
  • Incremental project model updating.
  • Auto-import (on project definition changes).
  • Editing of .sbt files (with full highlighting, auto-completion and navigation).

Many more features are on the way (see the roadmap below).

Installation

SBT plugin is currently available for IDEA 12 (“Leda”), the plugin builds for the IDEA 13 EAPs are coming soon.

You can use any of the following methods to install or update the plugin in IDEA:

  • Automatic updates (recommended)
    Add the following URL to the list of custom plugin repositories in Settings | Plugins | Browse Repositories | Manage Repositories:
    After that, you may install the plugin via Settings | Plugins | Browse Repositories.
    IDEA will check for the latest plugin builds automatically.
  • Manual download
    Get the latest build from SBT plugin nightly builds page and install the downloaded archive via Settings | Plugins | Install plugin from disk.

  • Build from sources
    If you are eager to get the latest snapshot of the plugin, you may use SBT plugin project on GitHub to clone the plugin repository by entering the following command:
    Then run sbt dist to build a binary distribution of the plugin (you may need to specify locations of IDEA and Scala plugin first).

Usage

To import an SBT project in IDEA use either File | Open or File | Import Project menu command and then choose a desired build.sbt file (alternatively, you may choose a project root directory).

IDEA will analyze the SBT project structure and create a corresponding project model that includes all required modules, source/output directories, libraries, dependencies, etc.

If you select Use auto-import check-box in the import dialog, IDEA will monitor the SBT project definition for changes and update the corresponding project model automatically (preserving your local modifications to the project).

In addition to ordinary modules (which correspond to SBT “projects”), IDEA creates special “SBT” modules, which describe SBT build definitions themselves (.sbt files and Scala files in project directories) in order to provide highlighting, auto-completion and navigation for these files and SBT libraries.

Roadmap

Here are the features that we’re going implement in the near future:

  • SBT console.
  • Command tool window.
  • Project make via SBT.

Feedback

Keep in mind that SBT plugin project is currently in alpha stage, don’t be too hard on it :)

Please, report bugs and submit feature requests to our YouTrack (set “SBT” as a subsystem).

Post ideas and questions to our forum.

Complete plugin code is available as a project on GitHub.

About Pavel Fatin

IntelliJ Scala plugin developer (http://pavelfatin.com)
This entry was posted in News and Events and tagged , , , , , , , . Bookmark the permalink.

27 Responses to SBT Plugin for IntelliJ IDEA Nightly Builds

  1. Dmitry Ivanov says:

    Awesome stuff! Thanks! Starting testing… =)

  2. item says:

    Great project, thanks! One thing that I’m missing from the sbt-idea plugin (gen-idea) is automatic setup of run configurations. That would make for a great feature. I.e., use sbt to detect the main class (perhaps even all possible main classes), and generate corresponding run config, so you can build + go straight away.

  3. Omer van Kloeten says:

    Which would you say is better for generating the IDEA project for a Play! Framework project? The SBT plugin’s import mechanism or Play’s idea command?

    • Pavel Fatin says:

      It’s hard to say, more testing is needed. We’re going to use SBT plugin mechanisms in Play 2 plugin for IDEA directly after a while.

    • Robert Tjærestump says:

      Well I can tell you: Play’s version has never really worked perfectly.
      It creates some broken dependencies that you have to fix manually every time you run “play idea”.

      And it turns out that neither the author of sbt-idea or play will acknowledge the problem.

      So I’d go for this new plugin. It doesn’t create bad dependencies at the least.

  4. Assaf Israel says:

    This is great news. When can we expect SBT-console integration?
    This is especially important in multi-module projects where the Idea console can’t resolve classes in different target folders. Running console from the SBT console is nice, but lack auto-complete and syntax highlighting.

  5. Robert Tjærestump says:

    Thank youuuuuu!!!

    If scala is ever to grow, we need proper integration.
    This is a positive step. =)

  6. jtonic says:

    Great news.

    IDEA is a great IDE (best on the market IMHO)
    Scala is a great language
    JVM is a great virtual machine
    SBT is a great build tool.

    Working with all of this is a great pleasure.

    GJ

  7. Vincenzo says:

    Good stuff.
    Thanks!

  8. Gus says:

    Great work! Been waiting for this for a while. Would be nice to have a view similar to the maven tool window, with phases, dependencies and ability to download sources, but they’re just a wish list. Keep up the good work.

  9. Robert Tjærestump says:

    When is the new SBT console ready btw? :-)

  10. Alain Sahli says:

    Hi!

    Nice work!

    I tried to import a project with SBT 0.13.x but it failed. Is there a way to change the SBT runtime used by IntelliJ?

  11. Alain O'Dea says:

    This is a great feature. Having SBT Import Project support is the missing link for applying SBT to all internal projects. The CLI works, but most staff prefer a pure IntelliJ workflow so this is a huge benefit. Thank you :)

  12. Michael Lesniak says:

    Great to see progress on this plugin.

    Thanks for developing it.

  13. Ahmad says:

    Any plan for android support ?

  14. Tomer Ben David says:

    Thanks.

  15. Pingback: Laurent Kempé | Functional Programming Principles in Scala using JetBrains IntelliJ IDEA

  16. Ian says:

    You guys are awesome!
    This is why Idea is the best IDE out there.
    Thank you and keep up with the good work!

  17. Dave says:

    Have you considered merging this project in with http://plugins.jetbrains.com/plugin/5007 the plugin by Esko Luontola. Your import is awesome, and the other plugin has the sbt console already. I think a merger would make a really useful sbt plug-in

  18. Suriyanto says:

    This is a great plugin and is the reason that we starting to look into IDEA after all the years of using Eclipse. However we are really looking forward to upgrading to sbt 0.13. What is the schedule for this plugin to support sbt 0.13 on IDEA 12?

  19. Wojtek says:

    It does not work on 12.1.6. I have investigated the plugin.xml file inside the plugin and it has the following:

    I guess someone has been working on the plugin on the newer version of IDEA and now Idea 12 is not compatible with the nightly build of the plugin…

  20. Wojtek says:

    the plugin.xml contains: idea-version since-build=”132.943″ until-build=”133.0″

  21. Pingback: Cannot install SBT for IntelliJCopyQuery CopyQuery | Question & Answer Tool for your Technical Queries,CopyQuery, ejjuit, query, copyquery, copyquery.com, android doubt, ios question, sql query, sqlite query, nodejsquery, dns query, update query, inse

  22. Pingback: CyanogenMod 10.2 stable builds released, CM 11 nightlies coming soon | Gadget Tech

  23. Marino says:

    Hi Pavel, I want to write a Gradle plugin for Play! Framework. My idea is to write a plugin that parse Play! SBT dependencies and add it to IDEA and Gradle dependencies. Where do i start looking?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">