Release note for sbt 1.0.0-M5

Ref #3063
This commit is contained in:
Eugene Yokota 2017-04-19 16:02:13 -04:00
parent cc541210dc
commit c6e8cc2e04
18 changed files with 96 additions and 191 deletions

View File

@ -1,24 +0,0 @@
Migration notes
===============
- Build definition is based on Scala 2.12.1
- Build.scala style builds are gone. Use multi-project `build.sbt`.
- `Project(...)` constructor is restricted down to two parameters. Use `project` instead.
- `sbt.Plugin` is also gone. Use auto plugins.
- The incremental compiler, called Zinc, uses class-based name hashing.
- Zinc drops support for Scala 2.8.x, 2.9.x., 2.11.1 and below.
- Removed the pre-0.13.7 *.sbt file parser (previously available under `-Dsbt.parser.simple=true`)
- Removed old, hyphen-separated key names (use `publishLocal` instead of `publish-local`)
- Removes no-longer-documented old operators `<<=`, `<+=`, and `<++=`.
- Renames early command feature from `--<command>` to `early(<command>)`.
- Log options `-error`, `-warn`, `-info`, `-debug` are added as shorthand for `"early(error)"` etc.
- `sbt.Process` and `sbt.ProcessExtra` are gone. Use `scala.sys.process` instead.
- `incOptions.value.withNameHashing(...)` option is removed.
- `TestResult.Value` is now `TestResult`.
- the scripted plugin is cross-versioned now, so you must use %% when depending on it
- Removed the methods settingsSets from Project (along with add/setSbtFiles)
- Dropped deprecated InputTask apply method and inputTask DSL method - replace with `Def.inputTask` & `Def.spaceDelimited().parsed`
- Dropped deprecated ProjectReference implicit lifts - replace with `RootProject(<uri>)`, `RootProject(<file>)` or `LocalProject(<string>)`
- Dropped deprecated seq DSL method - replace with `Seq` or just enumerate without wrapping
- Dropped deprecated File/Seq[File] setting enrichments - replace with `.value` and `Def.setting`
- Dropped deprecated SubProcess apply overload - replace with `SubProcess(ForkOptions(runJVMOptions = ..))`

View File

