Giter Club home page Giter Club logo

scala_starter's Introduction

#Scala Starter Project using SBT and ScalaTest For me, one of the hardest parts about learning a new language is figuring out how to get the correct environment setup where I can run tests. This is just a simple Scala project using SBT and ScalaTest.

I found this blog post useful for getting setup: Quick Sbt Tutorial

This project is configured to use:

  • Scala 2.10.0
  • ScalaTest 2.0.M5b (current ScalaTest 2.0 beta version)

Quick Setup

  1. Install SBT
  2. Clone this project
  3. Run sbt (This will also download all dependencies)
  4. In the sbt console you can:
  • run - runs the greeter.Hello application
  • test - runs the GreetingsSpec tests
  • console - run the REPL with your project environment loaded
  • compile - compiles. :)
  • clean - cleans the generated file from compiling

IntelliJ Users

I use IntelliJ and I use sbt-idea to generate the Intellij project files. When you have it setup as described in their readme you can run gen-idea in your sbt console to generate the .idea project folders.

Example Console Use

When you run the console in sbt your projects environment is available. For example, you can create an instance of Greetings and access its methods:

> console
[info] Starting scala interpreter...
[info]
Welcome to Scala version 2.10.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_37).
Type in expressions to have them evaluated.
Type :help for more information.

scala> val g = new greeter.Greetings
g: greeter.Greetings = greeter.Greetings@304d03e5

scala> g.greeting
res0: String = It works!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.