Skip to content

Instantly share code, notes, and snippets.

@ToQoz
Last active March 21, 2017 05:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ToQoz/0dcd33e7a53fd4948081d345275636e7 to your computer and use it in GitHub Desktop.
Save ToQoz/0dcd33e7a53fd4948081d345275636e7 to your computer and use it in GitHub Desktop.
すぐ play
#!/bin/bash
# ./play-bootstrap.sh -a app_name -s 2.11.7 -p 2.5.9
usage_exit() {
echo "Usage: $0 [-a application name] [-s scala version] [-p play version]" 1>&2
exit 1
}
while getopts p:a:s:b:h OPT
do
case $OPT in
j) PROJECT_NAME=$OPTARG
;;
a) APPLICATION_NAME=$OPTARG
;;
s) SCALA_VERSION=$OPTARG
;;
p) PLAY_VERSION=$OPTARG
;;
h) usage_exit
;;
\?) usage_exit
;;
esac
done
SBT_VERSION=$(sbt sbtVersion | grep -o -e '[0-9][0-9]*\.[0-9][0-9]*.[0-9][0-9]*')
mkdir $APPLICATION_NAME && cd $APPLICATION_NAME
# ./build.sbt
echo 'name := "'$APPLICATION_NAME'"
version := "1.0"
scalaVersion := "'$SCALA_VERSION'"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
' > build.sbt
mkdir project
# ./project/build.properties
echo 'sbt.version='$SBT_VERSION'
' > project/build.properties
# ./project/plugins.sbt
echo 'resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/maven-releases/"
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "'$PLAY_VERSION'")
' > project/plugins.sbt
sbt run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment