Changelog History
Page 1
-
v1.4.4 Changes
November 23, 2020- β‘οΈ Updates SemanticDB to 4.4.0 to support Scala 2.13.4 #6148 by @adpi2
- π Fixes sbt plugin cross building regression when we enabled
scriptedBatchExecution
by default #6091/#6151 by @xuwei-k and @eatkins - π Fixes scala-compiler not included into the metabuild classpath #6146 by @eatkins
- π Fixes macro occasionally dropping expressions trying to work around Scala compiler displaying "a pure expression does nothing" when sbt is really doing something #6158 by @eed3si9n
- π Fixes publishing to Azure Artifacts by setting HTTP Accept header ivy#40 by @3rwww1
- π Fixes UTF-8 handling in shell and console #6106 by @eatkins
- π Fixes BSP server logging to stdout #6097 by @adpi2
- π Fixes supershell line interlacing with logs #6112 by @eatkins
- π Fixes shutdown for thin client shell #6113 by @eatkins
- π Fixes thin client sbt process startup output #6115 by @eatkins
- π Fixes background job service shutdown #6130 by @eatkins
- π Fixes logger thunk #6128 by @eatkins
- π Fixes watch when Metals
sbt -bsp
is in use #6129 by @eatkins - π Fixes watch for "dumb" terminal #6107 by @eatkins
- π¨ Refactor
sbt -bsp
to use NetworkClient #6114 by @eatkins - β Adds system property
sbt.build.onchange
foronChangedBuildSource
#6099 by @xirc - π¨ Don't print socket exception on exit #6108 by @eatkins
Global / localCacheDirectory
for remote cachingπ sbt 1.4.4 adds a new Global key called
localCacheDirectory
. Similar to Coursier cache, this is meant to be shared across all builds running on a machine. Also similar to Coursier cache this will try to follow the operating system specific caching directory.- Environment variable:
SBT_LOCAL_CACHE
- System property:
sbt.global.localcache
- π Windows: %LOCALAPPDATA%\sbt\v1
- π macOS: $HOME/Library/Caches/sbt/v1
- π§ Linux: $HOME/.cache/sbt/v1
-
v1.4.3 Changes
November 16, 2020- β‘οΈ Updates to Coursier 2.0.6 #6036 by @jtjeferreira
- π Fixes IntelliJ import on Windows #6051 by @eatkins
- π Fixes the dependency resolution in metabuild #6085 by @eed3si9n
- β Removes "duplicate compilations" assertion to work around Play issue zinc#940 by @johnduffell
- π Fixes GC monitor warnings #6082 by @nafg
- π Fixes opt-out for scripted batch execution #6054 by @eatkins
- π Fixes
--no-colors
#6044 by @eatkins - π Fixes tab completion under
-Dsbt.color=false
#6068 by @eatkins - π Fixes the cancellation of
console
task #6073 by @eatkins - π Fixes
console
task under-Dci=true
#6067 by @eatkins - β‘οΈ Optimizes
knownProducts
for direct-to-JAR compilation zinc#939 by @retronym - π Start server when
active.json
is removed #6041 by @eatkins
-
v1.4.2 Changes
November 02, 2020- π Fixes memory leak during task evaluation #6001 by @eatkins
- π§ Make remote caching content-based and scoped to configuration #6026 by @eed3si9n
- π Fixes early output paths uses during pipelining #6005 by @eed3si9n
- π Fixes sourceMappers handling of fake positions #6008 by @adpi2
- π Fixes BSP support for Dotty #6007 by @adpi2
- π Fixes
watchBeforeCommand
not being called #6018 by @eatkins - π Fixes
Ctrl-D
handling #6000/#6003 by @eatkins - π Fixes multi-color logging in CI #5998 by @eatkins
- π Fixes console echo for Windows batch commands #6016 by @eatkins
- π Fixes stack trace showing up on compilation failure with
~
zinc#935 by @eatkins - π Fixes remote caching extraction log #5996 by @xuwei-k
- π Fixes spurious BSP warning about SemanticDB #6011 by @adpi2
- π Fixes command line parsing in sbtn #6019 by @eatkins
- π¦ Work around whitespaces script path lp#338 by @eatkins
installSbtn
wizard for installing sbtn and completions #6023 by @eatkins
-
v1.4.1 Changes
October 19, 2020- π Fixes
sbt new
not echoing back the characters #5954 by @eatkins - π Fixes compiler error reporting in Zinc zinc#931 by @adpi2
- π Fixes
dependencyBrowseTree
etc #5967 by @naderghanbari - π Fixes Scala 2.13-3.0 sandwich support for Scala.JS #5984 by @xuwei-k
- βͺ Work around
classes
directory causing "classes does not exist" error zinc#934 by @eed3si9n - β Adds logging to
ClassfileManager
output #5990 by @smarter - π Fixes
Ctrl-C
andCtrl-D
handling #5947/#5975 by @eatkins - π Fixes
-Dsbt.color=true
not working in some situation #5960 by @eatkins - π Fixes
FileAlreadyExistsException
whenproject/target
is a symbolic link #5972 by @eatkins - π Fixes ANSI control character appearing in piped output #5966 by @eatkins
- π Fixes line reading issue with jEdit #5946 by @eatkins
- π Fixes sbt hanging on invalid
build.sbt
and--batch
#5945 by @eatkins - π Fixes
.inputrc
file support #5973 by @xuwei-k - π Fixes BSP warning diagnostics disappearing on recompilation #5950 by @adpi2
- π Fixes BSP support for custom configurations #5930 by @adpi2
- π Fixes custom reporter causing
MatchError
#5948 by @adpi2 - π Fixes
shellPrompt
andrelease*
keys warning on build linting #5983/#5991 by @xirc and @eed3si9n - π Fixes
<task>.value
macro causing spurious "a pure expression does nothing" warning #5981 by @eed3si9n - Preserves SemanticDB files in remote cache #5961 by @xuwei-k
- β Adds AdoptOpenJDK support for JDK cross building #5964 by @rdesgroppes
- π Improves
plugins
command output by grouping by subproject #5932 by @aaabramov
- π Fixes
-
v1.4.0 Changes
October 05, 2020The headline features of sbt 1.4.0 are:
- π build server protocol (BSP) support
- sbtn: a native thin client for sbt
- π build caching
- β
ThisBuild / versionScheme
to take the guessing out of eviction warning
β¬οΈ How to upgrade
Download the official sbt launcher from SDKMAN or download from https://www.scala-sbt.org/download.html. This installer includes the
sbtn
binary.β¬οΈ In addition, the sbt version used for your build is upgraded by putting the following in
project/build.properties
:sbt.version=1.4.0
π This mechanism allows that sbt 1.4.0 is used only for the builds that you want.
π Build server protocol (BSP) support
π sbt 1.4.0 adds build server protocol (BSP) support, contributed by Scala Center. Main implementation was done by Adrien Piquerez (@adpi2) based on @eed3si9n's prototype.
π When sbt 1.4.0 starts, it will create a file named
.bsp/sbt.json
containing a machine-readable instruction on how to runsbt -bsp
, which is a command line program that uses standard input and output to communicate to sbt server using build server protocol.How to import to IntelliJ using BSP
- Start sbt in a terminal
- Open IntelliJ IDEA 2020.1.2 or later
- Select "Open or import", and select "BSP Project"
How to import to VS Code + Metals
- Delete existing
.bsp
,.metals
,.bloop
directories if any - Open VS Code in the working directory
- Ignore the prompt to import the project
- Start
sbt -Dsbt.semanticdb=true
in the Terminal tab. Wait till it displays "sbt server started" π 5. Navigate to Metals view, and select "Restart build server" - Type
compile
into the sbt session to generate SemanticDB files
Native thin client
π sbt 1.4.0 adds an official native thin client called
sbtn
that supports all tasks. If you're using the official sbt launcher 1.4.0 and not the knockoff kind you can use--client
option to run the native thin client:$ sbt --client compile $ sbt --client shutdown
The native thin client will run sbt (server) as a daemon, which avoids the JVM spinup and loading time for the second call onwards. This could an option if you would like to use sbt from the system shell such as Zsh and Fish.
Remember to call
sbt --client shutdown
when you're done!
πsbtn
binary files are also available from https://github.com/sbt/sbtn-dist/releases/tag/v1.4.0ThisBuild / versionScheme
π sbt 1.4.0 adds a new setting called
ThisBuild / versionScheme
to track version scheme of the build:ThisBuild / versionScheme := Some("early-semver")
β The supported values are
"early-semver"
,"pvp"
, and"semver-spec"
. sbt will include this information intopom.xml
andivy.xml
as a property. In addition, sbt 1.4.0 will use the information to take the guessing out of eviction warning when this information is available. #5724 by @eed3si9nVirtualFile + RemoteCache
sbt 1.4.0 / Zinc 1.4.0 virtualizes the file paths tracked during incremental compilation. The benefit for this that the state of incremental compilation can shared across different machines, as long as
ThisBuild / rootPaths
are enumerated beforehand.To demonstrate this, we've also added experimental cached compilation feature to sbt. All you need is the following setting:
ThisBuild / pushRemoteCacheTo := Some(MavenCache("local-cache", file("/tmp/remote-cache")))
Then from machine 1, call
pushRemoteCache
. This will publish the*.class
and Zinc Analysis artifacts to the location. Next, from machine 2, callpullRemoteCache
.π Build linting
π On start up, sbt 1.4.0 checks for unused settings/tasks. Because most settings are on the intermediary to other settings/tasks, they are included into the linting by default. The notable exceptions are settings used exclusively by a command. To opt-out, you can either append it to
Global / excludeLintKeys
or set the rank to invisible.Conditional task
π sbt 1.4.0 adds support for conditional task (or Selective task), which is a new kind of task automatically created when
Def.task { ... }
consists of anif
-expression:bar := { if (number.value \< 0) negAction.value else if (number.value == 0) zeroAction.value else posAction.value }
π Unlike the regular (Applicative) task composition, conditional tasks delays the evaluation of then-clause and else-clause as naturally expected of an
if
-expression. This is already possible withDef.taskDyn { ... }
, but unlike dynamic tasks, conditional task works withinspect
command. See Selective functor for sbt for more details. #5558 by @eed3si9nπ Incremental build pipelining
π sbt 1.4.0 adds experimental incremental build pipelining. To enable build pipelining for the build:
ThisBuild / usePipelining := true
To opt-out of creating an early output for some of the subprojects:
exportPipelining := false
sbt-dependency-graph is in-sourced
π sbt 1.4.0 brings in Johannes Rudolph's sbt-dependency-graph plugin into the code base.
π Since it injects many tasks per subprojects, the plugin is split into two parts:- π§
MiniDependencyTreePlugin
that is enabled by default, bringing independencyTree
task toCompile
andTest
configurations π Full strength
DependencyTreePlugin
that is enabled by putting the following toproject/plugins.sbt
:addDependencyTreePlugin
π Fixes with compatibility implications
- 0οΈβ£ Replaces Apache Log4j with our own logger by default to avoid Appender leakage. Use
ThisBuild / useLog4J := true
to use Log4j. #5731 by @eatkins - π Makes JAR file creation repeatable by sorting entry by name and dropping timestamps #5344/io#279 by @raboof
- π Loads bare settings in the alphabetic order of the build files #2697/#5447 by @eed3si9n
- π Loads
val
s from top-to-bottom within a build file #2232/#5448 by @eed3si9n - HTTP resolvers require explicit opt-in using
.withAllowInsecureProtocol(true)
#5593 by @eed3si9n - Ctrl-C during triggered execution
~
returns to the shell instead of shutting down sbt #5804 by @eatkins
β‘οΈ Other updates
- β‘οΈ Updates shell to use JLine 3 for better tab completion #5671 by @eatkins
- β Adds support for Scala 2.13-3.0 sandwich #5767 by @eed3si9n
- Throws an error if you run sbt from
/
without-Dsbt.rootdir=true
#5112 by @eed3si9n - Upates
StateTransform
to acceptState => State
#5260 by @eatkins - π Fixes various issues around background run #5259 by @eatkins
- Turns off supershell when
TERM
is set to "dumb" #5278 by @hvesalai - π² Avoids using system temporary directories for logging #5289 by @eatkins
- β Adds library endpoint for
sbt.ForkMain
#5315 by @olafurpg - Avoids using last modified time of directories to invalidate
doc
#5362 by @eatkins - π Fixes the default artifact of packageSrc for custom configuration #5403 by @eed3si9n
- π Fixes task cancellation handling #5446/zinc#742 by @azolotko
- β Adds
toTaskable
method injection toInitialize[A]
for tuple syntax #5439 by @dwijnand - π Fixes the error message for an undefined setting #5469 by @nigredo-tori
- β‘οΈ Updates
semanticdbVersion
to 4.3.7 #5481 by @anilkumarmyla - β Adds
Tracked.outputChangedW
andTracked.inputChangedW
which requires typeclass evidence ofJsonWriter[A]
instead ofJsonFormat[A]
#5513 by @bjaglin - π Fixes various supershell interferences #5319 by @eatkins
- β Adds extension methods to
State
to faciliate sbt server communication #5207 by @eed3si9n - β Adds support for weighed tags for
testGrouping
#5527 by @frosforever - β‘οΈ Updates to sjson-new, which shades Jawn 1.0.0 #5595 by @eed3si9n
- π Fixes NullPointerError when credential realm is
null
#5526 by @3rwww1 - β Adds
Def.promise
for long-running tasks to communicate to another task #5552 by @eed3si9n - π Uses Java's timestamp on JDK 10+ as opposed to using native call io#274 by @slandelle
- β Adds retry with backoff during publish (
-Dsbt.repository.publish.attempts
set to 3) lm#340 by @izharahmd - π Improves failure message for PUT lm#309 by @swaldman
- β Adds provenance to AnalyzedClass zinc#786 by @dwijnand + @mspnf
- π Makes hashing childrenOfSealedClass stable zinc#788 by @dwijnand
- π Fixes performance regressions around build source monitoring #5530 by @eatkins
- π Fixes performance regressions around super shell #5531 by @eatkins
- π Various performance improvements in Zinc zinc#756/zinc#763 by @retronym
- β Adds a monitor to warn about excessive GC #5812 by @eatkins
- π Fixes forked tests running tests twice when they match multiple fingerprints #5800 by @Duhemm
Participation
sbt 1.4.0 was brought to you by 34 contributors. Ethan Atkins, Eugene Yokota (eed3si9n), Johannes Rudolph, Dale Wijnand, Adrien Piquerez, Jason Zaugg, Arnout Engelen, Josh Soref, Guillaume Martres, Maksim Ochenashko, Anil Kumar Myla, Brice Jaglin, Claudio Bley, JoΓ£o Ferreira, Steve Waldman, frosforever, Alex Zolotko, Heikki Vesalainen, Ismael Juma, Stephane Landelle, Jannik TheiΓ, izharahmd, lloydmeta, Alexandre Archambault, Eric Peters, Erwan Queffelec, Kenji Yoshida (xuwei-k), Martin Duhem, Olafur Pall Geirsson, Renato Cavalcanti, Vincent PERICART, nigredo-tori. Thanks!
π 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.
π Note to plugin authors
β¬οΈ If you build and publish a plugin using sbt 1.4.0, your users will also be forced to upgrade to sbt 1.4.0 immediately. To prevent this you can cross build your plugin against sbt 1.2.8 (while using sbt 1.4.0) as follows:
pluginCrossBuild / sbtVersion := "1.2.8"
Appendix
β To test sbt server manually, make sure to have an sbt session running, and start
sbt -bsp
in another termnial. And paste the following in:{ "jsonrpc": "2.0", "id": 1, "method": "build/initialize", "params": { "displayName": "foo", "version": "1.0.0", "bspVersion": "2.0.0-M5", "rootUri": "file:///tmp/hello", "capabilities": { "languageIds": ["scala"] } } }
Then enter
\r\n
(typeEnter
,Ctrl-J
for zsh). This should return:Content-Length: 200 Content-Type: application/vscode-jsonrpc; charset=utf-8 {"jsonrpc":"2.0","id":1,"result":{"displayName":"sbt","version":"1.4.0-SNAPSHOT","bspVersion":"2.0.0-M5","capabilities":{"compileProvider":{"languageIds":["scala"]},"dependencySourcesProvider":true}}}
-
v1.4.0-RC2
September 23, 2020 -
v1.4.0-RC1 Changes
September 08, 2020 -
v1.4.0-M2
September 08, 2020 -
v1.4.0-M1 Changes
June 23, 2020π Fixes with compatibility implications
- π Makes JAR file creation repeatable by sorting entry by name and dropping timestamps #5344/io#279 by @raboof
- π Loads bare settings in the alphabetic order of the build files #2697/#5447 by @eed3si9n
- π Loads
val
s from top-to-bottom within a build file #2232/#5448 by @eed3si9n - HTTP resolvers require explicit opt-in using
.withAllowInsecureProtocol(true)
#5593 by @eed3si9n
π Build server protocol (BSP) support
π sbt 1.4.0 adds build server protocol (BSP) support, contributed by Scala Center. Main implementation was done by Adrien Piquerez (@adpi2) based on @eed3si9n's prototype.
π When sbt 1.4.0 starts, it will create a file named
.bsp/sbt.json
containing a machine-readable instruction on how to runsbt -bsp
, which is a command line program that uses standard input and output to communicate to sbt server using build server protocol.How to import to IntelliJ using BSP
- Start sbt in a terminal
- Open IntelliJ IDEA 2020.1.2 or later
- Select "Open or import", and select "BSP Project"
How to import to VS Code + Metals
- Delete existing
.bsp
directory if any - Open VS Code in the working directory
- Ignore the prompt to import the project
- Start
sbt -Dsbt.semanticdb=true
in the Terminal tab. Wait till it displays "sbt server started" π 5. Navigate to Metals view, and select "Connect to build server" - Type
compile
into the sbt session to generate SemanticDB files
VirtualFile + RemoteCache
sbt 1.4.0 / Zinc 1.4.0 virtualizes the file paths tracked during incremental compilation. The benefit for this that the state of incremental compilation can shared across different machines, as long as
ThisBuild / rootPaths
are enumerated beforehand.To demonstrate this, we've also added experimental cached compilation feature to sbt. All you need is the following setting:
ThisBuild / pushRemoteCacheTo := Some(MavenCache("local-cache", file("/tmp/remote-cache")))
Then from machine 1, call
pushRemoteCache
. This will publish the*.class
and Zinc Analysis artifacts to the location. Next, from machine 2, callpullRemoteCache
.π Build linting
π On start up, sbt 1.4.0 checks for unused settings/tasks. Because most settings are on the intermediary to other settings/tasks, they are included into the linting by default. The notable exceptions are settings used exclusively by a command. To opt-out, you can either append it to
Global / excludeLintKeys
or set the rank to invisible.Conditional task
π sbt 1.4.0 adds support for conditional task (or Selective task), which is a new kind of task automatically created when
Def.task { ... }
consists of anif
-expression:bar := { if (number.value \< 0) negAction.value else if (number.value == 0) zeroAction.value else posAction.value }
π Unlike the regular (Applicative) task composition, conditional tasks delays the evaluation of then-clause and else-clause as naturally expected of an
if
-expression. This is already possible withDef.taskDyn { ... }
, but unlike dynamic tasks, conditional task works withinspect
command. See Selective functor for sbt for more details. #5558 by @eed3si9nβ‘οΈ Other updates
- Throws an error if you run sbt from
/
without-Dsbt.rootdir=true
#5112 by @eed3si9n - Upates
StateTransform
to acceptState => State
#5260 by @eatkins - π Fixes various issues around background run #5259 by @eatkins
- Turns off supershell when
TERM
is set to "dumb" #5278 by @hvesalai - π² Avoids using system temporary directories for logging #5289 by @eatkins
- β Adds library endpoint for
sbt.ForkMain
#5315 by @olafurpg - Avoids using last modified time of directories to invalidate
doc
#5362 by @eatkins - π Fixes the default artifact of packageSrc for custom configuration #5403 by @eed3si9n
- π Fixes task cancellation handling #5446/zinc#742 by @azolotko
- β Adds
toTaskable
method injection toInitialize[A]
for tuple syntax #5439 by @dwijnand - π Fixes the error message for an undefined setting #5469 by @nigredo-tori
- β‘οΈ Updates
semanticdbVersion
to 4.3.7 #5481 by @anilkumarmyla - β Adds
Tracked.outputChangedW
andTracked.inputChangedW
which requires typeclass evidence ofJsonWriter[A]
instead ofJsonFormat[A]
#5513 by @bjaglin - π Fixes various supershell interferences #5319 by @eatkins
- β Adds extension methods to
State
to faciliate sbt server communication #5207 by @eed3si9n - β Adds support for weighed tags for
testGrouping
#5527 by @frosforever - β‘οΈ Updates to sjson-new, which shades Jawn 1.0.0 #5595 by @eed3si9n
- π Fixes NullPointerError when credential realm is
null
#5526 by @3rwww1 - β Adds
Def.promise
for long-running tasks to communicate to another task #5552 by @eed3si9n - π Uses Java's timestamp on JDK 10+ as opposed to using native call io#274 by @slandelle
- π Improves failure message for PUT lm#309 by @swaldman
- β Adds provenance to AnalyzedClass zinc#786 by @dwijnand + @mspnf
- π Makes hashing childrenOfSealedClass stable zinc#788 by @dwijnand
- π Fixes performance regressions around build source monitoring #5530 by @eatkins
- π Fixes performance regressions around super shell #5531 by @eatkins
- π Various performance improvements in Zinc zinc#756/zinc#763 by @retronym
Participation
sbt 1.4.0-M1 was brought to you by 25 contributors. Eugene Yokota (eed3si9n), Ethan Atkins, Adrien Piquerez, Dale Wijnand, Jason Zaugg, Arnout Engelen, Guillaume Martres, Anil Kumar Myla, Brice Jaglin, Steve Waldman, frosforever, Alex Zolotko, Heikki Vesalainen, Stephane Landelle, Jannik TheiΓ, JoΓ£o Ferreira, lloydmeta, Alexandre Archambault, Erwan Queffelec, Ismael Juma, Kenji Yoshida (xuwei-k), Olafur Pall Geirsson, Renato Cavalcanti, Vincent PERICART, nigredo-tori. Thanks!
π 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.
Appendix
β To test sbt server manually, make sure to have an sbt session running, and start
sbt -bsp
in another termnial. And paste the following in:{ "jsonrpc": "2.0", "id": 1, "method": "build/initialize", "params": { "displayName": "foo", "version": "1.0.0", "bspVersion": "2.0.0-M5", "rootUri": "file:///tmp/hello", "capabilities": { "languageIds": ["scala"] } } }
Then enter
\r\n
(typeEnter
,Ctrl-J
for zsh). This should return:Content-Length: 200 Content-Type: application/vscode-jsonrpc; charset=utf-8 {"jsonrpc":"2.0","id":1,"result":{"displayName":"sbt","version":"1.4.0-SNAPSHOT","bspVersion":"2.0.0-M5","capabilities":{"compileProvider":{"languageIds":["scala"]},"dependencySourcesProvider":true}}}
-
v1.3.13 Changes
June 27, 2020π Fixes
- β‘οΈ Updates to Giter8 0.13.1 to fix
sbt new
on Windows - Works around incomplete preloaded local distribution, by turning it off for now #5587
- π Fixes
missingOk
under Coursier #5634/sbt-coursier#212 by @eed3si9n - π Fixes UNC paths handling in
Resolver.file(...)
lm#337 by @eed3si9n - π Fixes sbt.bat not working under a directory with whitespace name lp#324 by @l-konov
- π Fixes
-debug
not working inSBT_OPTS
lp#322 by @henricook - π Fixes Robocopy output in sbt.bat lp#325 by @er1c
- β‘οΈ Updates to Giter8 0.13.1 to fix