Skip to content

Releases: sbt/sbt

1.3.7

15 Jan 06:19
v1.3.7
fb17606

Choose a tag to compare

Fixes

1.3.6

26 Dec 03:21
v1.3.6
c23f951

Choose a tag to compare

Fixes

1.3.5

13 Dec 17:43
v1.3.5
8ef2c11

Choose a tag to compare

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 := false

You 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

1.3.4

23 Nov 18:37
v1.3.4
413994d

Choose a tag to compare

Fixes

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

14 Oct 16:09
v1.3.3
50f3acd

Choose a tag to compare

Fixes

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

20 Sep 17:32
v1.3.2
3ca185f

Choose a tag to compare

Fixes with compatibility implication

  • sbt launcher script drops -XX:+UseParallelGC for 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

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

20 Sep 04:21
v1.3.1
3ca185f

Choose a tag to compare

1.3.1 Pre-release
Pre-release

The core artifact of sbt 1.3.1 is identical to sbt 1.3.2, but there's a bug in the sbt bash script, so we are releasing sbt 1.3.2.

1.3.0

04 Sep 06:25
v1.3.0
fbfceb5

Choose a tag to compare

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 use CrossVersion.disabled instead sbt/librarymanagement#316
  • ClassLoader management: To prevent resource leaks, sbt 1.3.0 closes the ephemeral ClassLoaders used by the run and test tasks 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 set Compile / run / fork := true or 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 := false

Many 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 := true

Initially 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.AllLibraryJars
  • ClassLoaderLayeringStrategy.Flat includes 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.ScalaLibrary creates a two-layer ClassLoader where Scala standard library is kept warm, similar to sbt 1.2.x
  • ClassLoaderLayeringStrategy.AllLibraryJars creates 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 := ReloadOnSourceChanges

This 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...
Read more

1.3.0-RC5

29 Aug 21:52
v1.3.0-RC5
a7dd869

Choose a tag to compare

1.3.0-RC5 Pre-release
Pre-release
v1.3.0-RC5

1.3.0-RC5

1.3.0-RC4

20 Aug 22:27
v1.3.0-RC4
cd00d0f

Choose a tag to compare