Skip to content

MayankBairagi/scala-sbt-template

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a simple lightweight template for starting a scala project with sbt.

It comes with:

  • sbt-eclipse plugin
  • scala-test and specs templates

To get started:

  1. To download and launch sbt:

     git clone git://github.com/dph01/scala-sbt-template.git
     cd scala-sbt-template
     ./sbt 
    
  2. To load your project into Eclipse:

     sbt> eclipse
    

    Then from within Eclipse, select File->Import->General->Existing Projects Into Workspace, and select your project directory.

  3. Write your code in src/main/scala. To run your program, specify the name of your main class in build.sbt, e.g.:

     mainClass := Some("com.damianhelme.App")
    

    In sbt:

     sbt> reload
     sbt> run        
    

    You'll probably also want to change the 'name' and 'organisation' sbt configuration settings in build.sbt.

    Note the reload only needs to be done once whenever you change the build.sbt file

  4. Write your tests in src/test/scala (some examples have been included). To run all your tests:

     sbt> test
    
  5. To run just one test:

     sbt> test-only com.damianhelme.AppTest
    

For comments, questions, etc. please see the accompanying blogpost.

About

A template for starting a scala project with sbt

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published