sbt/notes/1.1.0.markdown

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

191 lines
10 KiB
Markdown
Raw Permalink Normal View History

2018-01-05 20:06:30 +01:00
### Changes since RC-2
- Provides workaround for `File#lastModified()` losing millisecond-precision by using native code when possible. [io#92](https://github.com/sbt/io/pull/92)/[io#106](https://github.com/sbt/io/pull/106) by [@cunei][@cunei]
- Fixes `IO.relativize` not working with relative path. [io#108](https://github.com/sbt/io/pull/108) by [@dwijnand][@dwijnand]
- Fixes `ClasspathFilter` that was causing `Class.forName` to not work in `run`. [zinc#473](https://github.com/sbt/zinc/pull/473) / [#3736](https://github.com/sbt/sbt/issues/3736) / [#3733](https://github.com/sbt/sbt/issues/3733) / [#3647](https://github.com/sbt/sbt/issues/3647) / [#3608](https://github.com/sbt/sbt/issues/3608) by [@ravwojdyla][@ravwojdyla]
- Fixes JNA version mixup. [#3837](https://github.com/sbt/sbt/pull/3837) by [@eed3si9n][@eed3si9n]
- Fixes warning message when multiple instances are detected. [#3828](https://github.com/sbt/sbt/pull/3828) by [@eed3si9n][@eed3si9n]
2017-12-17 01:14:59 +01:00
### Changes since RC-1
- Fixes Java compilation causing `NullPointerException` by making PositionImpl thread-safe. [zinc#465](https://github.com/sbt/zinc/pull/465) by [@eed3si9n][@eed3si9n]
2018-01-05 20:06:30 +01:00
- Restores Scala 2.13.0-M1 support. #461 by [@dwijnand][@dwijnand]
2017-12-17 01:14:59 +01:00
- Fixes `PollingWatchService` by preventing concurrent modification of `keysWithEvents` map. [io#90](https://github.com/sbt/io/pull/90) by [@mechkg][@mechkg], which fixes `~` related issues [#3687](https://github.com/sbt/sbt/issues/3687), [#3695](https://github.com/sbt/sbt/issues/3695), and [#3775](https://github.com/sbt/sbt/issues/3775).
- Fixed server spewing out debug level logs. [#3791](https://github.com/sbt/sbt/pull/3791) by [@eed3si9n][@eed3si9n]
- Fixes the encoding of Unix-like file path to use `file:///`. [#3805](https://github.com/sbt/sbt/pull/3805) by [@eed3si9n][@eed3si9n]
- Fixes Log4J2 initialization error during startup. [#3814](https://github.com/sbt/sbt/pull/3814) by [@dwijnand][@dwijnand]
2017-11-30 05:45:28 +01:00
### Features, fixes, changes with compatibility implications
- sbt server feature is reworked in sbt 1.1.0. See below.
- Changes `version` setting default to `0.1.0-SNAPSHOT` for compatibility with Semantic Versioning. [#3577][3577] by [@laughedelic][@laughedelic]
### Features
- Unifies sbt shell and build.sbt syntax. See below.
### Fixes
2017-11-30 06:01:33 +01:00
- Fixes over-compilation bug with Java 9. [zinc#450][zinc450] by [@retronym][@retronym]
- Fixes handling of deeply nested Java classes. [zinc#423][zinc423] by [@romanowski][@romanowski]
- Fixes JavaDoc not printing all errors. [zinc#415][zinc415] by [@raboof][@raboof]
- Preserves JAR order in `ScalaInstance.otherJars`. [zinc#411][zinc411] by [@dwijnand][@dwijnand]
- Fixes used name when it contains NL. [zinc#449][zinc449] by [@jilen][@jilen]
2017-11-30 05:45:28 +01:00
- Fixes handling of `ThisProject`. [#3609][3609] by [@dwijnand][@dwijnand]
Spelling (#8028) * spelling: 1.x Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: a Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: aether Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: anymore Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: artifact Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: available Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: be Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: bridge Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: cannot Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: case-insensitive Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: checksum Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: class loads Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: contra Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: dependencies Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: dependency Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: dependent Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: deriveds Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: describes Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: early Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: enclosed Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: evaluation Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: excluding Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: execution Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: for Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: frequently Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: github Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: green Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: https://www Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: https Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: in-sourcing Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: include Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: incompatible Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: indefinitely Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: information Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: inputted Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: just Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: lastmodifiedtimes Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: latest Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: manifest Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: miscellaneous Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: more Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: neither Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: never Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: nonexistent Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: opted Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: outputting Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: params Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: performance Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: preceding Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: presentation Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: project Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: projects Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: protocol Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: related Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: representation Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: res Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: resolverlist Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: resolverset Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: response Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: returned Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: sbt_version Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: scalacheck Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: sentinels Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: separates Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: serves Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: should Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: significant Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: specifically Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: substitute Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: suppress Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: terminal Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: the Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: title Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: transitive Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: version Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: versions Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: want Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: wanting Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: whether Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * link: sbt Cached Resolution Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * link: Testing sbt plugins Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --------- Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2025-02-04 07:11:28 +01:00
- Escapes imports from sbt files, so if user creates a backquoted definition then task evaluation will not fail. [#3635][3635] by [@panaeon][@panaeon]
2017-11-30 05:45:28 +01:00
- Removes reference to version 0.14.0 from a warning message. [#3693][3693] by [@saniyatech][@saniyatech]
- Fixes screpl throwing "Not a valid key: console-quick". [#3762][3762] by [@xuwei-k][@xuwei-k]
### Improvements
- Filters scripted tests based on optional `project/build.properties`. See below.
- Adds `Project#withId` to change a project's id. [#3601][3601] by [@dwijnand][@dwijnand]
- Adds `reboot dev` command, which deletes the current artifact from the boot directory. This is useful when working with development versions of sbt. [#3659][3659] by [@eed3si9n][@eed3si9n]
- Adds a check for a change in sbt version before `reload`. [#1055][1055]/[#3673][3673] by [@RomanIakovlev][@RomanIakovlev]
- Adds a new setting `insideCI`, which indicates that sbt is likely running in an Continuous Integration environment. [#3672][3672] by [@RomanIakovlev][@RomanIakovlev]
- Adds `nameOption` to `Command` trait. [#3671][3671] by [@miklos-martin][@miklos-martin]
2023-06-24 13:05:52 +02:00
- Adds POSIX permission operations in IO, such as `IO.chmod(..)`. [io#76][io76] by [@eed3si9n][@eed3si9n]
2017-11-30 06:01:33 +01:00
- Treat sbt 1 modules using Semantic Versioning in the eviction warning. [lm#188][lm188] by [@eed3si9n][@eed3si9n]
2017-11-30 05:45:28 +01:00
- Uses kind-projector in the code. [#3650][3650] by [@dwijnand][@dwijnand]
- Make `displayOnly` etc methods strict in `Completions`. [#3763][3763] by [@xuwei-k][@xuwei-k]
### Unified slash syntax for sbt shell and build.sbt
This adds unified slash syntax for both sbt shell and the build.sbt DSL.
Instead of the current `<project-id>/config:intask::key`, this adds
`<project-id>/<config-ident>/intask/key` where `<config-ident>` is the Scala identifier
notation for the configurations like `Compile` and `Test`. (The old shell syntax will continue to function)
These examples work both from the shell and in build.sbt.
Global / cancelable
ThisBuild / scalaVersion
Test / test
root / Compile / compile / scalacOptions
ProjectRef(uri("file:/xxx/helloworld/"),"root")/Compile/scalacOptions
Zero / Zero / name
The inspect command now outputs something that can be copy-pasted:
> inspect compile
[info] Task: sbt.inc.Analysis
[info] Description:
[info] Compiles sources.
[info] Provided by:
[info] ProjectRef(uri("file:/xxx/helloworld/"),"root")/Compile/compile
[info] Defined at:
[info] (sbt.Defaults) Defaults.scala:326
[info] Dependencies:
[info] Compile/manipulateBytecode
[info] Compile/incCompileSetup
....
[#1812][1812]/[#3434][3434]/[#3617][3617]/[#3620][3620] by [@eed3si9n][@eed3si9n] and [@dwijnand][@dwijnand]
### sbt server
sbt server feature was reworked to use Language Server Protocol 3.0 (LSP) as the wire protocol, a protocol created by Microsoft for Visual Studio Code.
To discover a running server, sbt 1.1.0 creates a port file at `./project/target/active.json` relative to a build:
```
{"uri":"local:///Users/foo/.sbt/1.0/server/0845deda85cb41abcdef/sock"}
```
`local:` indicates a UNIX domain socket. Here's how we can say hello to the server using `nc`. (`^M` can be sent `Ctrl-V` then `Return`):
```
$ nc -U /Users/foo/.sbt/1.0/server/0845deda85cb41abcdef/sock
Content-Length: 99^M
^M
{ "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "initializationOptions": { } } }^M
```
sbt server adds network access to sbt's shell command so, in addition to accepting input from the terminal, server also to accepts input from the network. Here's how we can call `compile`:
```
Content-Length: 93^M
^M
{ "jsonrpc": "2.0", "id": 2, "method": "sbt/exec", "params": { "commandLine": "compile" } }^M
```
The running sbt session should now queue `compile`, and return back with compiler warnings and errors, if any:
```
Content-Length: 296
Content-Type: application/vscode-jsonrpc; charset=utf-8
{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:/Users/foo/work/hellotest/Hello.scala","diagnostics":[{"range":{"start":{"line":2,"character":26},"end":{"line":2,"character":27}},"severity":1,"source":"sbt","message":"object X is not a member of package foo"}]}}
```
[#3524][3524]/[#3556][3556] by [@eed3si9n][@eed3si9n]
### VS Code extension
The primary use case we have in mind for the sbt server is tooling integration such as editors and IDEs. As a proof of concept, we created a Visual Studio Code extension called [Scala (sbt)][vscode-sbt-scala].
Currently this extension is able to:
- Run `compile` at the root project when `*.scala` files are saved. [#3524][3524] by [@eed3si9n][@eed3si9n]
- Display compiler errors.
- Display log messages. [#3740][3740] by [@laughedelic][@laughedelic]
2017-12-17 01:14:59 +01:00
- Jump to class definitions. [#3660][3660] by [@wpopielarski][@wpopielarski]
2017-11-30 05:45:28 +01:00
### Filtering scripted tests using `project/build.properties`
For all scripted tests in which `project/build.properties` exist, the value of the `sbt.version` property is read. If its binary version is different from `sbtBinaryVersion in pluginCrossBuild` the test will be skipped and a message indicating this will be logged.
This allows you to define scripted tests that track the minimum supported sbt versions, e.g. 0.13.9 and 1.0.0-RC2. [#3564][3564]/[#3566][3566] by [@jonas][@jonas]
[@eed3si9n]: https://github.com/eed3si9n
2019-09-05 20:11:04 +02:00
[@dwijnand]: https://github.com/dwijnand
2017-12-17 01:14:59 +01:00
[@cunei]: https://github.com/cunei
2017-11-30 05:45:28 +01:00
[@jvican]: https://github.com/jvican
[@Duhemm]: https://github.com/Duhemm
[@jonas]: https://github.com/jonas
[@laughedelic]: https://github.com/laughedelic
[@panaeon]: https://github.com/panaeon
[@RomanIakovlev]: https://github.com/RomanIakovlev
[@miklos-martin]: https://github.com/miklos-martin
[@saniyatech]: https://github.com/saniyatech
[@xuwei-k]: https://github.com/xuwei-k
[@wpopielarski]: https://github.com/wpopielarski
2017-11-30 06:01:33 +01:00
[@retronym]: https://github.com/retronym
[@romanowski]: https://github.com/romanowski
[@raboof]: https://github.com/raboof
[@jilen]: https://github.com/jilen
2017-12-17 01:14:59 +01:00
[@mechkg]: https://github.com/mechkg
2018-01-05 20:06:30 +01:00
[@ravwojdyla]: https://github.com/ravwojdyla
2017-11-30 05:45:28 +01:00
[vscode-sbt-scala]: https://marketplace.visualstudio.com/items?itemName=lightbend.vscode-sbt-scala
[1812]: https://github.com/sbt/sbt/issues/1812
[3524]: https://github.com/sbt/sbt/pull/3524
[3556]: https://github.com/sbt/sbt/pull/3556
[3564]: https://github.com/sbt/sbt/issues/3564
[3566]: https://github.com/sbt/sbt/pull/3566
[3577]: https://github.com/sbt/sbt/pull/3577
[3434]: https://github.com/sbt/sbt/pull/3434
[3601]: https://github.com/sbt/sbt/pull/3601
[3609]: https://github.com/sbt/sbt/pull/3609
[3617]: https://github.com/sbt/sbt/pull/3617
[3620]: https://github.com/sbt/sbt/pull/3620
[3464]: https://github.com/sbt/sbt/issues/3464
[3635]: https://github.com/sbt/sbt/pull/3635
[3659]: https://github.com/sbt/sbt/pull/3659
[3650]: https://github.com/sbt/sbt/pull/3650
[3673]: https://github.com/sbt/sbt/pull/3673
[1055]: https://github.com/sbt/sbt/issues/1055
[3672]: https://github.com/sbt/sbt/pull/3672
[3671]: https://github.com/sbt/sbt/pull/3671
[3693]: https://github.com/sbt/sbt/issues/3693
[3763]: https://github.com/sbt/sbt/pull/3763
[3762]: https://github.com/sbt/sbt/pull/3762
[3740]: https://github.com/sbt/sbt/pull/3740
[3660]: https://github.com/sbt/sbt/pull/3660
2017-11-30 06:01:33 +01:00
[io76]: https://github.com/sbt/io/pull/76
[lm188]: https://github.com/sbt/librarymanagement/pull/188
[zinc450]: https://github.com/sbt/zinc/pull/450
[zinc423]: https://github.com/sbt/zinc/pull/423
[zinc415]: https://github.com/sbt/zinc/issues/415
[zinc411]: https://github.com/sbt/zinc/pull/411
[zinc449]: https://github.com/sbt/zinc/pull/449