Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

sbt, past and future / sbt, 傾向と対策


Published on

Presentation material with Japanese subs, by Mr. Eugene Yokota at ScalaMatsuri 2014

Published in: Software
  • Be the first to comment

sbt, past and future / sbt, 傾向と対策

  1. 1. sbt, past and future eugene yokota (@eed3si9n, @eed3si9n_ja) sbt、傾向と対策
  2. 2. demo
  3. 3. sbt •interactive build tool –build definition (build.sbt) –sbt shell インタラクティブなビルドツール ビルド定義と シェルから構成される
  4. 4. build •sets of projects ビルド: プロジェクトの集合
  5. 5. project •configuration •settings •(scalaVersion) プロジェクト: コンフィグレーションとセッティングと (scalaVersion)
  6. 6. settings •transformation of key-value map セッティングは key-value マップの変換 key value name helloWorld version 0.1.0-SNAPSHOT organization com.example
  7. 7. settings •transformation of key-value map key := { val x = otherKey.value x + 1 } key += { ... } key ++= Seq(...) セッティングは key-value マップの変換
  8. 8. scoped keys •entry point for sbt shell •Attributes: –key name –key type –project (default "This") –configuration (default "This") –in-task (default "This") –(implicitly, scalaVersion) スコープ付けされたキー キー名、キー型、プロジェクト、コンフィギュレーション、in タスク、(scalaVersion)
  9. 9. scoped keys •entry point for sbt shell {url}proj-id/config:inTask::keyName keyName in (proj, Compile, inTask) := { ... } •in build.sbt sbt シェルへの入り口 build.sbt での記法と異なる
  10. 10. when "This" is used •shell will default to "This" •default delegation rule –project: x, ThisBuild, then Global –configuration: in the order of ivyConfigurations, then Global –task: no delegation シェルで軸に指定が無い場合は This This の委譲のルール
  11. 11. configuration •sets of source and library dependencies –Compile –Test –etc. コンフィギュレーションはソースとライブラリ依存性の集合
  12. 12. library dependencies •managed dependencies via Ivy def specs2Version = "2.4.2" def specs2 = "org.specs2" %% "specs2" % specs2Version lazy val root = (project in file(".")). settings( scalaVersion := "2.11.2", libraryDependencies ++= Seq(specs2 % "test") ) Ivy 経由でライブラリ依存性を管理
  13. 13. incremental compiler •compile compile と打ち込めばインクリメンタルコンパイルされる
  14. 14. sbt 1.0 technology previews •adding features to 0.13.x without breaking binary compatibility sbt 1.0 は出したいけど、API が固定化する前に入れたいものもある
  15. 15. 0.13.5/6: Auto plugins •default features as auto plugins •manages plugin dependencies –triggered plugins (e.g. coffeescript on all web) 次世代プラグイン。プラグイン同士の依存性を追跡 自動的にセッティング順を計算
  16. 16. 0.13.6: HTTPS by default •Maven Central •Typesafe repositories •sbt plugin repository HTTPS がデフォルト
  17. 17. 0.13.6: Consolidated resolution •resolution performance improvement sponsored by LinkedIn •consolidates sub-project dependency resolution with identical dependency graph def commonSettings = Seq( updateOptions := updateOptions.value.withConsolidatedResolution(true) ) lazy val app = (project in file("app")). settings(commonSettings: _*) ライブラリ依存性のグラフが同一な場合に解決を一括化
  18. 18. 0.13.6: Eviction warning •eviction –when multiple versions are found on resolved dependencies tree, sbt selects the latest by default. •0.13.6 guesses binary incompatible evictions [warn] There may be incompatibilities among your library dependencies. [warn] Here are some of the libraries that were evicted: [warn] * commons-io:commons-io:1.3 -> 2.1 [warn] Run 'evicted' to see detailed eviction warnings eviction: 同じライブラリの複数のバージョンがあった場合の「追い出し」 バイナリ互換性が無い eviction の推論
  19. 19. 0.13.6: Unresolved Exception •guesses dependencies tree of unresolved dependencies [warn] Note: Unresolved dependencies path: [warn] foundrylogic.vpp:vpp:2.2.1 [warn] +- org.apache.cayenne:cayenne-tools:3.0.2 [warn] +- org.apache.cayenne.plugins:maven-cayenne-plugin:3.0.2 (C:cygwin64homeeed3si9nworkhelloworldbuild.sbt#L12) [warn] +- root:root_2.11:0.1-SNAPSHOT 解決不能なライブラリ依存性のエラー表示の改善
  20. 20. 0.13.6: –SNAPSHOT handling •checks all resolvers for the latest (This could slow things down) •sbt used to pick the first one it found -SNAPSHOT 処理の改善 以前はキャッシュから JAR を消す必要があった
  21. 21. 0.13.x: sbt server •better integration with IDE, vim/emacs/sublime, Jenkins, Activator, etc •many possibilities (remote compilation, caching, inter-project communication) IDE や他のツールとの統合 リモートコンパイルなど多くの可能性がある
  22. 22. 0.13.x: more performance updates •cablecar: Ivy "rewrite" prototype in Scala – •or, enhancement on consolidated resolution (global cache, support for different graphs) •resolution performance improvement sponsored by LinkedIn cablecar: Ivy のライブラリ解決機能の Scala rewrite プロトタイプ 解決の一括化をさらに改善すればその方向の方が速くなるかも
  23. 23. thanks!