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 Made Simple

1,167 views

Published on

If you think SBT is complex, then you should read this.
SBT is really simple as long as you get to know it.

Published in: Technology, News & Politics
  • Be the first to comment

SBT Made Simple

  1. 1. SBT Made Simple @囚千任 - http://afoo.me Monday, September 9, 13
  2. 2. Immutability Monday, September 9, 13
  3. 3. Setting • A Build File is just a sequence of Settings • A Setting is just a transformation to key- value pairs • A Transformation to some key-value pair is immutable Monday, September 9, 13
  4. 4. State Transition • Project State is volatile • state transition is immutable Monday, September 9, 13
  5. 5. Composition Monday, September 9, 13
  6. 6. Task • dependency model to composition model • task composition to form bigger granularity unit Monday, September 9, 13
  7. 7. InputTask • Task with input • input validation and completion support with parser • parser combinator is a form of composition Monday, September 9, 13
  8. 8. Command • Special InputTask • accept Project state and settings as input • project state is driven by a composition of command execution Monday, September 9, 13
  9. 9. Modularity Monday, September 9, 13
  10. 10. Monday, September 9, 13
  11. 11. Configuration • Ivy concept similar to Maven’s Scope • Predefined or custom Configurations setup Modularity boundary Monday, September 9, 13
  12. 12. Project • project is another level of modularity • multiple project build definitions have their specific configuration Monday, September 9, 13
  13. 13. Plugins • SBT plugin mechanism is another modularity strategy • enhance reusability too. Monday, September 9, 13
  14. 14. Consistency One Rule To Rule Them All Monday, September 9, 13
  15. 15. Same Effect? name := { “hello” + “sbt” } sbt := { “hello” + “sbt” } Monday, September 9, 13
  16. 16. Not Really! name := { “hello” + “sbt” } sbt := { “hello” + “sbt” } => Setting[String] => Setting[Task[String]] Monday, September 9, 13
  17. 17. Key is the key val name = settingKey[String](“desc.”) name := { “hello” + “sbt” } val sbt = taskKey[String](“task desc”) sbt := { “hello” + “sbt” } => Setting[String] => Setting[Task[String]] Monday, September 9, 13
  18. 18. Key is the key • SettingKey[T] • TaskKey[T] • InputKey[T] Monday, September 9, 13
  19. 19. Demo Time~ Monday, September 9, 13
  20. 20. Monday, September 9, 13

×