Skip to content

Scala 101. Let's help people start a Scala project with good habbits.

Notifications You must be signed in to change notification settings

jendap/scala-boot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scala Playground

What

This is sample Scala project to hwlp people fet started with Scala. Try out Scala.

This project does not focus on actual Scala. At least not quite yet. It's about development tooling best practicies. It's about IDE and build system. Those aspects are done well here. So you can focus your first efforts on Scala itsef and not fight some monster tool or write a script to compile nor google where to download things.

There are things which are unnecessary complicated - mainly the pom.xml file. It can be just a little fraction of what it is. But we encourage the best habits from the very beginning and so it's done well rather than short.

Who

Target audience for this are people new to Scala.

How

Dependencies. Download and install:

Clone the repository.

git clone https://github.com/jendap/scala-boot.git

Test.

mvn test

Package.

mvn package

Run.

java -jar target/scala-boot-*-jar-with-dependencies.jar

Why

Project - Born to help me show off Scala and get people started with it.

Tests - Nothing works without test. Code is never done without tests. It's hard to innovate or just maintain the code without tests. Tests are a must!

Maven vs Sbt - Maven just works, has great documentation, great conventions and has great support in a lot of tools. Plus you can use it for java, clojure, etc. Sbt build is also present because for good or bad it is a de facto standard build tool in Scala ecosystem.

Scala Worksheets - Nice thing! But at least in Eclipse they tend to change the worksheet file, which is bad for source code versioning. Plus once you understand what a test is there's not much use for worksheets. I.e. worksheets are, imho, good for a first Scala lesson, bad for fifth.

IDE

I would recommend using one of the leading java IDEs - Eclipse, Idea or Netbeans. In that order. Idea has some parts of Scala support better but worse than Eclipse. Netbeans has probably least advanced Scala support of them all.

Manual install - just install Eclipse or Idea manually and their respective Scala plugins.

These are two scripts included for Eclipse. The first one can install Eclipse with Scala plugin.

./support/install-eclipse.sh

The script takes optional argument with a directory where the Eclipse should be installed. The default directory is $HOME/eclipse.scala.

Note: The script was tested only on Ubuntu 13.04. It may work on Debian and Fedora based distributions as well. It may (untested) work even on Mac OS X.

The second script can run the newly installed Eclipse.

./support/run-eclipse.sh

Start using Eclipse and import your first maven project into Eclipse:

  1. There will be two dialog windows from Scala plugin. Just click OK.
  2. Close the welcome screen.
  3. Go to menu: File -> Import... -> Maven -> Existing Maven Projects
  4. Select directory where you've cloned this project.
  5. Look around! There are some Scala files! Open them! Go to menu: Run -> Run as -> ...
  6. Enjoy!

Tip: You can import from git directly - explore Git instead of Maven in the Import... dialog.

Maven 101

  • mvn clean - cleanup all the stuff created by the build process
  • mvn compile - just compile
  • mvn test - run tests
  • mvn package - create jar files for deployment
  • mvn verify - run integration tests
  • mvn install - install into your $HOME/.m2 directory

Tip: Try mvn -q test if you don't like all the logging messages maven prints by default.

About

Scala 101. Let's help people start a Scala project with good habbits.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages