Sbt integration

157 views
Skip to first unread message

Rich Oliver

unread,
Dec 8, 2015, 1:22:38 PM12/8/15
to Scala IDE User
What's the current state of play for sbt? Is it it possible to use an sbt project definition in Eclipse or do you effectively have to create the project twice, once for development  and once for packaging and deployment? there's an sbteclipse git hub account, but it looks like its dead and hasn't been updated in a while.

I use Linux and the best method I've found so far is create an Eclipse project with one source folder and then create symbolic links to the package source folders naming the links as the package names. I have a utilities package, which I not only use in every project but update and develop in every project. When I switch projects I just have to remember to refresh the the utilities package to bring into sync. I've also found it cleaner to keep the Eclipse projects separate from the work spaces.

Simon Schäfer

unread,
Dec 8, 2015, 2:57:54 PM12/8/15
to scala-i...@googlegroups.com


On 12/08/2015 07:22 PM, Rich Oliver wrote:
What's the current state of play for sbt? Is it it possible to use an sbt project definition in Eclipse or do you effectively have to create the project twice, once for development  and once for packaging and deployment? there's an sbteclipse git hub account, but it looks like its dead and hasn't been updated in a while.
sbteclipse may not get updates often but it also works fine in a lot of cases. Is it not possible to generate Eclipse project files for your projects? Why do you want to create the project twice? Because of classfile recreation?


I use Linux and the best method I've found so far is create an Eclipse project with one source folder and then create symbolic links to the package source folders naming the links as the package names. I have a utilities package, which I not only use in every project but update and develop in every project. When I switch projects I just have to remember to refresh the the utilities package to bring into sync. I've also found it cleaner to keep the Eclipse projects separate from the work spaces.
When I understand you correctly, you have several sbt projects that all depend on another project which you do not want to add as a normal dependency because you don't want to go the route of republishing the project after a change. Inside of Eclipse you can easily add your utils project as a required project, which should make any changes visible immediately. Did you try that out and didn't it work for you?
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-ide-user/ed1ebd1e-8864-41ad-8509-ee2d8ccdeb2b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rich Oliver

unread,
Dec 9, 2015, 1:00:16 PM12/9/15
to Scala IDE User
On Tuesday, 8 December 2015 19:57:54 UTC, Simon Schäfer wrote:

sbteclipse may not get updates often but it also works fine in a lot of cases. Is it not possible to generate Eclipse project files for your projects? Why do you want to create the project twice? Because of classfile recreation?

I like to structure my source files according to my own preferences. So I created soft links with in the Eclipse Project src directory. In the past I tried to avoid Sbt as much as possible even going as far as writing my own build tool which I could call from within eclipse. In the past I tried to get use Eclipse to package but I never got it to work satisfactorily. Presumably as an IDE you should even be able to use it for deployment.
 
When I understand you correctly, you have several sbt projects that all depend on another project which you do not want to add as a normal dependency because you don't want to go the route of republishing the project after a change. Inside of Eclipse you can easily add your utils project as a required project, which should make any changes visible immediately. Did you try that out and didn't it work for you?

I don't find the Eclipse project, workspace system works for me, I guess its basically the same as Visual Studio's Projects / Solutions. I don't need packages to be duplicated as projects.

Anyway what's changed is that I'm now using Scalaljs. So I need to work on server code and browser client code at the same. So far I've just played with Scalajs on its own, but just for development, I'm going to need to, stop the old server if its running, recompile the server and client side Scala, build the server (which programmatically produces Http, Html and CSS), create the client side JavaScript file, launch the server and then refresh the browser.

So its all a bit up in the air and I'm not quite sure how to proceed.

Simon Schäfer

unread,
Dec 9, 2015, 1:18:30 PM12/9/15
to scala-i...@googlegroups.com
I would use sbt in the way how it should be used. ;) sbt is already quite flexible in allowing weird project setups and giving up personal preferences is not always a bad thing. And Improving the IDE experience for users who use their own home grown build tools is not exactly a use case we have everyday. Not sure what we can do to help you here.
--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.

Rich Oliver

unread,
Dec 20, 2015, 10:45:50 PM12/20/15
to Scala IDE User
First let me say I've noted and appreciate Scala IDE people's amazingly fast responses to my posts over the years. I think you do a very good job of making people feel supported in their use of Eclipse for Scala, it feels like a commercial level of support for free! So I certainly wouldn't expect support for my own build tool. I was just trying to give a very rough picture of where I was at. Before using Scalajs I kept my use of sbt to a minimum. Where as with scalajs its actually been helpful.

So I guess to be more precise I'm trying to find out what the road map for Scala Eclipse is. In the future will the default / standard method for project creation be through sbt or will it be through the Eclipse interface? Is Scala IDE going to built on top of sbt so to speak or will sbt be just another tool to interface with?

Simon Schäfer

unread,
Dec 21, 2015, 7:13:35 AM12/21/15
to scala-i...@googlegroups.com


