Last active
          March 21, 2017 05:08 
        
      - 
      
 - 
        
Save ToQoz/0dcd33e7a53fd4948081d345275636e7 to your computer and use it in GitHub Desktop.  
    すぐ play
  
        
  
    
      This file contains hidden or 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 | |
| # ./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