Releases: sbt/sbt
1.2.1
1.2.1 is a patch release to 1.2.0
Forward bincompat breakage
If you are writing a plugin, please use 1.2.1+, and avoid 1.2.0.
We unintentionally broke forward binary compatibility in 1.2.0.
If someone publishes an sbt plugin using sbt 1.2.0, it cannot be used from sbt 1.0.x or 1.1.x.
sbt 1.2.1 reverts the change, so the forward compatibility is restored.
Unfortunately, this means we won't be able to use varargs in inThisBuild(...) etc again.
Note that we might eventually break forward compatibility, like we did in 0.13.5 for AutoPlugin,
but only when the tradeoff is worth it.
The project Foo references an unknown configuration "bar"
Second regression fix is for the wall of warnings you might have seen in 1.2.0 that looks as follows:
[warn] The project ProjectRef(uri("file:/Users/xxx/work/akka/"), "akka-actor-typed") references an unknown configuration "multi-jvm" and was guessed to be "Multi-jvm".
[warn] This configuration should be explicitly added to the project.
[warn] The project ProjectRef(uri("file:/Users/xxx/work/akka/"), "akka-actor-typed-tests") references an unknown configuration "multi-jvm" and was guessed to be "Multi-jvm".
[warn] This configuration should be explicitly added to the project.
The original issue was that unified slash syntax doesn't pick the configuration names
when the configuration is not part of the subproject. Since this warning is immaterial,
we are removing them in this patch release.
One thing the plugin authors can start doing is declaring the custom configuration
as hidden, and adding them into the subprojects as follows:
import sbt._
import sbt.Keys._
object ParadoxPlugin extends AutoPlugin {
val ParadoxTheme = config("paradox-theme").hide
override def projectConfigurations: Seq[Configuration] = Seq(ParadoxTheme)
....
}We are also looking into improving unified slash syntax parser to make it more robust.
Other bug fixes
- Updates
IO.relativizefor JDK 9. io#175 by @eatkins - Fixes logic for adding external class file manager. zinc#562 by @allanrenucci
Participation
A huge thank you to everyone who's helped improve sbt and Zinc 1 by using them, reporting bugs, improving our documentation, porting builds, porting plugins, and submitting and reviewing pull requests.
sbt 1.2.1 was brought to you by 4 contributors, according to git shortlog -sn --no-merges v1.2.1...v1.2.0 on sbt, zinc, librarymanagement, util, io, launcher-packege, and website: Eugene Yokota, Aaron S. Hawley, Ethan Atkins, and Allan Renucci. Thanks! Also special thanks to Ches Martin and Yoshida-san for reporting these issues.
1.2.0
Warning: We found forward compatibility breakage in 1.2.0, so we recommend everyone to upgrade to sbt 1.2.1 or later.
The headline features of sbt 1.2 are cross JDK forking, composite project, and experimental thin clients. But, there are lots of other bug fixes and enhancements that we've been accumulating for six months since sbt 1.1.
SbtPlugin for plugin development
SbtPlugin is a plugin to declare a project for sbt plugins. This automatically brings in scripted tests, and sets sbtPlugin := true.
lazy val root = (project in file("."))
.enablePlugins(SbtPlugin)Compatibility note: ScriptedPlugin is no longer a triggered plugin.
[#3875][3875] by [@eed3si9n][@eed3si9n]
Cross JDK forking
For forked run and test, java++ can now switch Java Home.
sbt:helloworld> run
[info] Running (fork) Hello
[info] 1.8.0_171
sbt:helloworld> java++ 10!
[info] Reapplying settings...
sbt:helloworld> run
[info] Running (fork) Hello
[info] 10.0.1
sbt will try to detect Java homes into discoveredJavaHomes setting, supporting shyiko/jabba. This can be augmented by Global / javaHomes:
Global / javaHomes += "6" -> file("/something/java-6")
This feature is intended for testing your library in an older JVM to check compatibility.
[#4139][4139] by [@2m][@2m], [@cunei][@cunei], and [@eed3si9n][@eed3si9n]
scalaVersion-filtered aggregation
In 2015 James Roper contributed scalaVersion-filtered aggregation to sbt-doge. This feature is brought back into sbt 1.2 by Rui Gonçalves ([@ruippeixotog][@ruippeixotog]) in [#3698][3698]/[#3995][3995]!
This extends switch command ++ to take an optional <command>:
> ++2.12.6 compile
This will aggregate only the subproject where ++2.12.6 is valid, which is useful when you have a build where some subprojects are 2.11 only etc.
Composite project
sbt 1.2.0 introduces "composite project" trait, which allows plugin authors to generate subprojects, for example for cross building.
trait CompositeProject {
def componentProjects: Seq[Project]
}
This was contributed by [@BennyHill][@BennyHill] as [#4056][4056].
Project matrix
Experimental. As a reference implementation of the CompositeProject I implemented a new DSL called projectMatrix introduced by [sbt-projectmatrix][projectmatrix] plugin.
lazy val core = (projectMatrix in file("core"))
.scalaVersions("2.12.6", "2.11.12")
.settings(
name := "core"
)
.jvmPlatform()
lazy val app = (projectMatrix in file("app"))
.dependsOn(core)
.scalaVersions("2.12.6")
.settings(
name := "app"
)
.jvmPlatform()The aim of the plugin is to support a generic notion of cross building (Scala version, platform, etc) expressed using subprojects. In the above projectMarix will produce three subprojects: coreJVM2_12, coreJVM2_11, and appJVM2_12.
Semantic Version selector API
sbt 1.2.0 introduces Semantic Version selector on VersionNumber() datatype supporting basic match, comparison (<=, <, >=, >), combination (>1.0.0 <2.0.0, ||), ranges (A.B.C - D.E.F), and wildcard (2.12.x).
scala> import sbt.librarymanagement.{ VersionNumber, SemanticSelector }
import sbt.librarymanagement.{VersionNumber, SemanticSelector}
scala> VersionNumber("2.12.5").matchesSemVer(SemanticSelector(">=2.12"))
res1: Boolean = true
scala> VersionNumber("2.12.5").matchesSemVer(SemanticSelector("<2.12"))
res2: Boolean = false
scala> VersionNumber("2.13.0-M4").matchesSemVer(SemanticSelector("2.13"))
res3: Boolean = false
scala> VersionNumber("2.12.5").matchesSemVer(SemanticSelector("2.12.1 - 2.12.6"))
res4: Boolean = true
scala> VersionNumber("2.12.5").matchesSemVer(SemanticSelector("2.12.x"))
res5: Boolean = true
scala> VersionNumber("2.12.5").matchesSemVer(SemanticSelector("2.11.x || 2.12.x"))
res6: Boolean = trueNote: This has no effect on library management at the moment.
This was contributed by Rikito Taniguchi ([@tanishiking][@tanishiking]) as [lm#239][lm239].
addPluginSbtFile command
There's been a request from IntelliJ to safely inject a plugin to a build. sbt 1.2.0 adds -addPluginSbtFile command to do so.
$ cat /tmp/extra.sbt
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.7")
$ sbt -addPluginSbtFile=/tmp/extra.sbt
...
sbt:helloworld> plugins
In file:/xxxx/hellotest/
...
sbtassembly.AssemblyPlugin: enabled in root
Implmented by [@eed3si9n][@eed3si9n] as [#4211][4211].
Extensible sbt server
Experimental. sbt server can now be extended via the plugin.
Global / serverHandlers += ServerHandler({ callback =>
import callback._
import sjsonnew.BasicJsonProtocol._
import sbt.internal.protocol.JsonRpcRequestMessage
ServerIntent(
{
case r: JsonRpcRequestMessage if r.method == "lunar/helo" =>
jsonRpcNotify("lunar/oleh", "")
()
},
PartialFunction.empty
)This feature is still experimental and the API may change in the future.
[#3975][3975] by [@eed3si9n][@eed3si9n]
Thin client(s)
Experimental. sbt 1.2.0 adds a new mode called -client. When sbt is started with -client command, it no longer to loads the build, and instead tries to connect to an instance of sbt server over JSON-RPC. When the server is not running (portfile is not found), it will fork a new instance of sbt entirely in a new JVM.
This lets you invoke sbt from the terminal shell or from an editor.
$ time sbt -client clean
[info] entering *experimental* thin client - BEEP WHIRR
[info] server was not detected. starting an instance
[info] waiting for the server...
[info] waiting for the server...
[info] waiting for the server...
[info] waiting for the server...
[info] server found
> clean
[success] completed
sbt -client clean 9.23s user 2.33s system 22% cpu 50.558 total
# server stays
$ ps | rg java
21860 ttys015 1:22.43 java -Xms2048M -Xmx2048M -Xss2M -jar /usr/local/Cellar/sbt/1.1.6/libexec/bin/sbt-launch.jar
22014 ttys015 0:00.00 rg java
$ time sbt -client clean
[info] entering *experimental* thin client - BEEP WHIRR
> clean
[info] Updating ...
[info] Done updating.
[success] completed
sbt -client clean 3.39s user 1.75s system 104% cpu 4.898 total
To end the server, call sbt -client shutdown. [#4227][4227] by [@eed3si9n][@eed3si9n]
In addition, there are also an alternative thin clients cb372/sbt-client and dwijnand/sbtl implemented using Rust.
Changes with compatibility implication
- Removes deprecated commands
-,--, and---. UseonFailure,sbtClearOnFailure, andresumeFromFailureinstead. [#4124][4124] - Makes
++fail when it doesn't affect any subprojects [#4269][4269] by [@eed3si9n][@eed3si9n]
Other bug fixes and improvements
-
Fixes output caching bug. [util#169][util169] by [@bpholt][@bpholt]
-
Fixes "destination file exists" error message. [lm#255][lm255] by [@eed3si9n][@eed3si9n]
-
Reintroduces
Command.process(String, State): State. [#4023][4023] by [@dwijnand][@dwijnand] -
Fixes
active.jsonnot getting removed on JVM shutdown. [#4194][4194] by [@veera83372][@veera83372] -
Fixes file permission error ("
CreateFile()failed") while reading the timestamp on Windows. [io#134][io134] by [@cunei][@cunei] -
Fixes the linter that detects missing
.value. [#4090][4090] by [@eed3si9n][@eed3si9n] -
Fixes
StringIndexOutOfBoundsExceptioninremoveEscapeSequences. [util#139][util139] by [@dwijnand][@dwijnand] -
Fixes OkHttp's
JavaNetAuthenticatorwith a null check. [lm#177][lm177] by [@eed3si9n][@eed3si9n] -
Fixes Sonatype timeout issue by extending the default timeout to 1h. [lm#246][lm246] by [@peterneyens][@peterneyens]
-
Fixes thread thrashing error during the parallel download. [lm249][lm249] by [@OlegYch][@OlegYch]
-
Fixes JavaDoc warnings logged as errors. [zinc#506][zinc506] by [@kaygorodov][@kaygorodov]
-
Fixes class dependency not picking up
classOf[A]. [zinc#510][zinc510] by [@natansil][@natansil] -
Fixes class dependency including non-existing objects. [zinc422][zinc422] by [@romanowski][@romanowski]
-
Fixes link to the documentation of deprecated 0.10/0.12 DSL syntax. [#3901][3901] by [@colindean]
-
Fixes the documentation of
skipkey. [#3926][3926] by [@dkim][@dkim] -
Fixes race condition in non-forked parallel tests. [#3985][3985] by [@retronym][@retronym]
-
Fixes Ctrl-C handing in forked tests when
Global / cancelableis set totrue. [#4226][4226] by [@driquelme][@driquelme] -
Fixes the stacktrace of
run. [#4232][4232] by [@eed3si9n][@eed3si9n] -
Bumps the version of Giter8 used by
sbt newto 0.11.0, fixing various issues [#4263][4263] by [@eed3si9n][@eed3si9n] -
Improves Javac error parsing. [zinc#557][zinc557] by [@eed3si9n][@eed3si9n]
-
Displays only the eviction warning summary by default, and make it configurable using
ThisBuild / evictionWarningOptions. [lm211][lm211] and [#3947][3947] by [@exoego][@exoego] -
Allow varargs in
inThisBuild(...),inConfig(C)(...),inTask(t)(...),inScope(scope)(...). [#4106][4106] by [@dwijnand][@dwijnand] -
Adds
fgRunandfgRunMaintasks that behaves like sbt 0.13'srun. [#4216][4216] by [@agaro1121][@agaro1121] -
Supports
test.scriptandpending.scriptas the scripted file name. [#4220][4220] by [@regadas][@regadas] -
Supports aliases in
inspectcommand. [#4221][4221] by [@gpoirier][@gpoirier] -
Adds the current project's id to
~'s watching message. [#2038][2038] / [#3813][3813] by [@dwijnand][@dwijnand]
...
1.2.0-RC3
v1.2.0-RC3 1.2.0-RC3
1.2.0-RC2
1.2.0-RC1
v1.2.0-RC1 1.2.0-RC1
1.2.0-M1
1.1.6
Bug fixes
- Fixes file watching for Unix/Linux. io#150 by @eatkins
- Fixes packageBin not creating file when deleted. #4161 by @dadarakt
- Fixes help -v rendering of multi-line descriptions. #4160 by @ninjalama
- Fixes --error etc to set log level. #4162 by @holdenk
- Handles managedSources writing into unmanaged source directories. #4099 by @eatkins
- Fixes handling of overflows in EventMonitor. io#155 by @eatkins
- Recovers "Resolving..." log under
UpdateLogging.Full. lm#240 by @hodga - Fixes
-Dconfig.resource=/path/to/configFileconflicting with Gigahorse. lm#241 by @tanishiking - Removes use of deprecated ModifiedTime methods. io#154 by @dwestheide
- Fixes tests on Windows. io#153 by @OlegYch
Participation
A huge thank you to everyone who's helped improve sbt and Zinc 1 by using them, reporting bugs, improving our documentation, porting builds, porting plugins, and submitting and reviewing pull requests.
sbt 1.1.6 was brought to you by 15 contributors, according to git shortlog -sn --no-merges v1.1.5...v1.1.6 on sbt, zinc, librarymanagement, util, io, launcher-package, and website: Ethan Atkins, Eugene Yokota, Dale Wijnand, Aaron S. Hawley, OlegYch, Richard Summerhayes, Jannis (dadarakt), Rikito Taniguchi (tanishiking), Øyvind Høisæther, Daniel Westheide, Harrison Houghton, Holden Karau, Håkon Wold, Jason Zaugg, and tekay.
For anyone interested in helping sbt, there are many avenues you could help, depending on your interest.
- Migrate library builds to sbt 1, or update plugins.
- Report bugs when you see them.
- Send in fixes to bugs.
- Update documentation.
If you're interested in other ideas, come talk to us on sbt-contrib or on Lightbend Discuss.
1.1.5
Bug fixes
- Fixes the latency between file modification events and triggered execution. io#142 and sbt#4096 by @eatkins
- Fixes NPE that could arise from WatchEvent io#140 by @oneill
- Fixes deleted files not triggering
~. sbt#4098 by @eatkins - Fixes MacOSXWatchService to meet the WatchService API. io#142 by @eatkins
- Avoids printing
RejectedExectionExeptionstack trace after cancellation. sbt#4058 by @retronym - Fixes Java version checking on Windows. lp#227 / lp#228 by @jessicah and @spangaer
- Fixes unexpected responses from sbt server. sbt#4093 by @laughedelic
- Re-fix console and JLine bug. sbt#4123 by @eed3si9n
- Fixes grammar for contributors guide. sbt#4133 by @som-snytt
Improvements
- Performance optimization for Zinc. zinc#492 by @retronym
- Adds support for detecting Dotty compiler plugins. zinc#529 by @liufengyun
- Bumps Scala to 2.12.6. sbt#4129 by @SethTisue
- Updates to JLine 2.14.6. sbt#4087 by @hvesalai
- Start sbt in VS Code terminal window. See below.
Watcher improvements
Continuing from sbt 1.1.4, Ethan Atkins contributed fixes and improvements for triggered execution ~ watcher. sbt 1.1.5 should fix the latency between file modification events and the command execution.
VS Code extension update
We released a new sbt VS Code extension that starts sbt session in the embedded terminal window. This was contributed by Robert Walker (@WalkingOlof) in sbt#4130.
sbt by example
We added sbt by example to the sbt documentation.
This is a single-page guide that takes you from zero to building an app on Docker, inspired by, and largely based on William Narmontas (@ScalaWilliam)'s Essential sbt.
Participation
A huge thank you to everyone who's helped improve sbt and Zinc 1 by using them, reporting bugs, improving our documentation, porting builds, porting plugins, and submitting and reviewing pull requests.
sbt 1.1.5 was brought to you by 21 constributors, according to git shortlog -sn --no-merges v1.1.4...v1.1.5 on sbt, zinc, librarymanagement, util, io, launcher-packege, and website: Eugene Yokota, Ethan Atkins, Jason Zaugg, Liu Fengyun, Antonio Cunei, Dale Wijnand, Roberto Bonvallet, Alexey Alekhin, Daniel Parks, Heikki Vesalainen, Jean-Luc Deprez, Jessica Hamilton, Kenji Yoshida (xuwei-k), Nikita Gazarov, OlegYch, Richard Summerhayes, Robert Walker, Seth Tisue, Som Snytt, oneill, and 杨博 (Yang Bo)
For anyone interested in helping sbt, there are many avenues you could help, depending on your interest.
- Migrate library builds to sbt 1, or update plugins.
- Report bugs when you see them.
- Send in fixes to bugs.
- Update documentation.
If you're interested in other ideas, come talk to us on sbt-contrib or on the brand new Lightbend Discuss.
1.1.4
Bug fixes
- Fixes triggered execution on macOS. See below for details.
- Fixes running
consoletwice messing up JLine. #3482/#4054 by @eed3si9n - Fixes
updateSbtClassifiers. #4070/#3432 by @steinybot - Fixes Java error message handling. zinc#524/zinc#525 by @retronym and @dwijnand
- Fixes the error message linking to the migration guide. #4063 by @dwijnand
- Fixes batch script so sbt runs on JDK 10 on Windows. lp#225 by @eed3si9n
- Fixes bash script so
sbt -debugchanges log level to debug. lp#226 by @eed3si9n
Improvements
- Exposes
sbt.io.JavaMilli. io#139 by @dwijnand - Adds
-Dsbt.launcher.cp.prependJVM flag that is used for monkey patching sbt. launcher#50 by @fommil
Triggered execution on macOS
sbt has long had issues with triggered execution on macOS. Ethan Atkins has contributed a fix for this problem by merging MacOSXWatchService from his CloseWatch. Thanks, Ethan!
Credit also goes to Greg Methvin and Takari's directory-watcher. #3860/#4071/io#138 by @eatkins
Running sbt with standby
One of the tricky things you come across while profiling is figuring out the process ID,
while wanting to profile the beginning of the application.
For this purpose, we've added sbt.launcher.standby JVM flag. Starting sbt 1.1.4, you can run:
$ sbt -J-Dsbt.launcher.standby=20s exit
This will count down for 20s before doing anything else. launcher#51 by @eed3si9n
Loading performance improvement
Using Flame graph (if you haven't yet, check out Profiling JVM applications post), Jason Zaugg identified hashing code of the build file to be one of the hot paths during sbt startup. Flame graph supports Ctrl+F to filter on method names; and when I ran it, it showed 4.5% of the time was spent in Eval#evalCommon method.
Instead of creating an intermediate Array[Byte] and passing it to MessageDigest at the end, Jason suggested that we pass the arrays to MessageDigest#update in a more procedural style. After confirming that it worked, we've next identified file timestamp code to be the next bottle neck using Flame graph, so that was switched to using NIO. After both changes, Eval#evalCommon's footprint reduced to 2.3%.
This means that your build loads slightly faster on sbt 1.1.4 (about 0.54s faster on akka/akka, for example). #4067 by @eed3si9n
Participation
A huge thank you to everyone who's helped improve sbt and Zinc 1 by using them, reporting bugs, improving our documentation, porting builds, porting plugins, and submitting and reviewing pull requests.
sbt 1.1.4 was brought to you by 11 contributors, according to git shortlog -sn --no-merges v1.1.2...v1.1.4 on sbt, zinc, librarymanagement, util, io, launcher-packege, and website: Eugene Yokota, Dale Wijnand, 杨博 (Yang Bo), Ethan Atkins, Sam Halliday, Aaron S. Hawley, Gabriele Petronella, Jason Steenstra-Pickens, Jason Zaugg, Julien Jean Paul Sirocchi, and aumann.
For anyone interested in helping sbt, there are many avenues you could help, depending on your interest.
- Migrate library builds to sbt 1, or update plugins.
- Report bugs when you see them.
- Send in fixes to bugs.
- Update documentation.
If you're interested in other ideas, come talk to us on sbt-contrib or on the brand new Lightbend Discuss.