mirror of https://github.com/sbt/sbt.git
Merge branch '0.13' into bug-fix
This commit is contained in:
commit
b75b7f3bbb
|
|
@ -182,11 +182,8 @@ object State {
|
||||||
log.debug(s"> $cmd")
|
log.debug(s"> $cmd")
|
||||||
f(cmd, s.copy(remainingCommands = remainingCommands, history = cmd :: s.history))
|
f(cmd, s.copy(remainingCommands = remainingCommands, history = cmd :: s.history))
|
||||||
}
|
}
|
||||||
def isInteractive = System.console != null
|
|
||||||
def hasInput = Option(System.console) exists (_.reader.ready())
|
|
||||||
def hasShellCmd = s.definedCommands exists { case c: SimpleCommand => c.name == Shell; case _ => false }
|
|
||||||
s.remainingCommands match {
|
s.remainingCommands match {
|
||||||
case Seq() => if (isInteractive && hasInput && hasShellCmd) runCmd(Shell, Nil) else exit(true)
|
case Seq() => exit(true)
|
||||||
case Seq(x, xs @ _*) => runCmd(x, xs)
|
case Seq(x, xs @ _*) => runCmd(x, xs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -570,14 +570,12 @@ object BuiltinCommands {
|
||||||
private def writeSbtVersion: Command =
|
private def writeSbtVersion: Command =
|
||||||
Command.command(WriteSbtVersion) { state => writeSbtVersion(state); state }
|
Command.command(WriteSbtVersion) { state => writeSbtVersion(state); state }
|
||||||
|
|
||||||
private def isInteractive = System.console() != null
|
|
||||||
|
|
||||||
private def intendsToInvokeCompile(state: State) = state.remainingCommands contains Keys.compile.key.label
|
private def intendsToInvokeCompile(state: State) = state.remainingCommands contains Keys.compile.key.label
|
||||||
|
|
||||||
private def notifyUsersAboutShell(state: State): Unit = {
|
private def notifyUsersAboutShell(state: State): Unit = {
|
||||||
val suppress = Project extract state getOpt Keys.suppressSbtShellNotification getOrElse false
|
val suppress = Project extract state getOpt Keys.suppressSbtShellNotification getOrElse false
|
||||||
if (!suppress && isInteractive && intendsToInvokeCompile(state))
|
if (!suppress && intendsToInvokeCompile(state))
|
||||||
state.log info "Executing in batch mode. For better performance use sbt's shell; hit [ENTER] to do so now"
|
state.log info "Executing in batch mode. For better performance use sbt's shell"
|
||||||
}
|
}
|
||||||
|
|
||||||
private def NotifyUsersAboutShell = "notify-users-about-shell"
|
private def NotifyUsersAboutShell = "notify-users-about-shell"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
### Fixes with compatibility implications
|
||||||
|
|
||||||
|
- Removes the "hit \[ENTER\] to switch to interactive mode" feature. See below.
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
- Improves the new startup messages. See below.
|
||||||
|
- Ports sbt-cross-building's `^` and `^^` commands for plugin cross building. See below.
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
- Fixes the new startup messages. See below.
|
||||||
|
|
||||||
|
### Improvements and bug fixes to the new startup messages
|
||||||
|
|
||||||
|
The two new startup messages introduced in sbt 0.13.15 are:
|
||||||
|
|
||||||
|
- when writing out `sbt.version`, for build reproducability, and
|
||||||
|
- when informing the user about sbt's shell, for the performance improvement
|
||||||
|
|
||||||
|
When writing out `sbt.version` the messaging now:
|
||||||
|
|
||||||
|
- correctly uses a logger rather than println
|
||||||
|
- honours the log level set, for instance by `--error`
|
||||||
|
- never executes when sbt "new" is being run
|
||||||
|
|
||||||
|
When informing the user about sbt's shell the messaging now:
|
||||||
|
|
||||||
|
- is a 1 line message, rather than 3
|
||||||
|
- is at info level, rather than warn level
|
||||||
|
- can be suppressed with `suppressSbtShellNotification := true`
|
||||||
|
- only triggers when `compile` is being run
|
||||||
|
- never shows when sbt `new` is being run
|
||||||
|
|
||||||
|
[#3091][3091]/[#3097][3097]/[#3147][3147] by [@dwijnand][@dwijnand]
|
||||||
|
|
||||||
|
### Remove the "hit \[ENTER\] to switch to interactive mode" feature
|
||||||
|
|
||||||
|
In sbt 0.13.15, in addition to notifying the user about the existence of sbt's shell, a feature was added to
|
||||||
|
allow the user to switch to sbt's shell - a more pro-active approach to just displaying a message.
|
||||||
|
|
||||||
|
Unfortunately sbt is often unintentionally invoked in shell scripts in "interactive mode" when no interaction is
|
||||||
|
expected by, for exmaple, invoking `sbt package` instead of `sbt package < /dev/null`. In that case hitting
|
||||||
|
\[ENTER\] would silently trigger sbt to run its shell, easily wrecking the script. In addition to that I was
|
||||||
|
unhappy with the implementation as it created a tight coupling between sbt's command processing abstraction to
|
||||||
|
sbt's shell command.
|
||||||
|
|
||||||
|
If you want to stay in sbt's shell after running a task like `package` then invoke sbt like so:
|
||||||
|
|
||||||
|
sbt package shell
|
||||||
|
|
||||||
|
[#3091][3091]/[#3153][3153] by [@dwijnand][@dwijnand]
|
||||||
|
|
||||||
|
### sbt-cross-building
|
||||||
|
|
||||||
|
[@jrudolph][@jrudolph]'s sbt-cross-building is a plugin author's plugin.
|
||||||
|
It adds cross command `^` and sbtVersion switch command `^^`, similar to `+` and `++`,
|
||||||
|
but for switching between multiple sbt versions across major versions.
|
||||||
|
sbt 0.13.16 merges these commands into sbt because the feature it provides is useful as we migrate plugins to sbt 1.0.
|
||||||
|
|
||||||
|
To switch the `sbtVersion in pluginCrossBuild` from the shell use:
|
||||||
|
|
||||||
|
```
|
||||||
|
^^ 1.0.0-M5
|
||||||
|
```
|
||||||
|
|
||||||
|
Your plugin will now build with sbt 1.0.0-M5 (and its Scala version 2.12.2).
|
||||||
|
|
||||||
|
If you need to make changes specific to a sbt version, you can now include them into `src/main/scala-sbt-0.13`,
|
||||||
|
and `src/main/scala-sbt-1.0.0-M5`, where the binary sbt version number is used as postfix.
|
||||||
|
|
||||||
|
To run a command across multiple sbt versions, set:
|
||||||
|
|
||||||
|
```scala
|
||||||
|
crossSbtVersions := Vector("0.13.15", "1.0.0-M5")
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, run:
|
||||||
|
|
||||||
|
```
|
||||||
|
^ compile
|
||||||
|
```
|
||||||
|
|
||||||
|
[#3133][3133] by [@eed3si9n][@eed3si9n]
|
||||||
|
|
||||||
|
[3091]: https://github.com/sbt/sbt/issues/3091
|
||||||
|
[3097]: https://github.com/sbt/sbt/issues/3097
|
||||||
|
[3147]: https://github.com/sbt/sbt/pull/3147
|
||||||
|
[3133]: https://github.com/sbt/sbt/pull/3133
|
||||||
|
[3153]: https://github.com/sbt/sbt/pull/3153
|
||||||
|
[@jrudolph]: https://github.com/jrudolph
|
||||||
|
[@eed3si9n]: https://github.com/eed3si9n
|
||||||
|
[@dwijnand]: https://github.com/dwijnand
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
|
||||||
|
### Fixes with compatibility implications
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
### Improvements
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
### Bug fixes
|
||||||
|
|
||||||
|
- Fixes merged dependency descriptors dropping configuration specification. [#1234][1234]/[#1000][1000] by [@eed3si9n][@eed3si9n]
|
||||||
|
|
||||||
|
[1234]: https://github.com/sbt/sbt/pull/1234
|
||||||
|
[1000]: https://github.com/sbt/sbt/issues/1000
|
||||||
|
[@eed3si9n]: https://github.com/eed3si9n
|
||||||
|
[@dwijnand]: http://github.com/dwijnand
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
|
|
||||||
### Improvements
|
|
||||||
|
|
||||||
- Ports sbt-cross-building's `^` and `^^` commands for plugin cross building. See below.
|
|
||||||
|
|
||||||
### sbt-cross-building
|
|
||||||
|
|
||||||
[@jrudolph][@jrudolph]'s sbt-cross-building is a plugin author's plugin.
|
|
||||||
It adds cross command `^` and sbtVersion switch command `^^`, similar to `+` and `++`,
|
|
||||||
but for switching between multiple sbt versions across major versions.
|
|
||||||
sbt 0.13.16 merges these commands into sbt because the feature it provides is useful as we migrate plugins to sbt 1.0.
|
|
||||||
|
|
||||||
To switch the `sbtVersion in pluginCrossBuild` from the shell use:
|
|
||||||
|
|
||||||
```
|
|
||||||
^^ 1.0.0-M5
|
|
||||||
```
|
|
||||||
|
|
||||||
Your plugin will now build with sbt 1.0.0-M5 (and its Scala version 2.12.2).
|
|
||||||
|
|
||||||
If you need to make changes specific to a sbt version, you can now include them into `src/main/scala-sbt-0.13`,
|
|
||||||
and `src/main/scala-sbt-1.0.0-M5`, where the binary sbt version number is used as postfix.
|
|
||||||
|
|
||||||
To run a command across multiple sbt versions, set:
|
|
||||||
|
|
||||||
```scala
|
|
||||||
crossSbtVersions := Vector("0.13.15", "1.0.0-M5")
|
|
||||||
```
|
|
||||||
|
|
||||||
Then, run:
|
|
||||||
|
|
||||||
```
|
|
||||||
^ compile
|
|
||||||
```
|
|
||||||
|
|
||||||
[@jrudolph]: https://github.com/jrudolph
|
|
||||||
[@eed3si9n]: https://github.com/eed3si9n
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
### Improvements
|
|
||||||
|
|
||||||
- Improves the new startup messages. See below.
|
|
||||||
|
|
||||||
### Bug fixes
|
|
||||||
|
|
||||||
- Fixes the new startup messages. See below.
|
|
||||||
|
|
||||||
### Improvements and bug fixes to the new startup messages
|
|
||||||
|
|
||||||
The two new startup messages introduced in sbt 0.13.15 are:
|
|
||||||
|
|
||||||
+ when writing out `sbt.version` for build reproducability, and
|
|
||||||
+ when informing the user sbt shell for the performance improvement
|
|
||||||
|
|
||||||
When writing out `sbt.version` the messaging now:
|
|
||||||
|
|
||||||
+ correctly uses a logger rather than println
|
|
||||||
+ honours the log level set, for instance, by `--error`
|
|
||||||
+ never runs when sbt "new" is being run
|
|
||||||
|
|
||||||
When informing the user about sbt shell the messaging now:
|
|
||||||
|
|
||||||
+ is a 1 line message, rather than 3
|
|
||||||
+ is at info level, rather than warn level
|
|
||||||
+ can be suppressed with `suppressSbtShellNotification := false`
|
|
||||||
+ only triggers when "compile" is being run
|
|
||||||
+ never shows when sbt "new" is being run
|
|
||||||
|
|
||||||
[#3091][]/[#3097][]/[#3147][] by [@dwijnand][]
|
|
||||||
|
|
||||||
[#3091]: https://github.com/sbt/sbt/issues/3091
|
|
||||||
[#3097]: https://github.com/sbt/sbt/issues/3097
|
|
||||||
[#3147]: https://github.com/sbt/sbt/pull/3147
|
|
||||||
|
|
||||||
[@dwijnand]: https://github.com/dwijnand
|
|
||||||
Loading…
Reference in New Issue