The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)

43
The state of sbt 0.13, sbt server, and sbt 1.0 Eugene Yokota (@eed3si9n) February, 2017

Transcript of The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)

The state of sbt 0.13, sbt server,

and sbt 1.0Eugene Yokota (@eed3si9n)

February, 2017

• Scala hobbyist since 2010

• ScalaMatsuri

• “learning Scalaz” / “herding Cats”

• scalaxb (XML data binding)

• treehugger.scala

• sbt-assembly, sbt-buildinfo, etc

• Lightbend/Typesafe since 2014

• tech lead of Tooling team / sbt

who is this guy (@eed3si9n)?

ScalaMatsuri では CFP の翻訳や字幕を付けたりなど Lightbend社でツール関係、sbt のメンテをやっています

• sbt server • sbt 0.13.x tech previews • sbt 1.0.x

Overview of this talk

概要: sbt server、0.13 テックプレビュー、sbt 1.0.x

sbt server

• See http://eed3si9n.com/sbt-server-reboot

sbt server reboot

「sbt server リブート」を参照

• single JVM process • implemented as a command, sort of • JSON API to drive sbt from network

what is sbt server?

コマンドとして実装されている sbt をネットワーク経由で駆動するための JSON API

• IDE integration • Distributed build

example usages

期待されている用例: IDE との統合、分散ビルドなど

sbt main loop

現在のメインループの流れ shell というコマンドがユーザからコマンドを受け取る

shell prompts the user

server command

server というコマンドはほぼ同じ働きをする

server prompts the user, and listens to network

telnet

{ "type": "ExecCommand", "commandLine": "compile" }...

thin client

server というコマンドはほぼ同じ働きをする

$ sbt client localhost:5000> compile

input/output of common tasks

各種タスクの出入力 compile タスクの入力はソース、出力はファイルと画面表示

compile task

input/output of common tasks

test タスクの入力はソース、出力は画面表示

test task

input/output of common tasks

タスクの出力は、実質ディスクと画面への副作用

• Outputs are side effects to disk and screen

event logging

イベント・ロギング: オブジェクトを使ったログ JSON として転送される

• A way to log object (semantic logging) • Logs are then relayed as JSON • Decoupled from screens

sbt 0.13.x tech previews

sbt 0.13.x tech previews

sbt 0.13.5 以降

• sbt 0.13.5 and onwards

sbt 0.13.5 (May 2014)

AutoPlugin の導入

• Introduction of AutoPlugin

sbt 0.13.6 (September 2014)

Name hashing のデフォルト化 Eviction warning などの依存性解決の改善

• Name hashing is enabled by default • HTTPS by default • Eviction warnings • Unresolved dependency error tree

sbt 0.13.7 (November 2014)

ナチュナルな空白文字処理 依存性解決のキャッシュ化

• Natural whitespace handling • Cached resolution (experimental)

sbt 0.13.8 (March 2015)

逐次タスク .settings(...) 内にセッティング列を直接書けるようになった

• Cross-version support for Scala sources • Sequential tasks • Seq[Setting[_]] can be used directly

in .settings(...) • Maven resolver (experimental)

sbt 0.13.9 (August 2015)

inThisBuild Maven 互換性の向上

• inThisBuild • Maven compatibility (read maven-metadata.xml)

sbt 0.13.11 (February 2016)

設定可能なコンパイラ・ブリッジ、Dotty サポート サブプロジェクト間の依存性レベル

• Configurable compiler bridge • Dotty support • Inter-project dependency tracking

sbt 0.13.12 (July 2016)

Build.scala の廃止勧告 scalaVersion のツールチェインへの強制

• Deprecates project/Build.scala • scalaVersion enforcement to toolchain

sbt 0.13.13 (October 2016)

new コマンド、人工サブプロジェクト sbt 0.12 DSL の廃止勧告

• sbt new command • Synthetic subprojects • Deprecate old sbt 0.12 DSL

(<<=,<+=,<++=)

sbt 0.13.14 (soon 2017)

Java 9 対策

• Java 9 compatibility • Other bug fixes

sbt 0.13 lesson learned

バイナリ互換はプラグイン環境には良いけど、メンテが難しい 諸行無常

• Binary compatibility is great for plugins • Binary compatibility is hard • Everything changes

sbt 1.0

less is more

binary compatibility (bincompat)

2年以上のバイナリ互換性を目標

• Goal: 2+ years of binary compatibility

removed feature

いらない機能は捨てる

• (Non-auto) sbt.Plugin • project/build.scala • 0.12 DSL operators (<<=, <+=, <++=) • Scala 2.9.x support

new feature

新しく入る機能は Zinc とサーバー

• Scala 2.12.x based • Zinc 1.x (class-based name hashing) • sbt server

modularization

• sbt • Zinc API • librarymanagement API • IO API

Zinc API

• Unified API to drive Scala compiler • Lightbend, Scala Center, VirtusLab, Twitter

engineers

librarymanagement API

• Abstraction of dependency management free of Ivy.

meta-tooling

• Making tools to make the tool • Contraband • sjson-new • Gigahorse

• Giter8

impact to build users

ビルド・ユーザへの影響: 短期的には移植のコスト 差分コンパイルの高速化、長期的にツール環境の向上

• Some migration required • Faster incremental compilation • Hopefully improved tooling in the longterm

impact to plugin authors

プラグイン作者への影響 JSON 互換性を考慮する必要がある

• JSON compatibility

todo

プラグイン・エコシステム、コミュニティー・ビルドなど sbt 1.0 の検証作業が課題

• Validate using plugin ecosystem • Validate using community build

Questions?

ありがとうございます

meta-tooling

第4回Reactive System Meetup in 西新宿 JSON ライブラリの歴史、マイクロサービス、およびスキーマの進化について

• 第4回Reactive System Meetup in 西新宿

• Monday, February 28th