diff --git a/bin/sbt-setup b/bin/sbt-setup index e9c82ffe5..a81094f8c 100755 --- a/bin/sbt-setup +++ b/bin/sbt-setup @@ -96,21 +96,7 @@ echo "Building against scala $SCALA_VERSION with sbt $SBT_VERSION." echo "Repository in ${PWD} ." echo -for dir in project/build project/plugins src/main/scala src/main/java src/test/scala src/test/java -do - mkdir -p $dir -done - -cat > project/build.properties < project initial version + -help prints this message + -create creates a new project + -version project initial version + -28 latest release of scala 2.8.x + -29 latest release of scala 2.9.x + -210 latest snapshot of scala 2.10 EOM } # no args -[[ $# -gt 0 ]] || { usage ; exit 1; } +[[ $# -gt 0 ]] || echo "Starting $script_name: invoke with -help for other options" -# run +# pull -J and -D options to give to java. +declare -a args +declare -a java_args +addJavaArg () { + java_args=("${java_args[@]}" "$1") +} + +while [ $# -gt 0 ]; do + case "$1" in + -help) usage; exit 1 ;; + -D*) addJavaArg "$1"; shift ;; + -J*) addJavaArg "${1:2}"; shift ;; + -28) addJavaArg "-Dsbt-create.scalaVersion=2.8.1"; shift ;; + -29) addJavaArg "-Dsbt-create.scalaVersion=2.9.1"; shift ;; + -210) addJavaArg "-Dsbt-create.scalaVersion=2.10.0-SNAPSHOT"; shift ;; + *) args=("${args[@]}" "$1") ; shift ;; + esac +done + +# reset "$@" to the residual args +set -- "${args[@]}" + +# run sbt java \ $JAVA_OPTS \ $jvm_opts_standard \ $jvm_opts_memory \ $SBT_OPTS \ + ${java_args[@]} \ -jar "$sbt_jar" \ "$@" - - diff --git a/project/Build.scala b/project/Build.scala index 5f0a92a11..4a18be5bb 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -17,7 +17,7 @@ object SbtCreateConfig { implicit def defaultProjectConfig = new SbtCreateConfig { def name = prop("sbt-create.name", "project-name-here") def organization = prop("sbt-create.organization", "your.organization.here") - def version = prop("sbt-create.version", "0.1") + def version = prop("sbt-create.version", "0.1-SNAPSHOT") def scalaVersion = prop("sbt-create.scalaVersion", "2.9.0-1") } } @@ -91,16 +91,16 @@ class TemplateBuild(implicit sbtCreateConfig: SbtCreateConfig) extends Build { lazy val buildSettings = Seq( resolvers += ScalaToolsSnapshots, - organization := "org.template", - version := "0.1-SNAPSHOT", - scalaVersion := "2.9.0-1", + organization := sbtCreateConfig.organization, + version := sbtCreateConfig.version, + scalaVersion := sbtCreateConfig.scalaVersion, retrieveManaged := true, shellPrompt := buildShellPrompt // logLevel := Level.Debug, ) lazy val templateConfig = Project( - id = "template", + id = sbtCreateConfig.name, base = file("."), aggregate = Nil, dependencies = Nil,