@ -1,8 +0,0 @@
### Bug fixes
- Fixes forked test succeeding when the test harness fails. [#2442][2442]/[#2730][2730] by [@eed3si9n][@eed3si9n]/[@dwijnand][@dwijnand}
[2442]: https://github.com/sbt/sbt/issues/2442
[2730]: https://github.com/sbt/sbt/pull/2730
[@eed3si9n]: https://github.com/eed3si9n
[@dwijnand]: https://github.com/dwijnand

View File

@ -1,14 +0,0 @@
### new command and templateResolvers
sbt 0.13.13 adds `new` command, which helps create a new build definition.
The `new` command is extensible via a mechanism called the template resolver,
which evaluates the arguments passed to the command to find and run a template.
As a reference implementation [Giter8][g8] is provided as follows:
sbt new eed3si9n/hello.g8
This will run eed3si9n/hello.g8 using Giter8.
[@eed3si9n]: https://github.com/eed3si9n
[g8]: http://www.foundweekends.org/giter8/

View File

@ -1,9 +0,0 @@
### Bug fixes
- Fixes regressions in sbt 0.13.11 - 0.13.13 that processed build-level keys incorrectly. [#2851][2851]/[#2460][2460] by [@eed3si9n]
[#2851]: https://github.com/sbt/sbt/issues/2851
[#2460]: https://github.com/sbt/sbt/issues/2460
[@eed3si9n]: https://github.com/eed3si9n
[@dwijnand]: https://github.com/dwijnand
[@Duhemm]: https://github.com/Duhemm

View File

@ -1,11 +0,0 @@
### Improvements
- When sbt detects that the project is compiled with dotty, it now automatically
set `scalaCompilerBridgeSource` correctly, this reduces the boilerplate needed
to make a dotty project. Note that dotty support in sbt is still considered
experimental and not officially supported, see [dotty.epfl.ch][dotty] for
more information. [#2902][2902] by [@smarter][@smarter]
[dotty]: http://dotty.epfl.ch/
[2902]: https://github.com/sbt/sbt/pull/2902
[@smarter]: https://github.com/smarter

View File

@ -1,7 +0,0 @@
### Improvements
- XML generated by JUnitXmlTestsListener now correctly flags ignored, skipped and pending tests. [#2854][2854]/[#2198][2198] by [@ashleymercer][@ashleymercer]
[2854]: https://github.com/sbt/sbt/pull/2854
[2198]: https://github.com/sbt/sbt/issues/2198
[@ashleymercer]: https://github.com/ashleymercer

View File

@ -1,12 +0,0 @@
### Improvements
- ScriptedPlugin: Add the ability to paginate scripted tests.
It is now possible to run a subset of scripted tests in a directory at once,
for example:
```
scripted source-dependencies/*1of3
```
Will create three pages and run page 1. This is especially useful when running
scripted tests on a CI, to benefit from the available parallelism.
[3013]: https://github.com/sbt/sbt/pull/3013
[@smarter]: https://github.com/smarter

View File

@ -1,7 +0,0 @@
### Improvements
- Notifies & enables users to stay in sbt's shell on the warm JVM by hitting \[ENTER\] while sbt is running. [#2987][]/[#2996][] by [@dwijnand][]
[#2987]: https://github.com/sbt/sbt/issues/2987
[#2996]: https://github.com/sbt/sbt/pull/2996
[@dwijnand]: https://github.com/dwijnand

View File

@ -1,51 +0,0 @@
[@eed3si9n]: https://github.com/eed3si9n
[@gkossakowski]: https://github.com/gkossakowski
[@dwijnand]: http://github.com/dwijnand
[@Duhemm]: https://github.com/Duhemm
[@jsuereth]: https://github.com/jsuereth
[86]: https://github.com/sbt/zinc/pull/86
[2577]: https://github.com/sbt/sbt/pull/2577
[2575]: https://github.com/sbt/sbt/pull/2575
[2543]: https://github.com/sbt/sbt/pull/2543
[2524]: https://github.com/sbt/sbt/pull/2524
This is the first milestone (beta) release of sbt 1.0.
There's no binary compatibility with sbt 0.13 or other future versions.
The biggest change in sbt 1.0 from 0.13 is internal code reorganization to modules
(io, util, librarymanagement, zinc, and sbt), but hopefully this shouldn't affect you much.
In addition, classes and objects related to internal implementations are moved to `sbt.internal`.
This package indicates that we won't keep binary compatibility for them.
Here are some more relevant changes:
- Build definition is based on Scala 2.11.8 [#2577][2577]
- Build.scala style builds are gone. Use multi-project `build.sbt`. [#2524][2524]
- `Project(...)` constructor is restricted down to two parameters. Use `project` instead. [#2543][2543]
- `sbt.Plugin` is also gone. Use auto plugins. [#2575][2575]
- The incremental compiler, called Zinc, uses class-based name hashing. [zinc#86][86] by [@gkossakowski][@gkossakowski]
- Zinc drops support for Scala 2.8.x and 2.9.x.
### Additional import required
Implicit conversions are moved to `sbt.syntax`. Add the following imports to auto plugins
or `project/*.scala`.
import sbt._, syntax._, Keys._
### Travis CI instruction
Travis CI uses unofficial sbt-extra launcher, so you might need to do the following to use 1.0.0-M4:
language: scala
scala:
- 2.11.8
before_install:
- mkdir launcher
- curl https://repo1.maven.org/maven2/org/scala-sbt/launcher/1.0.0/launcher-1.0.0.jar > launcher/sbt-launch.jar
- curl https://raw.githubusercontent.com/sbt/sbt/v1.0.0-M4/src/main/conscript/xsbt/launchconfig > launcher/launchconfig
script:
- java -Xms2048M -Xmx2048M -Xss6M -XX:MaxPermSize=512M -jar launcher/sbt-launch.jar @launcher/launchconfig ++$TRAVIS_SCALA_VERSION test

95
notes/1.0.0.markdown Normal file
View File

@ -0,0 +1,95 @@
See [sbt 1.0 roadmap and beta-1][sbt-1-0-roadmap] for scheduled timeline.
### sbt 1.0.0-M5
This is the beta-1 release of sbt 1.0.
There's no binary compatibility with sbt 0.13 or other future 1.0.0-Mx versions.
#### Features, fixes, changes with compatibility implications
We are working with Scala Center to provide [an automatic migration tool][sbt-migration-rewrites].
- sbt 1.0 uses Scala 2.12 for build definitions and plugins. This also requires JDK 8.
- Non-auto `sbt.Plugin` trait is dropped. Please migrate to AutoPlugin. Auto plugins are easier to configure, and work better with each other.
- sbt 0.12 style `Build` trait that was deprecated in sbt 0.13.12, is removed. Please [migrate to build.sbt](http://www.scala-sbt.org/0.13/docs/Migrating-from-sbt-012x.html#Migrating+from+the+Build+trait). Auto plugins and `Build` trait do not work well together, and its feature is now largely subsumed by multi-project build.sbt.
- sbt 0.12 style `Project(...)` constructor is restricted down to two parameters. This is because `settings` parameter does not work well with Auto Plugins. Use `project` instead.
- sbt 0.12 style key dependency operators `<<=`, `<+=`, `<++=` are removed. Please [migrate to :=, +=, and ++=](http://www.scala-sbt.org/0.13/docs/Migrating-from-sbt-012x.html#Migrating+simple+expressions). These operators have been sources of confusion for many users, and have long been removed from 0.13 docs, and have been formally deprecated since sbt 0.13.13.
- Zinc 1 drops support for Scala 2.9 and earlier. Scala 2.10 must use 2.10.2 and above. Scala 2.11 must use 2.11.2 and above. (latest patch releases are recommended)
- Many of the case classes are replaced with pseudo case classes generated using Contraband. Migrate `.copy(foo = xxx)` to `withFoo(xxx)`.
- Changes `publishTo` and `otherResolvers` from SettingKeys to TaskKeys. [#2059][2059]/[#2662][2662] by [@dwijnand][@dwijnand]
- Drops sbt 0.12 style hyphen-separated key names (use `publishLocal` instead of `publish-local`).
- Renames early command feature from `--<command>` to `early(<command>)`.
- Log options `-error`, `-warn`, `-info`, `-debug` are added as shorthand for `"early(error)"` etc.
- `sbt.Process` and `sbt.ProcessExtra` are dropped. Use `scala.sys.process` instead.
- `incOptions.value.withNameHashing(...)` option is removed because name hashing is always on.
- `TestResult.Value` is now called `TestResult`.
- The scripted plugin is cross-versioned now, so you must use `%%` when depending on it
- Removes the `settingsSets` method from `Project` (along with `add/setSbtFiles`).
- Drops deprecated `InputTask` `apply` method and `inputTask` DSL method. Use `Def.inputTask` and `Def.spaceDelimited().parsed`.
- Drops deprecated `ProjectReference` implicit lifts. Use `RootProject(<uri>)`, `RootProject(<file>)` or `LocalProject(<string>)`.
- Drops deprecated `seq(..)` DSL method. Use `Seq` or pass in the settings without wrapping.
- Drops deprecated `File`/`Seq[File]` setting enrichments. Use `.value` and `Def.setting`.
- Drops deprecated `SubProcess` `apply` overload. Use `SubProcess(ForkOptions(runJVMOptions = ..))`.
#### Features
- New incremental compiler called Zinc 1. Details below.
- The interactive shell is adds network API. Details below.
#### Fixes
#### Improvements
- The startup log level is dropped to `-error` in script mode using `scalas`. [#840][840] by [@eed3si9n][@eed3si9n]
- Replace cross building support with sbt-doge. This allows builds with projects that have multiple different combinations of cross scala versions to be cross built correctly. The behaviour of ++ is changed so that it only updates the Scala version of projects that support that Scala version, but the Scala version can be post fixed with ! to force it to change for all projects. A -v argument has been added that prints verbose information about which projects are having their settings changed along with their cross scala versions. [#2613][2613] by [@jroper][@jroper]
- `ivyLoggingLevel` is dropped to `UpdateLogging.Quiet` when CI environment is detected. [@eed3si9n][@eed3si9n]
- Add logging of the name of the different `build.sbt` (matching `*.sbt`) files used. [#1911][1911] by [@valydia][@valydia]
- Add the ability to call `aggregate` for the current project inside a build sbt file. By [@xuwei-k][@xuwei-k]
- Add new global setting `asciiGraphWidth` that controls the maximum width of the ASCII graphs printed by commands like `inspect tree`. Default value corresponds to the previously hardcoded value of 40 characters. By [@RomanIakovlev][@RomanIakovlev].
### Details of major changes
### Zinc 1: Class-based name hashing
A major improvement brought into Zinc 1.0 by Grzegorz Kossakowski (commissioned by Lightbend) is class-based name hashing, which will speed up the incremental compilation of Scala in large projects.
Zinc 1.0's name hashing tracks your code dependendencies at the class level, instead of at the source file level. The GitHub issue [sbt/sbt#1104](https://github.com/sbt/sbt/issues/1104) lists some comparisons of adding a method to an existing class in some projects:
```
ScalaTest AndHaveWord class: Before 49s, After 4s (12x)
Specs2 OptionResultMatcher class: Before 48s, After 1s (48x)
scala/scala Platform class: Before 59s, After 15s (3.9x)
scala/scala MatchCodeGen class: Before 48s, After 17s (2.8x)
```
This depends on some factors such as how your classes are organized, but you can see 3x ~ 40x improvements. The reason for the speedup is because it compiles fewer source files than before by untangling the classes from source files. In the example adding a method to scala/scala's Platform class, sbt 0.13's name hashing used to compile 72 sources, but the new Zinc compiles 6 sources.
### sbt server: JSON API for tooling integration
sbt 1.0 includes server feature, which allows IDEs and other tools to query the build for settings, and invoke commands via a JSON API. Similar to the way that the interactive shell in sbt 0.13 is implemented with `shell` command, "server" is also just `shell` command that listens to both human input and network input. As a user, there should be minimal impact because of the server.
In March 2016, we [rebooted](http://eed3si9n.com/sbt-server-reboot) the "server" feature to make it as small as possible. We worked in collaboration with JetBrains' @jastice who works on IntelliJ's sbt interface to narrow down the feature list. sbt 1.0 will not have all the things we originally wanted, but in the long term, we hope to see better integration between IDE and sbt ecosystem using this system. For example, IDEs will be able to issue the compile task and retrieve compiler warning as JSON events:
```
{"type":"xsbti.Problem","message":{"category":"","severity":"Warn","message":"a pure expression does nothing in statement position; you may be omitting necessary parentheses","position":{"line":2,"lineContent":" 1","offset":29,"pointer":2,"pointerSpace":" ","sourcePath":"/tmp/hello/Hello.scala","sourceFile":"file:/tmp/hello/Hello.scala"}},"level":"warn"}
```
Another related feature that was added is the `bgRun` task which, for example, enables a server process to be run in the background while you run tests against it.
[@eed3si9n]: https://github.com/eed3si9n
[@gkossakowski]: https://github.com/gkossakowski
[@dwijnand]: http://github.com/dwijnand
[@Duhemm]: https://github.com/Duhemm
[@jsuereth]: https://github.com/jsuereth
[sbt-1-0-roadmap]: http://developer.lightbend.com/blog/2017-04-18-sbt-1-0-roadmap-and-beta1/
[@eed3si9n]: https://github.com/eed3si9n
[@jroper]: https://github.com/jroper
[@valydia]: https://github.com/valydia
[@RomanIakovlev]: https://github.com/RomanIakovlev
[840]: https://github.com/sbt/sbt/issues/840
[2613]: https://github.com/sbt/sbt/pull/2613
[1911]: https://github.com/sbt/sbt/issues/1911
[2059]: https://github.com/sbt/sbt/issues/2059
[2662]: https://github.com/sbt/sbt/pull/2662

View File

@ -1,5 +0,0 @@
[@xuwei-k]: https://github.com/xuwei-k
### Improvements
- Add the ability to call aggregate for the current project inside a build sbt file. By [@xuwei-k][@xuwei-k]

View File

@ -1,9 +0,0 @@
[@RomanIakovlev]: https://github.com/RomanIakovlev
### Fixes with compatibility implications
### Improvements
Add new global setting `asciiGraphWidth` that controls the maximum width of the ASCII graphs printed by commands like `inspect tree`. Default value corresponds to the previously hardcoded value of 40 characters. By [@RomanIakovlev][@RomanIakovlev].
### Bug fixes

View File

@ -1,6 +0,0 @@
### Improvements
- Add logging of the name of the different `build.sbt` (matching `*.sbt`) files used. [#1911][1911] by [@valydia][@valydia]
[@valydia]: https://github.com/valydia
[1911]: https://github.com/sbt/sbt/issues/1911

View File

@ -1,5 +0,0 @@
### Improvements
- `ivyLoggingLevel` is dropped to `UpdateLogging.Quiet` when CI environment is detected. [@eed3si9n][@eed3si9n]
[@eed3si9n]: https://github.com/eed3si9n

View File

@ -7,6 +7,6 @@
### Improvements
- Changes publishTo & otherResolvers from SettingKey's to TaskKey's. [#2059][2059]/[#2662][2662] by [@dwijnand][@dwijnand]
- Changes `publishTo` and `otherResolvers` from SettingKeys to TaskKeys. [#2059][2059]/[#2662][2662] by [@dwijnand][@dwijnand]
### Bug fixes

View File

@ -1,10 +0,0 @@
[@jroper]: https://github.com/jroper
[2613]: https://github.com/sbt/sbt/pull/2613
### Fixes with compatibility implications
### Improvements
- Replace cross building support with sbt-doge. This allows builds with projects that have multiple different combinations of cross scala versions to be cross built correctly. The behaviour of ++ is changed so that it only updates the Scala version of projects that support that Scala version, but the Scala version can be post fixed with ! to force it to change for all projects. A -v argument has been added that prints verbose information about which projects are having their settings changed along with their cross scala versions. [#2613][2613] by [@jroper][@jroper].
### Bug fixes

View File

@ -1,6 +0,0 @@
### Bug fixes
- Fixes scripted mode ignores quotation. [#2551][2551] by [@ekrich][@ekrich]
[2551]: https://github.com/sbt/sbt/issues/2551
[@ekrich]: https://github.com/ekrich

View File

@ -1,6 +0,0 @@
### Improvements
- The startup log level is dropped to `-error` in script mode using `scalas`. [#840][840] by [@eed3si9n][@eed3si9n]
[@eed3si9n]: https://github.com/eed3si9n
[840]: https://github.com/sbt/sbt/issues/840