Add system project, refactor sbt build

This commit is contained in:
Thibault Duplessis 2012-02-29 23:20:14 +01:00
parent 821a31faa8
commit 82cca24a52

View file

@ -26,27 +26,34 @@ trait Dependencies {
object ApplicationBuild extends Build with Resolvers with Dependencies { object ApplicationBuild extends Build with Resolvers with Dependencies {
lazy val chess = Project("chess", file("chess"), settings = Project.defaultSettings).settings( private val buildSettings = Project.defaultSettings ++ Seq(
libraryDependencies := Seq(scalalib, hasher), organization := "com.github.ornicar",
version := "0.1",
scalaVersion := "2.9.1",
resolvers := Seq(iliaz, codahale, sonatype),
libraryDependencies in test := Seq(specs2), libraryDependencies in test := Seq(specs2),
resolvers := Seq(iliaz, sonatype), shellPrompt := {
shellPrompt := ShellPrompt.buildShellPrompt, (state: State) "%s> ".format(Project.extract(state).currentProject.id)
},
scalacOptions := Seq("-deprecation", "-unchecked") scalacOptions := Seq("-deprecation", "-unchecked")
) )
lazy val http = Project("http", file("http"), settings = Project.defaultSettings).settings( lazy val chess = Project("chess", file("chess"), settings = buildSettings).settings(
libraryDependencies := Seq(scalalib, scalaz, specs2, redis, json, casbah, salat), libraryDependencies := Seq(scalalib, hasher)
resolvers := Seq(codahale, typesafe, typesafeS, iliaz, sonatype), )
shellPrompt := ShellPrompt.buildShellPrompt,
scalacOptions := Seq("-deprecation", "-unchecked") lazy val system = Project("system", file("system"), settings = buildSettings).settings(
libraryDependencies := Seq(scalalib, scalaz, redis, json, casbah, salat)
) dependsOn (chess) ) dependsOn (chess)
lazy val benchmark = Project("benchmark", file("benchmark"), settings = Project.defaultSettings).settings( lazy val http = Project("http", file("http"), settings = buildSettings).settings(
libraryDependencies := Seq(scalalib, scalaz),
resolvers := Seq(typesafe, typesafeS)
) dependsOn (system)
lazy val benchmark = Project("benchmark", file("benchmark"), settings = buildSettings).settings(
fork in run := true, fork in run := true,
libraryDependencies := Seq(scalalib, instrumenter, gson), libraryDependencies := Seq(scalalib, instrumenter, gson),
resolvers := Seq(iliaz, codahale, sonatype),
shellPrompt := ShellPrompt.buildShellPrompt,
scalacOptions := Seq("-deprecation", "-unchecked"),
// we need to add the runtime classpath as a "-cp" argument // we need to add the runtime classpath as a "-cp" argument
// to the `javaOptions in run`, otherwise caliper // to the `javaOptions in run`, otherwise caliper
// will not see the right classpath and die with a ConfigurationException // will not see the right classpath and die with a ConfigurationException
@ -71,8 +78,3 @@ object ApplicationBuild extends Build with Resolvers with Dependencies {
// attribute key to prevent circular onLoad hook (for benchmark) // attribute key to prevent circular onLoad hook (for benchmark)
val key = AttributeKey[Boolean]("javaOptionsPatched") val key = AttributeKey[Boolean]("javaOptionsPatched")
} }
object ShellPrompt {
val buildShellPrompt =
(state: State) "%s> ".format(Project.extract(state).currentProject.id)
}