From a4ea6b3ce82c99bf6a9c55799f8e20e43a2d6087 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 7 Dec 2011 13:15:31 -0800 Subject: [PATCH] Fighting bitrot. Updated readme, small polishings. --- README.md | 94 ++++++++++++++++++++++--------------------------------- sbt | 8 +++-- 2 files changed, 43 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index 517ad5dca..6646dfc6a 100644 --- a/README.md +++ b/README.md @@ -2,76 +2,57 @@ sbt: the rebel cut ================== An alternative script for running [sbt](https://github.com/harrah/xsbt). -It works with sbt 0.7x projects as well as 0.10+. If you're in an sbt -project directory, the runner will figure out the versions of sbt -and scala required by the project and download them if necessary. +It works with sbt 0.7.x projects as well as 0.10+. If you're in an sbt +project directory, the runner will figure out the versions of sbt and +scala required by the project and download them if necessary. -There's also a template project sbt coming together, but it's unfinished. -See below for how to pull the template project in as a plugin. -However the runner is quite useful already. +Sample usage: create a new project using a snapshot version of sbt as +well as a snapshot version of scala, then run the sbt "about" command. -Here's a sample use of the runner: it creates a new project using a -snapshot version of sbt as well as a snapshot version of scala, then -runs the sbt "about" command. - - % sbt -d -sbt-snapshot -210 -sbt-create about + % sbt -v -sbt-snapshot -210 -sbt-create about + Detected sbt version 0.11.3-SNAPSHOT + sbt snapshot is 0.11.3-20111207-052114 # Executing command line: java - -Xss2m - -Xms256M - -Xmx1536M - -XX:MaxPermSize=256M -XX:+CMSClassUnloadingEnabled - -XX:MaxPermSize=512m - -Xmx2g - -Xss2m + -Xms1536m + -Xmx1536m + -XX:MaxPermSize=384m + -XX:ReservedCodeCacheSize=192m + -Dfile.encoding=UTF8 -jar - /r/sbt-extras/.lib/0.11.0-20110825-052147/sbt-launch.jar - "set logLevel in Global := Level.Debug" + /r/sbt-extras/.lib/0.11.3-SNAPSHOT/sbt-launch.jar + "set resolvers in ThisBuild += ScalaToolsSnapshots" "++ 2.10.0-SNAPSHOT" - "iflast shell" about - Getting net.java.dev.jna jna 3.2.3 ... - :: retrieving :: org.scala-tools.sbt#boot-app - confs: [default] - 1 artifacts copied, 0 already retrieved (838kB/12ms) - Getting Scala 2.9.1.RC4 (for sbt)... - :: retrieving :: org.scala-tools.sbt#boot-scala - confs: [default] - 4 artifacts copied, 0 already retrieved (19939kB/32ms) - Getting org.scala-tools.sbt sbt_2.9.1.RC4 0.11.0-20110825-052147 ... - :: retrieving :: org.scala-tools.sbt#boot-app - confs: [default] - 38 artifacts copied, 0 already retrieved (6948kB/45ms) - [info] Set current project to default-30ae78 (in build file:/private/var/folders/1w/zm_1vksn3y7gn127bkwt841w0000gn/T/abc.h9FdreF1/) + [info] Loading global plugins from /Users/paulp/.sbt/plugins + [info] Set current project to default-71999b (in build file:/Users/paulp/Desktop/new/) [info] Reapplying settings... - [info] Set current project to default-30ae78 (in build file:/private/var/folders/1w/zm_1vksn3y7gn127bkwt841w0000gn/T/abc.h9FdreF1/) + [info] Set current project to default-71999b (in build file:/Users/paulp/Desktop/new/) Setting version to 2.10.0-SNAPSHOT - [info] Set current project to default-30ae78 (in build file:/private/var/folders/1w/zm_1vksn3y7gn127bkwt841w0000gn/T/abc.h9FdreF1/) - Getting Scala 2.10.0-SNAPSHOT ... - :: retrieving :: org.scala-tools.sbt#boot-scala - confs: [default] - 4 artifacts copied, 0 already retrieved (20650kB/58ms) - [info] This is sbt 0.11.0-20110825-052147 - [info] The current project is {file:/private/var/folders/1w/zm_1vksn3y7gn127bkwt841w0000gn/T/abc.h9FdreF1/}default-30ae78 + [info] Set current project to default-71999b (in build file:/Users/paulp/Desktop/new/) + [info] This is sbt 0.11.3-20111207-052114 + [info] The current project is {file:/Users/paulp/Desktop/new/}default-71999b [info] The current project is built against Scala 2.10.0-SNAPSHOT - [info] sbt, sbt plugins, and build definitions are using Scala 2.9.1.RC4 - [info] All logging output for this session is available at /var/folders/1w/zm_1vksn3y7gn127bkwt841w0000gn/T/sbt8625229869994477318.log - + [info] sbt, sbt plugins, and build definitions are using Scala 2.9.1 Current -help output: Usage: sbt [options] - -h | -help print this message - -v | -verbose this runner is chattier - -d | -debug set sbt log level to debug - -no-colors disable ANSI color codes - -sbt-create start sbt even if current directory contains no sbt project - -sbt-dir path to global settings/plugins directory (default: ~/.sbt) - -sbt-boot path to shared boot directory (default: ~/.sbt/boot in 0.11 series) - -ivy path to local Ivy repository (default: ~/.ivy2) + -h | -help print this message + -v | -verbose this runner is chattier + -d | -debug set sbt log level to debug + -no-colors disable ANSI color codes + -sbt-create start sbt even if current directory contains no sbt project + -sbt-dir path to global settings/plugins directory (default: ~/.sbt) + -sbt-boot path to shared boot directory (default: ~/.sbt/boot in 0.11 series) + -ivy path to local Ivy repository (default: ~/.ivy2) + -mem set memory options (default: 1536, which is -Xms1536m -Xmx1536m -XX:MaxPermSize=384m -XX:ReservedCodeCacheSize=192m) + -no-share use all local caches; no sharing + -offline put sbt in offline mode + -jvm-debug Turn on JVM debugging, open at the given port. # sbt version (default: from project/build.properties if present, else latest release) -sbt-version use the specified version of sbt @@ -80,18 +61,18 @@ Current -help output: -sbt-snapshot use a snapshot version of sbt # scala version (default: latest release) - -28 use 2.8.1 + -28 use 2.8.2 -29 use 2.9.1 -210 use 2.10.0-SNAPSHOT -scala-home use the scala build at the specified directory -scala-version use the specified version of scala - # java version (default: java from PATH, currently java version "1.6.0_26") + # java version (default: java from PATH, currently java version "1.6.0_29") -java-home alternate JAVA_HOME # jvm options and output control JAVA_OPTS environment variable, if unset uses "-Dfile.encoding=UTF8" - SBT_OPTS environment variable, if unset uses "-XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=512m -Xms1536m -Xmx1536m -Xss2m" + SBT_OPTS environment variable, if unset uses "-XX:+CMSClassUnloadingEnabled" .sbtopts if this file exists in the sbt root, it is prepended to the runner args -Dkey=val pass -Dkey=val directly to the java runtime -J-X pass option -X directly to the java runtime (-J is stripped) @@ -99,7 +80,6 @@ Current -help output: In the case of duplicated or conflicting options, the order above shows precedence: JAVA_OPTS lowest, command line options highest. - ## SBT Extra plugin To see the plugin in action, including the thrilling custom sbt command "help-names": diff --git a/sbt b/sbt index 8cf9956a8..9bea1e4a1 100755 --- a/sbt +++ b/sbt @@ -109,9 +109,12 @@ execRunner () { echoerr () { echo 1>&2 "$@" } -dlog () { +vlog () { [[ $verbose || $debug ]] && echoerr "$@" } +dlog () { + [[ $debug ]] && echoerr "$@" +} sbtjar_07_url () { echo "http://simple-build-tool.googlecode.com/files/sbt-launch-${1}.jar" @@ -260,8 +263,9 @@ addResidual () { addResolver () { addSbt "set resolvers in ThisBuild += $1" } +unset addedSnapshotRepo addSnapshotRepo () { - addResolver "ScalaToolsSnapshots" + [[ -n "$addedSnapshotRepo" ]] || addResolver "ScalaToolsSnapshots" && addedSnapshotRepo=true } process_args ()