Releases: sbt/sbt
1.3.7
Fixes
- Updates to lm-coursier-shaded 2.0.0-RC5-3, which brings in various fixes #5354/coursier#1455/coursier#1438 etc
- Fixes JUnit test report by only generating
TEST-com.example.FooTest.xml. Use-Dsbt.testing.legacyreport=trueto generatecom.example.FooTest.xmlinstead #5350/#4451 by @mrArkwright - Fixes supershell interfering with
runMain#5353/#5352 by @eatkins - Fixes the output of
show scalaInstancezinc#724 by @smarter - Fixes quoted argument on Windows batch script lp#317/#5210 by @eed3si9n
- Fixes quoted arguments on Bash script on JDK 9+ lp#320 by @heksesang
- Fixes unintended glob expansion in Bash script lp#319/#5343 by @eed3si9n
1.3.6
Fixes
- Changes the test ClassLoader so it won't close by default, and reverts the ClassLoader layer created specifically for ScalaTest #5327 / #5308 by @eatkins
- Fixes
sbtshell script not working the first time it's invoked on JDK 11 sbt/sbt-launcher-package#313 / #5270 by @eed3si9n - Works around subproject named
cleangetting mixed up withclientcommand #5317 / #5314 / #5265 by @eed3si9n - Fixes cross command
+so the tasks run in parallel when possible #5329 / #5321 by @eatkins - Fixes installer missing some artifacts sbt/sbt-launcher-package#310 by @eed3si9n
- Fixes
sbt.batso-debugoption is processed first sbt/sbt-launcher-package#311 by @er1c - Fixes
sbtshell script to reduce the number of flags passed intorsyncsbt/sbt-launcher-package#316 / #5035 by @eed3si9n
1.3.5
ClassLoader management fixes
Starting sbt 1.3.0, sbt started closing the ephemeral ClassLoaders used by the run and test tasks after those tasks complete to prevent resource leaks. If any threads created by the tasks continue running after the task finishes, they are assigned to a ZombieClassLoader.
sbt 1.3.5 adds a new setting closeClassLoaders to opt out of this behavior:
ThisBuild / closeClassLoaders := falseYou can also run sbt with -Dsbt.classloader.close=false.
sbt 1.3.5 also fixes ZombieClassLoader so it is thread-safe #5267 / #5249, and fixes ScalaTest resource loading issue #5273 / #5262. These fixes were contributed by Ethan Atkins (@eatkins)
Other fixes
- Fixes "sbt new",
runetc not echoing to the terminal #5295 / #5063 by @eed3si9n - Provides more detailed error message when publishing fails ivy#35 / #5185 by @francisdb
- Gives more precise type to
mkIvyConfiguration#5271 by @smarter - Fixes
updatetask not invalidating when the Coursier cache is removed #5303 / #5292 by @eed3si9n - Fixes cross command when used with input tasks #5265 / #4715 by @eatkins
1.3.4
Fixes
- Updates to lm-coursier-shaded 2.0.0-RC5-2, which brings in various fixes.
- Fixes lm-coursier-shaded so it's compatible with sbt-dependency-graph #4688/sbt-coursier#156 by @eed3si9n
- Fixes
--addPluginSbtFilecommand so it is not dependent on the global plugin subproject #4395/#5229 by @eed3si9n - Fixes
semanticdbVersionsetting so it can be set asThisBuild / semanticdbVersion#5202 by @regadas - Fixes high CPU usage while retrying background job shutdown #5225 by @samvel1024
- Fixes
ivy.xmlgeneration so description and homepage are included #5235 by @fthomas - Fixes
-Dhandling of sbt.bat #5192 by @eed3si9n - Implements -XX handling on sbt.bat sbt-launcher-package#306 by @eed3si9n
- Fixes
--script-versionon sbt.bat sbt-launcher-package#307 by @er1c - Fixes
sbtBash script to use exec sbt-launcher-package#308 by @esamson
Participation
sbt 1.3.4 was brought to you by 8 contributors. Eugene Yokota (eed3si9n), Eric Peters, Filipe Regadas, Michael Hsu, Dale Wijnand, Edward Samson, Frank S. Thomas, Samvel Abrahamyan. Thank you!
Thanks 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.
For anyone interested in helping sbt, there are many avenues for you to help, depending on your interest. If you're interested, Contributing, "help wanted", "good first issue" are good starting points. If you have ideas, come talk to us on sbt-contrib or on Lightbend Discuss
1.3.3
Fixes
- Fixes "Could not create directory ...classes.bak" #5146 by @retronym and @eed3si9n
- Fixes internal ClassLoader causing dead locks #5131 by @eatkins
- Fixes race condition around
cleantask #5157 by @eatkins - Fixes "Class sun.reflect.CallerSensitive not found" problem sbt/zinc#701 by @retronym
- Fixes error messages reported coming from Dotty sbt/zinc#699 by @smarter
- Fixes super shell display sbt/util#223 / sbt/util#227 / #5125 / #5148 / #5156 by @eatkins
- Fixes check build sources for projects with meta-meta-build #5109 by @eatkins
- Fixes
fgRunperformance regression #5126 by @eatkins - Fixes scripted parser #5158 by @eatkins
- Fixes
-vgetting on all the time sbt/sbt-launcher-package#283 by @eed3si9n - Fixes initial version number in
sbtscript sbt/sbt-launcher-package#289 by @jsoref - Adds
--numeric-version,--script-version, and updates--versionto print both versions sbt/sbt-launcher-package#288 by @er1c - Adds
--verboseoption tosbt.batsbt/sbt-launcher-package#291 by @eed3si9n - Adds
--help,--versionand many other feature tosbt.batsbt/sbt-launcher-package#285 by @er1c - Fixes equal sign handling in
-Dkey=valueforsbt.batsbt/sbt-launcher-package#290 by @eed3si9n - Fixes
-XX:MaxRAMPercentageoption handling sbt/sbt-launcher-package#295 by @azolotko
Participation
sbt 1.3.3 was brought to you by 7 contributors. Ethan Atkins, Eugene Yokota (eed3si9n), Eric Peters, Alex Zolotko, Guillaume Martres, Jason Zaugg, Josh Soref. Thank you!
Thanks 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.
For anyone interested in helping sbt, there are many avenues for you to help, depending on your interest. If you're interested, Contributing, "help wanted", "good first issue" are good starting points. If you have ideas, come talk to us on sbt-contrib or on Lightbend Discuss
1.3.2
Fixes with compatibility implication
sbtlauncher script drops-XX:+UseParallelGCfor JDK 9 and up since it could cause severe GC pauses given a large heap sbt/sbt-launcher-package#282 / #5045 by @eed3si9n- Updates to lm-coursier-shaded 2.0.0-RC3-4, which fixes the handling of Basic auth.
Other fixes
- Updates to Scala 2.12.10
- Fixes
NoClassDefFoundErrorat the end ofrunwhen thread keeps running after the task. UseallowZombieClassLoaders := trueto opt into using classes after the task. #5081 / #5083 by @eatkins - Adds a new setting called
includePluginResolvers(defaultfalse).
When set totrue, the project will include resolvers from the metabuild. #5094 by @eed3si9n - Fixes
-valways being on in 1.3.1 - sbt/sbt-launcher-package#283 by @eed3si9n - Fixes quotation in
sbtscript - sbt/sbt-launcher-package#280 by @kingslef - Fixes dashes in
sbtscript - sbt/sbt-launcher-package#281 by @anilkumarmyla - Fixes file watching when
-Dsbt.global.baseis set to a relative path #5048 by @yamachu - Fixes duplicates in allJars when creating a ScalaInstance #5053 by @unkarjedy
- Fixes deprecation warnings for watch related changes #5054 by @eatkins
- Fixes super shell interfering with
consoleQuickandstate#5087 by @eatkins - Fixes build source watch not tracking subproject
*.sbtfiles #5086 by @eatkins - Fixes race condition around task logging #5069 by @eatkins
- Fixes acquiring timestamp from files with long path name on Windows sbt/io#271 by @eatkins
Participation
sbt 1.3.2 was brought to you by 7 contributors. Ethan Atkins, Eugene Yokota (eed3si9n), Anil Kumar Myla, Dmitrii Naumenko, Kenji Yoshida (xuwei-k), Yusuke Yamada, and Tuomas Lappeteläinen. Thank you!
Thanks 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.
For anyone interested in helping sbt, there are many avenues for you to help, depending on your interest. If you're interested, Contributing, "help wanted", "good first issue" are good starting points. If you have ideas, come talk to us on sbt-contrib or on Lightbend Discuss
1.3.1
1.3.0
This is the third feature release of sbt 1.x, a binary compatible release focusing on new features. sbt 1.x is released under Semantic Versioning, and the plugins are expected to work throughout the 1.x series.
The headline features of sbt 1.3 are out-of-box Coursier library management, ClassLoader layering, IO improvements, and super shell. Combined together we hope these features will improve the user experience of running your builds.
How to upgrade
You can upgrade to sbt 1.3.0 by putting the following in project/build.properties:
sbt.version=1.3.0
To get other benefits to launching script and sbt launcher, we strongly recommend upgrading the sbt script following the setup instruction.
Changes with compatibility implication
- Library management with Coursier. See below for details.
- Super shell. See below for details.
- Note publishing sbt plugins with sbt 1.3.x will require the users to upgrade to sbt 1.3.x. Set
pluginCrossBuild / sbtVersion := "1.2.8"to avoid that. - Multi command no longer requires leading semicolon. clean;Test/compile; would work. #4456 by @eatkins
- Deprecates HTTP resolvers, but allow localhost or resolvers marked
.withAllowInsecureProtocol(true)#4997 - Deprecates
CrossVersion.Disabled. Please useCrossVersion.disabledinstead sbt/librarymanagement#316 - ClassLoader management: To prevent resource leaks, sbt 1.3.0 closes the ephemeral ClassLoaders used by the
runandtesttasks after those tasks complete. This may cause downstream crashes if the task uses ShutdownHooks or if any threads created by the tasks continue running after the task completes. To disable this behavior, either setCompile / run / fork := trueor run sbt with-Dsbt.classloader.close=false.
Library management with Coursier
sbt 1.3.0 adopts Coursier for the library management. Coursier is a dependency resolver like Ivy, rewritten in Scala by Alexandre Archambault ([@alexarchambault][@alexarchambault]), aiming to be a faster alternative.
Note: Under some situations, Coursier may not resolve the same way as Ivy (for example remote -SNAPSHOTs are cached for 24 hours). If you wish to go back to Apache Ivy for library management, put the following in your build.sbt:
ThisBuild / useCoursier := falseMany people were involved in the effort of bringing Coursier to sbt. Early in 2018 Leonard Ehrenfried ([@leonardehrenfried][@leonardehrenfried]) started the Coursier-backed LM API implementation as [lm#190][lm190]. During the fall, it was further improved by Andrea Peruffo ([@andreaTP][@andreaTP]), and lm-coursier eventually became part of coursier/sbt-coursier repository maintained by Alex. This spring, Eugene ([@eed3si9n][@eed3si9n]) revisited this again to make a few more changes so we can swap out the LM engine in [#4614][4614] with the help from Alex.
Turbo mode with ClassLoader layering
sbt 1.3.0 adds "turbo" mode that enables experimental or advanced features that might require some debugging by the build user when it doesn't work.
ThisBuild / turbo := trueInitially we are putting the layered ClassLoader (ClassLoaderLayeringStrategy.AllLibraryJars) behind this flag.
sbt has always created two-layer ClassLoaders when evaluating the run and test tasks. The top layer of the ClassLoader contains the scala library jars so that the classes in the scala package may be reused across multiple task evaluations. The second layer loads the rest of the project classpath including the library dependencies and project class files. sbt 1.3.0 introduces experimental classLoaderLayeringStrategy feature that furthers this concept.
Compile / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat
// default
Compile / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.ScalaLibrary
// enabled with turbo
Compile / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.AllLibraryJars
Test / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.Flat
// default
Test / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.ScalaLibrary
// enabled with turbo
Test / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.AllLibraryJarsClassLoaderLayeringStrategy.Flatincludes all classes and JARs except for the Java runtime. The behavior of tasks using this strategy should be similar to forking without the overhead of starting a new jvm.ClassLoaderLayeringStrategy.ScalaLibrarycreates a two-layer ClassLoader where Scala standard library is kept warm, similar to sbt 1.2.xClassLoaderLayeringStrategy.AllLibraryJarscreates a three-layer ClassLoader where library dependencies, in addition to Scala standard libraries are kept warm
ClassLoaderLayeringStrategy.AllLibraryJars should benefit the response time of run and test tasks. By caching the library jar classloader, the startup latency of the run and test tasks can be reduced significantly when they are run multiple times within the same session. GC pressure is also reduced because libraries jars will not be reloaded every time the task is evaluated.
Note: ClassLoaderLayeringStrategy.AllLibraryJars reuses the singleton object between the tests, which requires libraries to clean after itself.
ClassLoaderLayeringStrategy.Flat on the other hand will benefit certain applications that do not work well with layered ClassLoaders. One such example is Java serialization + serialization proxy pattern used by Scala collections.
ClassLoader layering was contributed by Ethan Atkins (@eatkins) as #4476
IO improvements
In addition to classloader layering, sbt 1.3.0 incorporates numerous performance enhancements including:
- faster recursive directory listing -- sbt internally uses a native library,
swoval, that
provides a jni interface to native os apis that allow for faster recursive
directory listing than the implementations in the java standard library. - reduced latency of file change detection in continuous builds. In most cases
file events will trigger task evaluation within 10ms.
As of this writing sbt 1.3.0's edit-compile-test loop for 5000 source files is faster than that edit-compile-test with three source files using sbt 0.13, Gradle, and other build tools we tested (see build
performance for
details). These changes were contributed by Ethan Atkins (@eatkins).
Glob
sbt 1.3.0 introduces a new type, Glob, that describes a path search query. For example, all of the scala sources in the project directory can be described by Glob(baseDirectory.value, RecursiveGlob / "*.scala") or baseDirectory.value.toGlob / ** / "*.scala", where ** is an alias for RecursiveGlob. Glob expands on PathFinders but they can be composed with no io overhead. Globs can be retrieved using a FileTreeView. For example, one can write:
val scalaSources = baseDirectory.value.toGlob / ** / "*.scala"
val javaSources = baseDirectory.value.toGlob / ** / "*.java"
val allSources = fileTreeView.value.list(Seq(scalaSources, javaSources))and the FileTreeView will only traverse the base directory once. Globs and FileTreeView were added by Ethan Atkins ([@eatkins][@eatkins]) in io#178,io#216,io#226
Watch improvements
sbt 1.3.0 introduces a new file monitoring implementation. It uses enhanced apis for tracking file change events using os events. It adds a new parser that extracts the specific task(s) for which it will monitor source files and rerun when it detects changes. Only source dependencies of the running tasks are monitored. For example, when running ~compile, changes to test source files will not trigger a new build. Between file events, there are also now options to return to the shell, rerun the previous command(s) or exit sbt. These changes were implemented by Ethan Atkins ([@eatkins][@eatkins]) in io#178,#216,#226,#4512,#4627.
Build definition source watch
sbt 1.3.0 automatically watches the build definition sources and displays a warning
if you execute a task without reloading. This can be configured to reload automatically as follows:
Global / onChangedBuildSource := ReloadOnSourceChangesThis feature was contributed by Ethan Atkins ([@eatkins][@eatkins]) in [#4664][4664]
Custom incremental tasks
sbt 1.3.0 provides support to implement custom incremental tasks based on files.
Given a custom task that returns java.nio.file.Path, Seq[java.nio.file.Path], File, or Seq[File],
you can define a few helper tasks to make it more incremental.
import java.nio.file._
import scala.sys.process._
val gccCompile = taskKey[Seq[Path]]("compile C code using gcc")
val gccHeaders = taskKey[Seq[Path]]("header files")
val gccInclude = settingKey[Path]("include directory")
val gccLink = taskKey[Path]("link C code using gcc")
gccCompile / sourceDirectory := sourceDirectory.value
gccCompile / fileInputs += (gccCompile / sourceDirectory).value.toGlob / ** / "*.c"
gccInclude := (gccCompile / sourceDirectory).value.toPath / "include"
gccHeaders / fileInputs += gccInclude.value.toGlob / "*.h"
gccCompile / target := baseDirectory.value / "out"
gccCompile := {
val objectDir = Files.createDirectories((gccCompile / target).value.toPath / "objects")
def object...1.3.0-RC5
v1.3.0-RC5 1.3.0-RC5