Skip to content

Instantly share code, notes, and snippets.

@alextanhongpin
Last active August 20, 2017 16:41
Show Gist options
  • Save alextanhongpin/cd1404f8c13f0136b015c1d561d82aea to your computer and use it in GitHub Desktop.
Save alextanhongpin/cd1404f8c13f0136b015c1d561d82aea to your computer and use it in GitHub Desktop.
Shell script to setup Scala project

Getting started

How to create a sbt project.

  1. Prepare the setup.sh file
  2. Make an executable out of it: chmod +ux setup.sh
  3. Run the setup ./setup.sh

To run the web server

$ sbt run

object HelloWorld {
def main(args: Array[String]): Unit = {
println("Hello, world!")
}
}
#!/bin/sh
mkdir -p src/{main,test}/{java,resources,scala}
mkdir lib project target
# create an initial build.sbt file
echo 'name := "MyProject"
version := "1.0"
scalaVersion := "2.10.0"' > build.sbt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment