Created
February 15, 2017 03:53
-
-
Save rbonvall/dcdacda3d84e2c8e799f82e03c1893f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
die () { | |
echo "$1" | |
exit 1 | |
} | |
get-scala-version () { | |
curl http://www.scala-lang.org/ 2> /dev/null | grep scala-version | perl -pe 's/\D*([0-9.]+)\D*/$1/' | |
} | |
PROJ="$1" | |
BASEPKG="cl._8o.rb.$PROJ" | |
[ "$PROJ" != "" ] || die "Usage: $0 PROJECTNAME" | |
SCALAVERSION=$() | |
mkdir "$PROJ" | |
cat > "$PROJ"/build.sbt <<EOF | |
scalaVersion := "$(get-scala-version)" | |
libraryDependencies ++= Seq( | |
"org.scalatest" % "scalatest_2.11" % "2.2.6" % "test" | |
) | |
EOF | |
cat > "$PROJ"/.gitignore <<EOF | |
target/ | |
lib_managed/ | |
src_managed/ | |
project/boot/ | |
.history | |
.cache | |
*~ | |
.idea | |
EOF | |
mkdir -p "$PROJ"/src/main/scala/"${BASEPKG//.//}" | |
mkdir -p "$PROJ"/src/test/scala/"${BASEPKG//.//}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
die () { | |
echo "$1" | |
exit 1 | |
} | |
get-scala-version () { | |
curl http://www.scala-lang.org/ 2> /dev/null | grep scala-version | perl -pe 's/\D*([0-9.]+)\D*/$1/' | |
} | |
PROJ="$1" | |
BASEPKG="cl._8o.rb.$PROJ" | |
[ "$PROJ" != "" ] || die "Usage: $0 PROJECTNAME" | |
SCALAVERSION=$() | |
mkdir "$PROJ" | |
cat > "$PROJ"/build.sbt <<EOF | |
scalaVersion := "$(get-scala-version)" | |
libraryDependencies ++= Seq( | |
"org.scalatest" % "scalatest_2.11" % "2.2.6" % "test" | |
) | |
EOF | |
cat > "$PROJ"/.gitignore <<EOF | |
target/ | |
lib_managed/ | |
src_managed/ | |
project/boot/ | |
.history | |
.cache | |
*~ | |
.idea | |
EOF | |
mkdir -p "$PROJ"/src/main/scala/"${BASEPKG//.//}" | |
mkdir -p "$PROJ"/src/test/scala/"${BASEPKG//.//}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment