SlideShare une entreprise Scribd logo
1  sur  18
SBT <<= (Build) { FTW }
        @indrajitr
SBT
• Build tool on Scala for building Scala-Java projects

• Compliant with Maven's convention (mostly)

• Basics done right

• Easy to set up for simple projects (intrusive)

• Shares a *lot* with Scala




                                 Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
Build Definitions
• Simple: Quick DSL

• Diabolical: Scala code (with embedded DSL)

• And the shell rocks




                              Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
Build Definitions
<base>/*.sbt

<base>/project/*.scala

<base>/project/plugins.sbt

<base>/project/plugins/*.(scala|sbt)

~/.sbt/plugins/*.(scala|sbt)




                          Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
build.sbt
organization := "net.liftweb"

name       := "lift-demo"

version    := "1.0"

scalaVersion := "2.9.1"

libraryDependencies ++=

  Seq("net.liftweb" %% "lift-webkit" % "2.4-M4",

 "org.eclipse.jetty" % "jetty-webapp" % "7.3.0.v20110203" % "jetty")
                            Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
project/build.scala
import sbt._

object LiftBuild extends Build {

    lazy val projects: Seq[ProjectReference] = Seq(common, actor, json)

    lazy val framework = Project("lift-framework", file(".")).aggregate(projects)

    lazy val common = Project(“lift-common”, file(“core/common”)).settings(/*...*/)

    lazy val actor = Project(“lift-actor”, file(“core/actor”)).dependsOn(common).settings(/*...*/)

    lazy val json = Project("lift-json", file("core/json")) dependsOn(common % "test")

    //lazy val foo = Project("lift-foo", file("core/foo"), delegates = common :: Nil)

}

                                        Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
The Expression
Reminder:

Statement ≠ Expression

  Statement:

    val foo = bar + baz

  Expression:

    bar + baz


                          Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
The Expression
The expression:

organization <<= organization or normalizedName.identity

Is a: Project.Setting[S]

And <<= is thus:

final def <<= (app: Initialize[S]): Setting[S]

for: InputKey, SettingsKey


                             Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
The Emojis
                The ONE




    <<=
Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
The Emojis
  And the rest

  := += ++= <+= <++= ~=
• Initialize ( := )


• Append ( += ++= <+= <++= )


• Update ( ~= )



                      Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
Scoped Keys
sealed trait Key[T] extends Scoped

final class SettingKey[T] extends Key[T] with ScopedSetting[T]

final class TaskKey[T] extends Key[T] with ScopedTask[T]

final class InputKey[T] extends Key[InputTask[T]] with ScopedInput[T]




                          Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
Examples
name := "lift-demo"

name ~= formalize

resolvers in GlobalScope += JavaNet2Repository

scalacOptions ++= Seq("-encoding", "UTF-8")

resolvers <++= isSnapshot { s => if (s) Seq(ScalaToolsSnapshots) else Nil }

inceptionYear <<= inceptionYear ?? Some(2011)

organization <<= organization or normalizedName.identity
                            Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
Examples
libraryDependencies <<= (libraryDependencies, scalaVersion) apply { (ld, sv) =>
ld :+ scalap(sv) })

libraryDependencies <+= (scalaVersion)(scalap)

libraryDependencies <+= scalaVersion apply scalap

scalacOptions /*in GlobalScope*/ in doc <++= (name in doc, version in doc) map
(Seq("-doc-title", _, "-doc-version", _))




                         Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
Settings are Scoped!
def in(s: Scope): Result // ScopedSetting, ScopedTask, ScopedInput

def in(p: Reference): Result

def in(t: Scoped): Result

def in(c: ConfigKey): Result

def in(c: ConfigKey, t: Scoped): Result

def in(p: Reference, c: ConfigKey): Result

def in(p: Reference, t: Scoped): Result

def in(p: Reference, c: ConfigKey, t: Scoped): Result

def in(p: ScopeAxis[Reference], c: ScopeAxis[ConfigKey], t: ScopeAxis[AttributeKey[_]]): Result

                                      Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
Miscellaneous
MOAR Emojis (in shell)!

~ + ++ ; ! < -

Plugin, State, Life, Universe and everything else




                            Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
Lost?
 Befriend ‘em

• Defaults.scala

• Keys.scala

• IDE




                   Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
Exercise
Questions?

Contenu connexe

Similaire à Simple Build Tool Introduction

Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghStuart Roebuck
 
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 FallJavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 FallYuichi Sakuraba
 
