Skip to content

Instantly share code, notes, and snippets.

@vbasem
Forked from maciej/init-scala.sh
Last active December 20, 2015 14:59
Show Gist options
  • Save vbasem/6151120 to your computer and use it in GitHub Desktop.
Save vbasem/6151120 to your computer and use it in GitHub Desktop.
Bootstrap scala project with SBT and generate IDEA project files. Requires pre-configured SBT-IDEA plugin available here : https://github.com/mpeltonen/sbt-idea
#!/bin/bash
PROJECT_NAME="$1"
SCALA_VERSION="2.10.2"
SCALATEST_VERSION="1.9.1"
SCALAMOCK_VERSION="3.0.1"
mkdir $PROJECT_NAME
cd $PROJECT_NAME
cat > build.sbt << EOF
name := "$PROJECT_NAME"
version := "1.0"
scalaVersion := "$SCALA_VERSION"
libraryDependencies += "org.scalatest" %% "scalatest" % "$SCALATEST_VERSION" % "test"
libraryDependencies += "org.scalamock" %% "scalamock-scalatest-support" % "$SCALAMOCK_VERSION" % "test"
mkdir -p "src/main/scala"
mkdir -p "src/main/resources"
mkdir -p "src/test/scala"
mkdir -p "src/test/resources"
cat > .gitignore << EOF
target/
.DS_Store
.idea
.idea_modules
EOF
git init
git add .gitignore
git add build.sbt
git commit -m 'Initial commit'
# You need to have the idea plugin in the global SBT's plugins/build.sbt
sbt update gen-idea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment