Coming right along.

This commit is contained in:
Paul Phillips 2011-08-14 09:05:01 -07:00
parent 6c679d457f
commit 7f6bd6b7a7
4 changed files with 38 additions and 36 deletions

View File

@ -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 <<EOF
#Project properties
#Generated by sbt-setup on $(date)
project.organization=$PACKAGE
project.name=$PROJECT
sbt.version=$SBT_VERSION
project.version=$PROJECT_VERSION
build.scala.versions=$SCALA_VERSION
project.initialize=false
EOF
mkdir -p project src/main/scala src/main/java src/test/scala src/test/java
createGitRepo
sbt update package test

View File

@ -13,18 +13,11 @@ camelCase () {
echo "$1" | $SED -e 's/[-_]\([a-z]\)/\u\1/g' | $SED -e 's/^./\u&/;'
}
githubUser () {
echo $(git config --global github.user)
}
githubToken () {
echo $(git config --global github.token)
}
createGithub () {
which hub && { echo "You need hub for this." ; return }
local project="$1"
# local git_token=$(git config --global github.token)
local git_url="git@github.com:$(git config --global github.user)/$project.git"
echo Creating $git_url

View File

@ -14,23 +14,46 @@ usage () {
cat <<EOM
Usage: $script_name [options]
--create creates a new project
--28 latest release of scala 2.8.x
--29 latest release of scala 2.9.x
--version <version> project initial version
-help prints this message
-create creates a new project
-version <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" \
"$@"

View File

@ -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,