Interceptors: Into the Core of Pedestal
Interceptors: Into the Core of PedestalInterceptors: Into the Core of Pedestal
Interceptors: Into the Core of PedestalKent Ohashi
 
Starting with Scala : Frontier Developer's Meetup December 2010
Starting with Scala : Frontier Developer's Meetup December 2010Starting with Scala : Frontier Developer's Meetup December 2010
Starting with Scala : Frontier Developer's Meetup December 2010Derek Chen-Becker
 
"ClojureScript journey: from little script, to CLI program, to AWS Lambda fun...
"ClojureScript journey: from little script, to CLI program, to AWS Lambda fun..."ClojureScript journey: from little script, to CLI program, to AWS Lambda fun...
"ClojureScript journey: from little script, to CLI program, to AWS Lambda fun...Julia Cherniak
 
Android development with Scala and SBT
Android development with Scala and SBTAndroid development with Scala and SBT
Android development with Scala and SBTAnton Yalyshev
 
Gradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting forGradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting forCorneil du Plessis
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKJosé Paumard
 
Infrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and OpsInfrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and OpsMykyta Protsenko
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffSpring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffJAX London
 
Torquebox OSCON Java 2011
Torquebox OSCON Java 2011Torquebox OSCON Java 2011
Torquebox OSCON Java 2011tobiascrawley
 

Similaire à Simple Build Tool Introduction (20)

Sap java
Sap javaSap java
Sap java
 
Wider than rails
Wider than railsWider than rails
Wider than rails
 
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter PilgrimJavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
JavaCro'14 - Scala and Java EE 7 Development Experiences – Peter Pilgrim
 
Scala @ TechMeetup Edinburgh
Scala @ TechMeetup EdinburghScala @ TechMeetup Edinburgh
Scala @ TechMeetup Edinburgh
 
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 FallJavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
JavaOne報告会 Java SE/JavaFX 編 - JJUG CCC 2010 Fall
 
Slick @ Confitura 2013
Slick @ Confitura 2013Slick @ Confitura 2013
Slick @ Confitura 2013
 
Play framework
Play frameworkPlay framework
Play framework
 
SCALA - Functional domain
SCALA -  Functional domainSCALA -  Functional domain
SCALA - Functional domain
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
 
Interceptors: Into the Core of Pedestal
Interceptors: Into the Core of PedestalInterceptors: Into the Core of Pedestal
Interceptors: Into the Core of Pedestal
 
Starting with Scala : Frontier Developer's Meetup December 2010
Starting with Scala : Frontier Developer's Meetup December 2010Starting with Scala : Frontier Developer's Meetup December 2010
Starting with Scala : Frontier Developer's Meetup December 2010
 
"ClojureScript journey: from little script, to CLI program, to AWS Lambda fun...
"ClojureScript journey: from little script, to CLI program, to AWS Lambda fun..."ClojureScript journey: from little script, to CLI program, to AWS Lambda fun...
"ClojureScript journey: from little script, to CLI program, to AWS Lambda fun...
 
Android development with Scala and SBT
Android development with Scala and SBTAndroid development with Scala and SBT
Android development with Scala and SBT
 
Gradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting forGradle: The Build system you have been waiting for
Gradle: The Build system you have been waiting for
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
 
Infrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and OpsInfrastructure-as-code: bridging the gap between Devs and Ops
Infrastructure-as-code: bridging the gap between Devs and Ops
 
Nodejs - A quick tour (v5)
Nodejs - A quick tour (v5)Nodejs - A quick tour (v5)
Nodejs - A quick tour (v5)
 
Full Stack Scala
Full Stack ScalaFull Stack Scala
Full Stack Scala
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffSpring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard Wolff
 
Torquebox OSCON Java 2011
Torquebox OSCON Java 2011Torquebox OSCON Java 2011
Torquebox OSCON Java 2011
 

Dernier

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 

