Student introduction - SBT console integration

241 views
Skip to first unread message

Sandro Gržičić

unread,
May 21, 2012, 4:49:43 PM5/21/12
to scala-...@googlegroups.com
Hi everyone!

My name is Sandro Gržičić and this summer I'll be working on adding a SBT console on the best Scala IDE there is, ScalaIDE for Eclipse!

I'm a third year student on the Faculty of Electrical Engineering and Computing (module Computing -> Telecommunications and Informatics) currently studying in Zagreb, Croatia. I'm originally from Crikvenica, Croatia.

This is my second year at GSoC, last year I was working (and still am!) on the Protocol Buffers compiler in Scala, ScalaBuff.

My mentor is Mirco Dotta and after several Skype meetings with him, he seems like a great and knowledgeable guy. Feel free to e-mail me if you have some embarrassing insider info about him! (just kidding, of course :) )

The features planned so far include: 
- full-featured custom SBT console view
- full history support (just like in the standalone SBT)
- tab completion 
- coloring (customizable)
- support for editing SBT build files in a special SBT context

We'll see about additional features later, but this is a basic set, for now.

I have been lurking on this group for some time now; the community seems really nice and helpful. I hope my contribution, although small, will help improve ScalaIDE and increase Scala adoption. It feels great to be contributing to Scala in some way, especially since I have a lot of faith in the language future! :)

Sandro

iulian dragos

unread,
May 21, 2012, 5:24:10 PM5/21/12
to scala-...@googlegroups.com
Hi Sandro!

Welcome, and thanks for the introduction.

Looking forward to seeing your contributions!

cheers,
iulian
--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais

Matt Russell

unread,
May 22, 2012, 4:51:53 AM5/22/12
to scala-...@googlegroups.com
Hi Sandro,

I'm a big user of sbt, both at work and on open source projects, and it will be awesome to get deeper integration with Scala IDE!

Is the intention to support the usual Scala editor capabilities (autocomplete, code navigation etc) for "full configuration" Build.scala files?

-- Matt

Sandro Gržičić

unread,
May 22, 2012, 3:10:31 PM5/22/12
to scala-...@googlegroups.com
Hi,

well, my intention is that the Scala context for the SBT Build files should be identical to any other .scala file inside the project, just that these files will have SBT dependencies instead of the project dependencies, so that all usual ScalaIDE features work the same as on any other Scala file.

That's my idea, at least; we'll see how feasible is it to do it this way.

David Bernard

unread,
May 23, 2012, 7:57:34 AM5/23/12
to scala-...@googlegroups.com
Hi,

sbt is a project in the project at dependencies level (as you note), but also :
* .scala file, those for sbt and plugins should be isolated of the main project
* scala version, IIRC sbt require a specific version that can be
differente from the main project => except if you provide a version of
sbt that match the scala version of scalaIDE

my 2c

/davidB

Mirco Dotta

unread,
May 26, 2012, 9:18:21 AM5/26/12
to scala-...@googlegroups.com
> sbt is a project in the project at dependencies level (as you note), but also :
> * .scala file, those for sbt and plugins should be isolated of the main project

Of course.

> * scala version, IIRC sbt require a specific version that can be
> differente from the main project => except if you provide a version of
> sbt that match the scala version of scalaIDE

David, I'm not sure I'm understanding your point. In theory, it's enough to have a
sbt-launch.jar to bootstrap sbt, and then you can compile your project against any
Scala version you like (as long as it is supported by sbt compiler-interface.jar, I suppose).

David Bernard

unread,
May 27, 2012, 3:28:34 AM5/27/12
to scala-...@googlegroups.com
On Sat, May 26, 2012 at 3:18 PM, Mirco Dotta <mirco...@typesafe.com> wrote:
>> sbt is a project in the project at dependencies level (as you note), but also :
>> * .scala file, those for sbt and plugins should be isolated of the main project
>
> Of course.
>
>> * scala version, IIRC sbt require a specific version that can be
>> differente from the main project => except if you provide a version of
>> sbt that match the scala version of scalaIDE
>
> David, I'm not sure I'm understanding your point. In theory, it's enough to have a
> sbt-launch.jar to bootstrap sbt, and then you can compile your project against any
> Scala version you like (as long as it is supported by sbt compiler-interface.jar, I suppose).

Sbt and its plugins are locked to a specific scala version, (at least
the last time I follow sbt 6 month ago).
eg :
* sbt 0.7.7 only run with scala 2.7.7 but can build on several version
* sbt 0.10 only run with scala 2.8.1
* sbt 0.11 only run with scala 2.9.1

BUT once again, I'm not an SBT user and this information need to be
verified (ask sbt'ml, Mark or Joshua)

If confirmed, then "- support for editing SBT build files in a special
SBT context" can need to use a different scala-library and
scala-compiler than the one provide by the IDE.

Sandro Gržičić

unread,
Aug 7, 2012, 6:40:33 AM8/7/12
to scala-...@googlegroups.com
Hey everyone,

I've decided to publish a small update regarding my project.

Most of the planned features are now in SBT Console. There are some bugs, however nothing too major. In case you want to give it a try, you can use Mirco's nightly update site: 


Note that the plugin only works with Scala IDE 2.1, preferably the latest nightly (although it should work with the stable versions as well, in case it doesn't, definitely open a ticket).

I've also submitted a pull request to the Scala IDE Ecosystem: https://github.com/scala-ide/ecosystem/pull/1

In case it gets accepted, you'll be able to use the Ecosystem update sites instead of the above ones.


Quick review of using it:

Set the location of sbt-launch.jar in Preferences -> Scala -> SBT Console.
Open the Console with Scala (in the top menu bar) -> Show/hide SBT console (or press CTRL+ALT+SHIFT+S)
The console supports tab completion (with some quirks), history support, syntax coloring and error highlighting and hyperlinking.
Build files are also supported (although this area is under development), if you open a build file inside the project/ directory, you'll get sbt dependencies auto-added to your classpath (assuming the sbt version detection code works correctly) and removed when you navigate to another scala file not in the project/ directory of your project.
You can use the handy terminate button located in the console action bar to close it (or press exit, or press the shortcut key again, or press show/hide sbt console again). :)

I'd like to thank in advance whoever decides to try it and preferably report bugs using my repo's ticket system. :) Remember that the plugin is under heavy development (but it shouldn't crash your Scala IDE or do any other nasty things).

Thanks!
Sandro

Sandro Gržičić

unread,
Aug 7, 2012, 7:16:19 AM8/7/12
to scala-...@googlegroups.com
Oh, and I forgot, I'd like to thank my mentor Mirco Dotta for providing immeasurable support and of course Iulian Dragos for writing most of the base SbtConsole code (you can find it in https://github.com/scala-ide/scala-ide/tree/feature/sbt-console-builder). Additionally, Trond Bjerkestrand is my first independent tester so I'd like to thank him as well. :)

Now, back to work (for me)! :)
Reply all
Reply to author
Forward
0 new messages