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.

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

7,080 views

Published on

Talk given at ScalaSphere 2017. A review of:
- the sbt 0.13.x series that’s been under development as a technology preview since 2014
- the sbt server feature which is planned to be shipped with the next major sbt release
- and the rest of sbt 1.0

Published in: Software
  • Be the first to comment

  • Be the first to like this

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

  1. 1. The state of sbt 0.13, sbt server, and sbt 1.0 Eugene Yokota (@eed3si9n) Dale Wijnand (@dwijnand)
 February, 2017
  2. 2. • Scala hobbyist since 2010 • “learning Scalaz” / “herding Cats” • an organizer of ScalaMatsuri • scalaxb (XML data binding) • treehugger.scala • sbt-assembly, sbt-buildinfo, etc • Lightbend/Typesafe since 2014 • current tech lead of sbt & Tooling team who are these guys Eugene (@eed3si9n) Dale (@dwijnand) • sbt core dev since 2015 • :_* no longer needed for settings(Seq(…)) • -= & --= for settings & tasks • Lightbend Tooling team since 2016 • SIP-27 - Trailing Commas
  3. 3. Lightbend Production Suite
  4. 4. • sbt server • sbt 0.13.x tech previews • sbt 1.0.x Overview of this talk
  5. 5. sbt server
  6. 6. • See http://eed3si9n.com/sbt-server-reboot sbt server reboot
  7. 7. • single JVM process • implemented as a command, sort of • JSON API to drive sbt from network what is sbt server?
  8. 8. • IDE integration • Distributed build example usages
  9. 9. sbt main loop shell prompts the user
  10. 10. server command server prompts the user, 
 and listens to network
  11. 11. telnet { "type": "ExecCommand", "commandLine": "compile" } ...
  12. 12. thin client $ sbt client localhost:5000 > compile
  13. 13. input/output of common tasks compile task
  14. 14. input/output of common tasks test task
  15. 15. input/output of common tasks • Outputs are side effects to disk and screen
  16. 16. event logging • A way to log object (semantic logging) • Logs are then relayed as JSON • Decoupled from screens
  17. 17. sbt 0.13.x tech previews
  18. 18. sbt 0.13.x tech previews • sbt 0.13.5 and onwards
  19. 19. sbt 0.13.5 (May 2014) • Introduction of AutoPlugin
  20. 20. sbt 0.13.6 (September 2014) • Name hashing is enabled by default • HTTPS by default • Eviction warnings • Unresolved dependency error tree
  21. 21. sbt 0.13.7 (November 2014) • Natural whitespace handling • Cached resolution (experimental)
  22. 22. sbt 0.13.8 (March 2015) • Cross-version support for Scala sources • Sequential tasks • Seq[Setting[_]] can be used directly in .settings(...) • Maven resolver (experimental)
  23. 23. sbt 0.13.9 (August 2015) • inThisBuild • Maven compatibility (read maven-metadata.xml)
  24. 24. sbt 0.13.11 (February 2016) • Configurable compiler bridge • Dotty support • Inter-project dependency tracking
  25. 25. sbt 0.13.12 (July 2016) • Deprecates project/Build.scala • scalaVersion enforcement to toolchain
  26. 26. sbt 0.13.13 (October 2016) • sbt new command • Synthetic subprojects • Deprecate old sbt 0.12 DSL 
 (<<=,<+=,<++=)
  27. 27. sbt 0.13.14 (soon 2017) • Java 9 compatibility • Other bug fixes
  28. 28. sbt 0.13 lesson learned • Binary compatibility is great for plugins • Binary compatibility is hard • Everything changes
  29. 29. sbt 1.0
  30. 30. less is more
  31. 31. binary compatibility (bincompat) • Goal: 2+ years of binary compatibility
  32. 32. removed feature • (Non-auto) sbt.Plugin • project/build.scala • 0.12 DSL operators (<<=, <+=, <++=) • Scala 2.9.x support
  33. 33. new feature • Scala 2.12.x based • Zinc 1.x (class-based name hashing) • sbt server
  34. 34. modularization • sbt • Zinc API • librarymanagement API • IO API
  35. 35. Zinc API • Unified API to drive Scala compiler • Lightbend, Scala Center, VirtusLab, Twitter engineers
  36. 36. librarymanagement API • Abstraction of dependency management free of Ivy.
  37. 37. meta-tooling • Making tools to make the tool • Contraband • sjson-new • Gigahorse • Giter8
  38. 38. Contraband • http://www.scala-sbt.org/contraband/ • GraphQL dialect to describe API • Generates pseudo-case class that’s evolvable while keeping binary compatibility. • Generates sjson-new JSON codecs. package com.example @target(Scala) ## Character represents the characters in Star Wars. type Character { name: String! appearsIn: [com.example.Episode]! }
  39. 39. impact to build users • Some migration required • Faster incremental compilation • Hopefully improved tooling in the long-term
  40. 40. impact to plugin authors • JSON compatibility
  41. 41. todo • Validate using plugin ecosystem • Validate using community build
  42. 42. Questions?

×