Dernier (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 

Simple Build Tool Introduction

  • 1. SBT <<= (Build) { FTW } @indrajitr
  • 2. SBT • Build tool on Scala for building Scala-Java projects • Compliant with Maven's convention (mostly) • Basics done right • Easy to set up for simple projects (intrusive) • Shares a *lot* with Scala Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
  • 3. Build Definitions • Simple: Quick DSL • Diabolical: Scala code (with embedded DSL) • And the shell rocks Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
  • 5. build.sbt organization := "net.liftweb" name := "lift-demo" version := "1.0" scalaVersion := "2.9.1" libraryDependencies ++= Seq("net.liftweb" %% "lift-webkit" % "2.4-M4", "org.eclipse.jetty" % "jetty-webapp" % "7.3.0.v20110203" % "jetty") Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
  • 6. project/build.scala import sbt._ object LiftBuild extends Build { lazy val projects: Seq[ProjectReference] = Seq(common, actor, json) lazy val framework = Project("lift-framework", file(".")).aggregate(projects) lazy val common = Project(“lift-common”, file(“core/common”)).settings(/*...*/) lazy val actor = Project(“lift-actor”, file(“core/actor”)).dependsOn(common).settings(/*...*/) lazy val json = Project("lift-json", file("core/json")) dependsOn(common % "test") //lazy val foo = Project("lift-foo", file("core/foo"), delegates = common :: Nil) } Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
  • 7. The Expression Reminder: Statement ≠ Expression Statement: val foo = bar + baz Expression: bar + baz Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
  • 8. The Expression The expression: organization <<= organization or normalizedName.identity Is a: Project.Setting[S] And <<= is thus: final def <<= (app: Initialize[S]): Setting[S] for: InputKey, SettingsKey Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
  • 9. The Emojis The ONE <<= Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
  • 10. The Emojis And the rest := += ++= <+= <++= ~= • Initialize ( := ) • Append ( += ++= <+= <++= ) • Update ( ~= ) Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
  • 11. Scoped Keys sealed trait Key[T] extends Scoped final class SettingKey[T] extends Key[T] with ScopedSetting[T] final class TaskKey[T] extends Key[T] with ScopedTask[T] final class InputKey[T] extends Key[InputTask[T]] with ScopedInput[T] Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
  • 12. Examples name := "lift-demo" name ~= formalize resolvers in GlobalScope += JavaNet2Repository scalacOptions ++= Seq("-encoding", "UTF-8") resolvers <++= isSnapshot { s => if (s) Seq(ScalaToolsSnapshots) else Nil } inceptionYear <<= inceptionYear ?? Some(2011) organization <<= organization or normalizedName.identity Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
  • 13. Examples libraryDependencies <<= (libraryDependencies, scalaVersion) apply { (ld, sv) => ld :+ scalap(sv) }) libraryDependencies <+= (scalaVersion)(scalap) libraryDependencies <+= scalaVersion apply scalap scalacOptions /*in GlobalScope*/ in doc <++= (name in doc, version in doc) map (Seq("-doc-title", _, "-doc-version", _)) Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
  • 14. Settings are Scoped! def in(s: Scope): Result // ScopedSetting, ScopedTask, ScopedInput def in(p: Reference): Result def in(t: Scoped): Result def in(c: ConfigKey): Result def in(c: ConfigKey, t: Scoped): Result def in(p: Reference, c: ConfigKey): Result def in(p: Reference, t: Scoped): Result def in(p: Reference, c: ConfigKey, t: Scoped): Result def in(p: ScopeAxis[Reference], c: ScopeAxis[ConfigKey], t: ScopeAxis[AttributeKey[_]]): Result Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
  • 15. Miscellaneous MOAR Emojis (in shell)! ~ + ++ ; ! < - Plugin, State, Life, Universe and everything else Bay Area Scala Enthusiasts Meeting #42 (10-10-11)
  • 16. Lost? Befriend ‘em • Defaults.scala • Keys.scala • IDE Bay Area Scala Enthusiasts Meeting #42 (10-10-11)

Notes de l'éditeur

  1. The title is actually valid SBT expression\nSkipping lots of things to make room for more important ones in 45 min\nBasic things and then SBT code\nNo FP details (unless something slips out)\n\n
  2. It&amp;#x2019;s SIMPLE once you get past the initial hoop\nAs crazy and as awesome as scala\nTricky to get going, no looking back when there\n
  3. Roughly equivalent to pom.xml\n\nGreat DSL in SBT: Buy DSL in Action or learn SBT for free\n\n
  4. \n
  5. \n
  6. Contents of settings are expressions\n
  7. Expressions compose, statements don&amp;#x2019;t\nExpression has a value\n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. lazy val scalap: String =&gt; ModuleID = &quot;org.scala-lang&quot; % &quot;scalap&quot; % _\n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n