On 12/21/2015 04:45 AM, Rich Oliver wrote:
> First let me say I've noted and appreciate Scala IDE people's
> amazingly fast responses to my posts over the years. I think you do a
> very good job of making people feel supported in their use of Eclipse
> for Scala, it feels like a commercial level of support for free! So I
> certainly wouldn't expect support for my own build tool. I was just
> trying to give a very rough picture of where I was at. Before using
> Scalajs I kept my use of sbt to a minimum. Where as with scalajs its
> actually been helpful.
>
> So I guess to be more precise I'm trying to find out what the road map
> for Scala Eclipse is. In the future will the default / standard method
> for project creation be through sbt or will it be through the Eclipse
> interface? Is Scala IDE going to built on top of sbt so to speak or
> will sbt be just another tool to interface with?
We don't have a plan for how project creation should work in future. But
if it shows ups that we need to support multiple ways on how a project
can be created we would try to abstract over it. So far we only have a
project wizard that can create Eclipse projects. We worked on a wizard
for sbt projects in the past but never finished it due to time
constraints. Once the sbt project wizard is up and running the goal to
unify it with the Eclipse project wizard becomes interesting. Once we do
this it makes of course sense to provide an interface that allows
further implementations that can depend on arbitrary build tools. The
same applies not only for project wizards but for the entire build tool
integration in Scala IDE. So far this is only a minor interest and
therefore it has not yet been done.

Rich Oliver

unread,
Dec 31, 2015, 8:56:09 AM12/31/15
to Scala IDE User
I'm still somewhat confused. It currently says this on the road map for 4.3
  • sbt-server integration: This is a long awaited feature. Every user of Play or Scala.js projects has the problem that not all IDE features work reliable on their codebase because internally the IDE uses its own builder to build the application, whereas it really should use the builder of your project. sbt is the builder of choice of Scala users and sbt-server makes it possible to remotely control it by the IDE. By integrating sbt-server into Scala IDE all problems that arise from bytecode inequality that comes from multiple builds fighting each other should be gone.

    Beside from the sbt-server integration, Scala IDE will provide an editor for *.sbt files and it will even be possible to fully handle the Scala code in your project/ directory. Furthermore you will no longer need the sbteclipse plugin due to the fact that the IDE will be able to automatically import your sbt projects and track changes to them in the background and apply them silently to your working environment.

Does this no longer apply or has it been implemented?


Simon Schäfer

unread,
Dec 31, 2015, 10:30:39 AM12/31/15
to scala-i...@googlegroups.com
The road map is as always out of date. We got delayed with this work. Some parts are already implemented, some other parts not yet. I'm planning to come back to it in January.

--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.

Daniel Toone

unread,
Jan 5, 2016, 3:37:39 PM1/5/16
to Scala IDE User
Wow...this looks amazing! Does this also mean we would be able to debug directly in Eclipse without having to set up a forking JVM in sbt with debug listeners?

Simon Schäfer

unread,
Jan 5, 2016, 4:01:32 PM1/5/16
to scala-i...@googlegroups.com


On 05.01.2016 19:15, Daniel Toone wrote:
Wow...this looks amazing! Does this also mean we would be able to debug directly in Eclipse without having to set up a forking JVM in sbt with debug listeners?
Yes, this is how it is supposed to work.



On Thursday, December 31, 2015 at 5:56:09 AM UTC-8, Rich Oliver wrote:
I'm still somewhat confused. It currently says this on the road map for 4.3
  • sbt-server integration: This is a long awaited feature. Every user of Play or Scala.js projects has the problem that not all IDE features work reliable on their codebase because internally the IDE uses its own builder to build the application, whereas it really should use the builder of your project. sbt is the builder of choice of Scala users and sbt-server makes it possible to remotely control it by the IDE. By integrating sbt-server into Scala IDE all problems that arise from bytecode inequality that comes from multiple builds fighting each other should be gone.

    Beside from the sbt-server integration, Scala IDE will provide an editor for *.sbt files and it will even be possible to fully handle the Scala code in your project/ directory. Furthermore you will no longer need the sbteclipse plugin due to the fact that the IDE will be able to automatically import your sbt projects and track changes to them in the background and apply them silently to your working environment.

Does this no longer apply or has it been implemented?


--
You received this message because you are subscribed to the Google Groups "Scala IDE User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-ide-use...@googlegroups.com.

Omar Reddam

unread,
Feb 17, 2016, 3:05:04 AM2/17/16
to Scala IDE User
Hello,

Nothing new here? Is this expected for the next version?

Thanks,

Simon Schäfer

unread,
Feb 17, 2016, 5:34:12 AM2/17/16
to scala-i...@googlegroups.com


On 02/16/2016 11:00 PM, Omar Reddam wrote:
Hello,

Nothing new here? Is this expected for the next version?
We concentrated our forces to do mostly bug fixing, which means that the upcoming 4.4 won't include sbt support yet. Our plan is to include this for the 4.5 release.

Simon
Reply all
Reply to author
Forward
0 new messages