sbt ã® Build.scala ãæ¸ã
sbt 㯠0.10 ç³»ããï¼ build.sbt ã§ã®è¨å®ã¨ Build.scala ã§ã®è¨å®ã®ä¸¡æ¹ã使ããããã«ãªãã¾ããã*1
使ãåãæ¹
åºæ¬çã« build.sbt ã Build.scala ãã§ãããã¨ã«å¤ããã¯ããã¾ããã
ãã ã build.sbt ã¯è¨è¿°ãç°¡åãªä¸æ¹ã§å¶éãããã¾ããå¹³ããè¨ã㨠val ã object ãæ¸ãã¾ãããå¾ã£ã¦è¤æ°ã®ç®æã§ã³ã¼ããå
±æããããã¨ãããã¨ããããã¨ããã¨è¾ããªãã¾ãã
ä¸å¿ã§ããã£ã¡ãã§ãã¾ãã...
https://gist.github.com/1221210
Build.scala ãªãScala使ãæ¾é¡ã§ããã*2ãã¡ãã£ã¨é·ããªã代ããã«è¦ããããªãã¾ãããµãããã¸ã§ã¯ãããããªã©ãå°ãè¤éã«ãªã£ãã Build.scala ãæ¸ãã»ããè¯ãããã§ãã
æ¸ãã¦ã¿ã
unfiltered ã®ãµã³ãã«ããã¸ã§ã¯ãã github ã«ããã®ã§ããã
ããã sbt 0.7ç³» ã使ã£ã¦ããã®ã§ã0.11ç³»ç¨ã« Build.scala ãæ¸ãã¦ã¿ã¾ããã
Before
class Project(info: ProjectInfo) extends DefaultProject(info) { val uf_version = "0.3.2" // unfiltered lazy val uff = "net.databinder" %% "unfiltered-filter" % uf_version lazy val ufj = "net.databinder" %% "unfiltered-jetty" % uf_version lazy val ufs = "net.databinder" %% "unfiltered-json" % uf_version lazy val uft = "net.databinder" %% "unfiltered-scalate" % uf_version // stm val scala_stm = "org.scala-tools" %% "scala-stm" % "0.2" // testing lazy val uf_spec = "net.databinder" %% "unfiltered-spec" % uf_version //% "test" lazy val jboss = "JBoss repository" at "https://repository.jboss.org/nexus/content/groups/public/" // logging val javaNetRepo = "Java.net Repository for Maven" at "http://download.java.net/maven/2" val newReleaseToolsRepository = ScalaToolsSnapshots val avsl = "org.clapper" %% "avsl" % "0.3.1" }
After
import sbt._ import Keys._ object BuildSettings { val buildName = "unfiltered-example-bookmarks" val buildOrganization = "odp" val buildVersion = "2.0.29" val buildScalaVersion = "2.9.1" val buildSettings = Defaults.defaultSettings ++ Seq ( name := buildName, organization := buildOrganization, version := buildVersion, scalaVersion := buildScalaVersion ) } object Dependencies { object Unfiltered { val version = "0.5.1" val filter = "net.databinder" %% "unfiltered-filter" % version val jetty = "net.databinder" %% "unfiltered-jetty" % version val json = "net.databinder" %% "unfiltered-json" % version val scalate = "net.databinder" %% "unfiltered-scalate" % version lazy val spec = "net.databinder" %% "unfiltered-spec" % version //% "test" } val scalaSTM = "org.scala-tools" %% "scala-stm" % "0.3" object Logging { val avsl = "org.clapper" %% "avsl" % "0.3.6" } } object Resolvers { val newReleaseToolsRepository = ScalaToolsSnapshots val jboss = "JBoss repository" at "https://repository.jboss.org/nexus/content/groups/public/" val javaNetRepo = "Java.net Repository for Maven" at "http://download.java.net/maven/2" val all = Seq(newReleaseToolsRepository, jboss, javaNetRepo) } object UnfilteredExampleBookmarks extends Build { import BuildSettings._ import Dependencies._ lazy val root = Project ( id = "unfiltered-example-bookmarks", base = file ("."), settings = buildSettings ++ Seq ( resolvers ++= Resolvers.all, libraryDependencies ++= Seq( Unfiltered.filter, Unfiltered.jetty, Unfiltered.json, Unfiltered.scalate, Unfiltered.spec, scalaSTM, Logging.avsl ) ) ) }
åè
Wiki(Home · harrah/xsbt Wiki · GitHub)ãè¦ãã°ã ãããããæããGetting Started... ã®ãããã¯ç®ãéãã¦ãããã»ããè¯ããã¨ã
:= <<= += ++= <++= ã¨ããè¬ãªäººã¯
Getting Started More About Settings · harrah/xsbt Wiki · GitHub
ãè¦ãã°ãããã¾ãã
ããã¯è»½ããªãã¡ã¬ã³ã¹ããã
Full Configuration Example · harrah/xsbt Wiki · GitHub
ãã¨ã¹ã©ã¤ã
- scala-kaigi1-sbt by @xuwei_k
- sbt 0.10 for beginners? by @k4200jp