mirror of https://github.com/sbt/sbt.git
parent
0c4df8c2d5
commit
a4ea6b3ce8
94
README.md
94
README.md
|
|
@ -2,76 +2,57 @@ sbt: the rebel cut
|
||||||
==================
|
==================
|
||||||
|
|
||||||
An alternative script for running [sbt](https://github.com/harrah/xsbt).
|
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
|
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
|
project directory, the runner will figure out the versions of sbt and
|
||||||
and scala required by the project and download them if necessary.
|
scala required by the project and download them if necessary.
|
||||||
|
|
||||||
There's also a template project sbt coming together, but it's unfinished.
|
Sample usage: create a new project using a snapshot version of sbt as
|
||||||
See below for how to pull the template project in as a plugin.
|
well as a snapshot version of scala, then run the sbt "about" command.
|
||||||
However the runner is quite useful already.
|
|
||||||
|
|
||||||
Here's a sample use of the runner: it creates a new project using a
|
% sbt -v -sbt-snapshot -210 -sbt-create about
|
||||||
snapshot version of sbt as well as a snapshot version of scala, then
|
Detected sbt version 0.11.3-SNAPSHOT
|
||||||
runs the sbt "about" command.
|
sbt snapshot is 0.11.3-20111207-052114
|
||||||
|
|
||||||
% sbt -d -sbt-snapshot -210 -sbt-create about
|
|
||||||
# Executing command line:
|
# Executing command line:
|
||||||
java
|
java
|
||||||
-Xss2m
|
|
||||||
-Xms256M
|
|
||||||
-Xmx1536M
|
|
||||||
-XX:MaxPermSize=256M
|
|
||||||
-XX:+CMSClassUnloadingEnabled
|
-XX:+CMSClassUnloadingEnabled
|
||||||
-XX:MaxPermSize=512m
|
-Xms1536m
|
||||||
-Xmx2g
|
-Xmx1536m
|
||||||
-Xss2m
|
-XX:MaxPermSize=384m
|
||||||
|
-XX:ReservedCodeCacheSize=192m
|
||||||
|
-Dfile.encoding=UTF8
|
||||||
-jar
|
-jar
|
||||||
/r/sbt-extras/.lib/0.11.0-20110825-052147/sbt-launch.jar
|
/r/sbt-extras/.lib/0.11.3-SNAPSHOT/sbt-launch.jar
|
||||||
"set logLevel in Global := Level.Debug"
|
"set resolvers in ThisBuild += ScalaToolsSnapshots"
|
||||||
"++ 2.10.0-SNAPSHOT"
|
"++ 2.10.0-SNAPSHOT"
|
||||||
"iflast shell"
|
|
||||||
about
|
about
|
||||||
|
|
||||||
Getting net.java.dev.jna jna 3.2.3 ...
|
[info] Loading global plugins from /Users/paulp/.sbt/plugins
|
||||||
:: retrieving :: org.scala-tools.sbt#boot-app
|
[info] Set current project to default-71999b (in build file:/Users/paulp/Desktop/new/)
|
||||||
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] Reapplying settings...
|
[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
|
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/)
|
[info] Set current project to default-71999b (in build file:/Users/paulp/Desktop/new/)
|
||||||
Getting Scala 2.10.0-SNAPSHOT ...
|
[info] This is sbt 0.11.3-20111207-052114
|
||||||
:: retrieving :: org.scala-tools.sbt#boot-scala
|
[info] The current project is {file:/Users/paulp/Desktop/new/}default-71999b
|
||||||
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] The current project is built against Scala 2.10.0-SNAPSHOT
|
[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] sbt, sbt plugins, and build definitions are using Scala 2.9.1
|
||||||
[info] All logging output for this session is available at /var/folders/1w/zm_1vksn3y7gn127bkwt841w0000gn/T/sbt8625229869994477318.log
|
|
||||||
|
|
||||||
|
|
||||||
Current -help output:
|
Current -help output:
|
||||||
|
|
||||||
Usage: sbt [options]
|
Usage: sbt [options]
|
||||||
|
|
||||||
-h | -help print this message
|
-h | -help print this message
|
||||||
-v | -verbose this runner is chattier
|
-v | -verbose this runner is chattier
|
||||||
-d | -debug set sbt log level to debug
|
-d | -debug set sbt log level to debug
|
||||||
-no-colors disable ANSI color codes
|
-no-colors disable ANSI color codes
|
||||||
-sbt-create start sbt even if current directory contains no sbt project
|
-sbt-create start sbt even if current directory contains no sbt project
|
||||||
-sbt-dir <path> path to global settings/plugins directory (default: ~/.sbt)
|
-sbt-dir <path> path to global settings/plugins directory (default: ~/.sbt)
|
||||||
-sbt-boot <path> path to shared boot directory (default: ~/.sbt/boot in 0.11 series)
|
-sbt-boot <path> path to shared boot directory (default: ~/.sbt/boot in 0.11 series)
|
||||||
-ivy <path> path to local Ivy repository (default: ~/.ivy2)
|
-ivy <path> path to local Ivy repository (default: ~/.ivy2)
|
||||||
|
-mem <integer> 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 <port> Turn on JVM debugging, open at the given port.
|
||||||
|
|
||||||
# sbt version (default: from project/build.properties if present, else latest release)
|
# sbt version (default: from project/build.properties if present, else latest release)
|
||||||
-sbt-version <version> use the specified version of sbt
|
-sbt-version <version> use the specified version of sbt
|
||||||
|
|
@ -80,18 +61,18 @@ Current -help output:
|
||||||
-sbt-snapshot use a snapshot version of sbt
|
-sbt-snapshot use a snapshot version of sbt
|
||||||
|
|
||||||
# scala version (default: latest release)
|
# scala version (default: latest release)
|
||||||
-28 use 2.8.1
|
-28 use 2.8.2
|
||||||
-29 use 2.9.1
|
-29 use 2.9.1
|
||||||
-210 use 2.10.0-SNAPSHOT
|
-210 use 2.10.0-SNAPSHOT
|
||||||
-scala-home <path> use the scala build at the specified directory
|
-scala-home <path> use the scala build at the specified directory
|
||||||
-scala-version <version> use the specified version of scala
|
-scala-version <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 <path> alternate JAVA_HOME
|
-java-home <path> alternate JAVA_HOME
|
||||||
|
|
||||||
# jvm options and output control
|
# jvm options and output control
|
||||||
JAVA_OPTS environment variable, if unset uses "-Dfile.encoding=UTF8"
|
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
|
.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
|
-Dkey=val pass -Dkey=val directly to the java runtime
|
||||||
-J-X pass option -X directly to the java runtime (-J is stripped)
|
-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
|
In the case of duplicated or conflicting options, the order above
|
||||||
shows precedence: JAVA_OPTS lowest, command line options highest.
|
shows precedence: JAVA_OPTS lowest, command line options highest.
|
||||||
|
|
||||||
|
|
||||||
## SBT Extra plugin
|
## SBT Extra plugin
|
||||||
|
|
||||||
To see the plugin in action, including the thrilling custom sbt command "help-names":
|
To see the plugin in action, including the thrilling custom sbt command "help-names":
|
||||||
|
|
|
||||||
8
sbt
8
sbt
|
|
@ -109,9 +109,12 @@ execRunner () {
|
||||||
echoerr () {
|
echoerr () {
|
||||||
echo 1>&2 "$@"
|
echo 1>&2 "$@"
|
||||||
}
|
}
|
||||||
dlog () {
|
vlog () {
|
||||||
[[ $verbose || $debug ]] && echoerr "$@"
|
[[ $verbose || $debug ]] && echoerr "$@"
|
||||||
}
|
}
|
||||||
|
dlog () {
|
||||||
|
[[ $debug ]] && echoerr "$@"
|
||||||
|
}
|
||||||
|
|
||||||
sbtjar_07_url () {
|
sbtjar_07_url () {
|
||||||
echo "http://simple-build-tool.googlecode.com/files/sbt-launch-${1}.jar"
|
echo "http://simple-build-tool.googlecode.com/files/sbt-launch-${1}.jar"
|
||||||
|
|
@ -260,8 +263,9 @@ addResidual () {
|
||||||
addResolver () {
|
addResolver () {
|
||||||
addSbt "set resolvers in ThisBuild += $1"
|
addSbt "set resolvers in ThisBuild += $1"
|
||||||
}
|
}
|
||||||
|
unset addedSnapshotRepo
|
||||||
addSnapshotRepo () {
|
addSnapshotRepo () {
|
||||||
addResolver "ScalaToolsSnapshots"
|
[[ -n "$addedSnapshotRepo" ]] || addResolver "ScalaToolsSnapshots" && addedSnapshotRepo=true
|
||||||
}
|
}
|
||||||
|
|
||||||
process_args ()
|
process_args ()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue