Skip to content

Instantly share code, notes, and snippets.

@timvw
Last active August 29, 2015 14:23
Show Gist options
  • Select an option

  • Save timvw/385cce40cfaac7bbe54a to your computer and use it in GitHub Desktop.

Select an option

Save timvw/385cce40cfaac7bbe54a to your computer and use it in GitHub Desktop.
Create an sbt project for scala and spark
#!/bin/bash
# usage: emptyspark.sh blah
# Result: project is created at /Users/timvw/src/blah
# Inspired by: https://gist.github.com/alvinj/3194379
project=$1
basedir="/Users/timvw/src"
targetdir="$basedir/$1"
scalaversion="2.11.6"
sparkversion="1.4.0"
mkdir -p $targetdir/src/{main,test}/{java,resources,scala}
mkdir $targetdir/lib
mkdir $targetdir/project
mkdir $targetdir/target
echo "name := \"$project\"
version := \"1.0\"
scalaVersion := \"$scalaversion\"
libraryDependencies += \"org.apache.spark\" %% \"spark-core\" % \"$sparkversion\"
" > $targetdir/build.sbt
echo "bin/
project/
target/
.cache
.classpath
.project
.settings" > $targetdir/.gitignore
touch $targetdir/README.md
echo ""
echo "Project created at $targetdir"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment