From 479f9e51412160818d2414108ff16ad1e22eb06b Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 14 Feb 2011 10:57:45 -0800 Subject: [PATCH] Added sbt-setup script. Now generates specs test template too. --- bin/sbt-setup | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100755 bin/sbt-setup diff --git a/bin/sbt-setup b/bin/sbt-setup new file mode 100755 index 000000000..9a8f5e577 --- /dev/null +++ b/bin/sbt-setup @@ -0,0 +1,100 @@ +#!/bin/bash +# + +PROJECT="$1" + +ORGANIZATION="improving" +SCALA_VERSION="2.8.1" +SCALACHECK_VERSION="1.8" +SPECS_VERSION="1.6.7" +SBT_VERSION="0.7.5.RC0" + +if [ -z "$PROJECT" ]; then + echo "Usage: $0 " + exit 1 +fi + +DIR=$(echo ${PROJECT} | tr '[A-Z]' '[a-z]') +PROJECT_CLASS=$(echo $PROJECT | sed -e 's/[^a-zA-Z_]//g;')Project + +mkdir $DIR +cd $DIR +echo "Creating sbt project ${PROJECT} in ${PWD}" +echo "" + +cat > .gitignore < project/build/${PROJECT_CLASS}.scala < super.localScala + case path => + log.info("Found scala.local: " + path) + List(defineScala("2.9.0-local", new java.io.File(path))) + } + + val scalacheck = "org.scala-tools.testing" %% "scalacheck" % "$SCALACHECK_VERSION" % "test" withSources() + val specs = "org.scala-tools.testing" %% "specs" % "$SPECS_VERSION" % "test" withSources() +} +EOF + +cat > project/build.properties < src/main/scala/Main.scala < src/test/scala/TemplateSpec.scala <> { + 1 mustEqual 1 + } + } +} +EOF + +git init +git add . +git commit -m "Initial Import for ${PROJECT} (autogenerated by sbt-setup)." +sbt update + +echo "" +echo "Ready to roll in $PWD" \ No newline at end of file