Releases: sbt/sbt
1.4.0-RC2
1.4.0-RC1
1.4.0-M2
1.3.13
Fixes
- Updates to Giter8 0.13.1 to fix
sbt newon Windows - Works around incomplete preloaded local distribution, by turning it off for now #5587
- Fixes
missingOkunder 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
-debugnot working inSBT_OPTSlp#322 by @henricook - Fixes Robocopy output in sbt.bat lp#325 by @er1c
1.4.0-M1
Fixes with compatibility implications
- Makes JAR file creation repeatable by sorting entry by name and dropping timestamps #5344/[io#279][io279] by [@raboof][@raboof]
- Loads bare settings in the alphabetic order of the build files #2697/#5447 by [@eed3si9n][@eed3si9n]
- Loads
vals from top-to-bottom within a build file #2232/#5448 by [@eed3si9n][@eed3si9n] - HTTP resolvers require explicit opt-in using
.withAllowInsecureProtocol(true)#5593 by [@eed3si9n][@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 run sbt -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
.bspdirectory if any - Open VS Code in the working directory
- Ignore the prompt to import the project
- Start
sbt -Dsbt.semanticdb=truein the Terminal tab. Wait till it displays "sbt server started" - Navigate to Metals view, and select "Connect to build server"
- Type
compileinto the sbt session to generate SemanticDB files
#5538/#5443 by [@adpi2][@adpi2]
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, call pullRemoteCache.
[zinc#712][zinc712]/#5417 by [@eed3si9n][@eed3si9n]
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.
#5153 by [@eed3si9n][@eed3si9n]
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 an if-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 with Def.taskDyn { ... }, but unlike dynamic tasks, conditional task works with inspect command. See Selective functor for sbt for more details. #5558 by [@eed3si9n][@eed3si9n]
Other updates
- Throws an error if you run sbt from
/without-Dsbt.rootdir=true#5112 by [@eed3si9n][@eed3si9n] - Upates
StateTransformto acceptState => State#5260 by [@eatkins][@eatkins] - Fixes various issues around background run #5259 by [@eatkins][@eatkins]
- Turns off supershell when
TERMis set to "dumb" #5278 by [@hvesalai][@hvesalai] - Avoids using system temporary directories for logging #5289 by [@eatkins][@eatkins]
- Adds library endpoint for
sbt.ForkMain#5315 by [@olafurpg][@olafurpg] - Avoids using last modified time of directories to invalidate
doc#5362 by [@eatkins][@eatkins] - Fixes the default artifact of packageSrc for custom configuration #5403 by [@eed3si9n][@eed3si9n]
- Fixes task cancellation handling #5446/[zinc#742][zinc742] by [@azolotko][@azolotko]
- Adds
toTaskablemethod injection toInitialize[A]for tuple syntax #5439 by [@dwijnand][@dwijnand] - Fixes the error message for an undefined setting #5469 by [@nigredo-tori][@nigredo-tori]
- Updates
semanticdbVersionto 4.3.7 #5481 by [@anilkumarmyla][@anilkumarmyla] - Adds
Tracked.outputChangedWandTracked.inputChangedWwhich requires typeclass evidence ofJsonWriter[A]instead ofJsonFormat[A]#5513 by [@bjaglin][@bjaglin] - Fixes various supershell interferences #5319 by [@eatkins][@eatkins]
- Adds extension methods to
Stateto faciliate sbt server communication #5207 by [@eed3si9n][@eed3si9n] - Adds support for weighed tags for
testGrouping#5527 by [@frosforever][@frosforever] - Updates to sjson-new, which shades Jawn 1.0.0 #5595 by [@eed3si9n][@eed3si9n]
- Fixes NullPointerError when credential realm is
null#5526 by [@3rwww1][@3rwww1] - Adds
Def.promisefor long-running tasks to communicate to another task #5552 by [@eed3si9n][@eed3si9n] - Uses Java's timestamp on JDK 10+ as opposed to using native call io#274 by [@slandelle][@slandelle]
- Improves failure message for PUT [lm#309][lm309] by [@swaldman][@swaldman]
- Adds provenance to AnalyzedClass [zinc#786][zinc786] by [@dwijnand][@dwijnand] + [@mspnf][@mspnf]
- Makes hashing childrenOfSealedClass stable [zinc#788][zinc788] by [@dwijnand][@dwijnand]
- Fixes performance regressions around build source monitoring #5530 by [@eatkins][@eatkins]
- Fixes performance regressions around super shell #5531 by [@eatkins][@eatkins]
- Various performance improvements in Zinc [zinc#756][zinc756]/[zinc#763][zinc763] by [@retronym][@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 (type Enter, 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}}}
1.3.12
change since 1.3.11
There was a regression in sbt 1.3.11 around the handling of repositories file. sbt 1.3.12 fixes it. #5583
lm-coursier 2.0.0-RC6-4
sbt 1.3.11 updates lm-coursier to 2.0.0-RC6-4, which deprecates $HOME/.coursier/cache directory in favor of OS specific cache locations:
$HOME/Library/Caches/Coursier/v1for macOS%LOCALAPPDATA%\Coursier\Cache\v1for Windows$HOME/.cache/coursier/v1for Linux etc
other fixes
- Updates Apache Ivy to handle HTTP redirects ivy#39 / #5059 by @itviewer
- Updates sbt-giter8-resolver to 0.12.0, which brings in
giter8.versionsupport inproject/build.properties#5537 by @drocsid - Fixes cross building
+task #5512 / #5497 by @eed3si9n - Fixes
ServiceLoaderhandling in layered ClassLoader #5540 by @bjaglin - Fixes
NullPointerException#5563 by @dwijnand - Avoids duplicated
TypeFunctions.const(())Strings to reduce memory footprint #5535 by @retronym - Adds support for
allowInsecureProtocolflag inrepositoriesfile to opt into using HTTP. Note: This requiressbt+ launcher to be updated to the latest. launcher#75 by @eed3si9n - Displays welcome banner with sbt version and Java version #5580 by @eed3si9n
1.3.11
1.3.10
1.3.9
Fixes
- Updates to lm-coursier-shaded 2.0.0-RC6-2
- Updates to JNA 5.5.0
- Fixes concurrency issue in Zinc zinc#740 by @pnf
- Fixes classpath ordering when Coursier is used #5421 / #5282 by @dwijnand
- Fixes consoleProject #5251 by @steinybot
- Fixes for
JUnitXmlTestsListenerremoving part of test name when it contains a dot #5139 / #2949 by @margussipria - Fixes
--jvm-debugoption not working on Windows lp#321 by @XenonAbe
1.3.8
Fixes
- Fixes Coursier resolvers so the project resolvers come first #5413 by @raboof
- Fixes intermittent
NullPointerExceptioninsbt.internal.inc.binary.BinaryAnalysisFormat.writeAPIscaused by a race condition zinc#731 by @hvesalai - Work around Scaladoc range position bug zinc#735 by @eed3si9n
- Fixes "AssertionError: assertion failed: Expected protocol to be 'file' or empty in URI jar:file..." #4305 by @lloydmeta
- Fixes "CreateFile() failed with error 123" on Windows io#283 by @eatkins
- Fixes
Path.allSubpathsso that the given path is no longer included in the return value io#285 by @eatkins