Skip to content

Instantly share code, notes, and snippets.

@fabiofumarola
Created January 10, 2014 09:51
Show Gist options
  • Save fabiofumarola/8349290 to your computer and use it in GitHub Desktop.
Save fabiofumarola/8349290 to your computer and use it in GitHub Desktop.
create scala sbt project
#!/bin/bash
prj=$1
rm -rf $prj
mkdir $prj
cd $prj
mkdir -p src/main/java
mkdir -p src/main/scala
mkdir -p src/main/resources
mkdir -p src/test/java
mkdir -p src/test/scala
mkdir -p src/test/resources
#create the build.sbt file
#echo "name := \"$prj\"" >> build.sbt
#echo "version := \"1.0\"" >> build.sbt
#echo "scalaVersion := \"2.10.3\"" >> build.sbt
cat > build.sbt << EOF
name := "$prj"
version := "1.0"
scalaVersion := "2.10.3"
EOF
cat > assembly.sbt << EOF
import AssemblyKeys._ // put this at the top of the file
assemblySettings
EOF
myDir="project"
mkdir $myDir
cd $myDir
cat > plugins.sbt << EOF
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.4.0")
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.2")
//https://github.com/sbt/sbt-assembly
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.10.1")
EOF
cd ../
package="com.$prj"
cd src/main/scala
mkdir com
cd com
mkdir $prj
cd $prj
cat > Main.scala << EOF
package $package
object Main extends App{
println("Hello World")
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment