mirror of https://github.com/sbt/sbt.git
Various improvements to sbt-setup. Finally discovered the impressively
well hidden "latest.integration" setting for ivy.
This commit is contained in:
parent
b9c3b02725
commit
b4eaaebf18
|
|
@ -6,8 +6,7 @@ PROJECT="$1"
|
||||||
DEFAULT_PACKAGE="template"
|
DEFAULT_PACKAGE="template"
|
||||||
PACKAGE=${ORGANIZATION:-$DEFAULT_PACKAGE}
|
PACKAGE=${ORGANIZATION:-$DEFAULT_PACKAGE}
|
||||||
SCALA_VERSION="2.8.1"
|
SCALA_VERSION="2.8.1"
|
||||||
SCALACHECK_VERSION="1.8"
|
SCALA_LOCAL_VERSION="2.9.0-local"
|
||||||
SPECS_VERSION="1.6.7"
|
|
||||||
SBT_VERSION="0.7.5.RC0"
|
SBT_VERSION="0.7.5.RC0"
|
||||||
|
|
||||||
if [ -z "$PROJECT" ]; then
|
if [ -z "$PROJECT" ]; then
|
||||||
|
|
@ -16,8 +15,9 @@ if [ -z "$PROJECT" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DIR=$(echo ${PROJECT} | tr '[A-Z]' '[a-z]')
|
DIR=$(echo ${PROJECT} | tr '[A-Z]' '[a-z]')
|
||||||
PROJECT_UC=$(echo ${PROJECT:0:1} | tr '[a-z]' '[A-Z]')${PROJECT:1}
|
PROJECT_UC=$(echo ${PROJECT:0:1} | tr '[a-z]' '[A-Z]')$(echo ${PROJECT:1} | sed -e 's/[^a-zA-Z_]//g;')
|
||||||
PROJECT_CLASS=$(echo $PROJECT_UC | sed -e 's/[^a-zA-Z_]//g;')Project
|
PROJECT_CLASS=${PROJECT_UC}Project
|
||||||
|
SPEC_CLASS=${PROJECT_UC}Spec
|
||||||
|
|
||||||
mkdir $DIR
|
mkdir $DIR
|
||||||
cd $DIR
|
cd $DIR
|
||||||
|
|
@ -37,20 +37,20 @@ cat > project/build/${PROJECT_CLASS}.scala <<EOF
|
||||||
import sbt._
|
import sbt._
|
||||||
|
|
||||||
class ${PROJECT_CLASS}(info: ProjectInfo) extends DefaultProject(info) {
|
class ${PROJECT_CLASS}(info: ProjectInfo) extends DefaultProject(info) {
|
||||||
val localMaven = "Local Maven" at "file://"+Path.userHome+"/.m2/repository"
|
val localMaven = "Local Maven" at "file://"+Path.userHome+"/.m2/repository"
|
||||||
val localIvy = "Local Ivy" at "file://"+Path.userHome+"/.ivy2/local"
|
val localIvy = "Local Ivy" at "file://"+Path.userHome+"/.ivy2/local"
|
||||||
val sonatype = "Sonatype" at "https://oss.sonatype.org/content/groups/public"
|
val sonatype = "Sonatype" at "https://oss.sonatype.org/content/groups/public"
|
||||||
|
|
||||||
// local use
|
// local use
|
||||||
override def localScala = System.getenv("scala.local") match {
|
override def localScala = System.getenv("scala.local") match {
|
||||||
case null => super.localScala
|
case null => super.localScala
|
||||||
case path =>
|
case path =>
|
||||||
log.info("Found scala.local: " + path)
|
log.info("Found scala.local: " + path)
|
||||||
List(defineScala("2.9.0-local", new java.io.File(path)))
|
List(defineScala("$SCALA_LOCAL_VERSION", new java.io.File(path)))
|
||||||
}
|
}
|
||||||
|
|
||||||
val scalacheck = "org.scala-tools.testing" %% "scalacheck" % "$SCALACHECK_VERSION" % "test" withSources()
|
val scalacheck = "org.scala-tools.testing" %% "scalacheck" % "latest.integration" % "test" withSources()
|
||||||
val specs = "org.scala-tools.testing" %% "specs" % "$SPECS_VERSION" % "test" withSources()
|
val specs = "org.scala-tools.testing" %% "specs" % "latest.integration" % "test" withSources()
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
@ -79,14 +79,14 @@ EOF
|
||||||
|
|
||||||
mkdir -p src/test/scala
|
mkdir -p src/test/scala
|
||||||
|
|
||||||
cat > src/test/scala/TemplateSpec.scala <<EOF
|
cat > src/test/scala/${SPEC_CLASS}.scala <<EOF
|
||||||
package $PACKAGE
|
package $PACKAGE
|
||||||
|
|
||||||
import org.specs._
|
import org.specs._
|
||||||
|
|
||||||
class TemplateSpec extends Specification {
|
class ${SPEC_CLASS} extends Specification {
|
||||||
"A template project" should {
|
"A skeletal specification" should {
|
||||||
"not violate universal realities" >> {
|
"do little beyond creating a skeleton" >> {
|
||||||
1 mustEqual 1
|
1 mustEqual 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue