Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build/test Scala without IDE dependence?

I'm well into learning Scala now and enjoying it very much; I hope to start future projects in it, rather than Java. What I'm enjoying less is the (relatively) poor IDE support. I've found both IDEA and Eclipse with the Scala Plugin (including nightly builds) to be a bit unreliable or difficult to use - I want something I can always depend on. E.g. yesterday I couldn't get a fresh install of eclipse+plugin to run my tests at all, or even open an editor window!

I'm considering hopping between Eclipse/IDEA depending on which suits the task at hand best and more importantly cutting my dependence on the IDE for building and running tests (ScalaTest). This is non-trivial for me since I've grown up on Java in Eclipse; leaving Eclipse SVN to use GIT was initially a big deal. Given that I only have time to learn one tool, should it be Ant, Maven, buildr, sbt,.... ? How do other people work?

like image 985
Pengin Avatar asked Sep 16 '10 07:09

Pengin


People also ask

Does Scala have an IDE?

Scala IDE provides advanced editing and debugging support for the development of pure Scala and mixed Scala-Java applications. Now with a shiny Scala debugger, semantic highlight, more reliable JUnit test finder, an ecosystem of related plugins, and much more.

How to create Scala Maven project in Eclipse?

Under “Help -> Install New Software”, enter “https://alchim31.free.fr/m2e-scala/update-site” and hit enter. You should see “Maven Integration for Eclipse -> Maven Integration for Scala IDE”. After it installs, go to “New -> Project -> Other” and select “Maven Project”.


Video Answer


2 Answers

I have used both Maven and sbt with Scala and found both of them pretty easy to use.

However, sbt feel much more closer to Scala as its build files are written in Scala itself (as opposed to XML in Maven) and sbt feature a build REPL, has continuous compilation and testing etc.

So I would advise you to use sbt for a simple Scala project.

But in case you want to create standard Java projects like WAR, EJB etc, I feel like Maven has a better support for them.

Also Maven has an enormous plugin ecosystem which enables you to do virtually everything, code coverage, reporting, code standard checking, documentation generation, and a lot more.

like image 124
Abhinav Sarkar Avatar answered Nov 02 '22 23:11

Abhinav Sarkar


I'd use SBT with IDEA. Though I haven't tried it, I know there's some support for integration of SBT and IDEA.

Anyway, SBT is a great basis for all Scala building&testing needs.

like image 26
Daniel C. Sobral Avatar answered Nov 02 '22 23:11

Daniel C. Sobral