Skip to content

Instantly share code, notes, and snippets.

Created June 23, 2013 03:53
Show Gist options
  • Save anonymous/5843732 to your computer and use it in GitHub Desktop.
Save anonymous/5843732 to your computer and use it in GitHub Desktop.
Here's an SBT build file I work on that I think is pretty clean.
package com.rackspace.dcx.dcorch.build
import sbt._
trait Dependencies {
private object v {
val akka = "2.1.4"
val argonaut = "6.0-RC1"
val eaio = "3.2"
val logback = "1.0.4"
val scalaCheck = "1.10.1"
val scalaTest = "2.0.M6-SNAP21"
val scalaZ = "7.0.0"
val spray = "1.1-M7"
val sprayJson = "1.2.3" // pinned low to avoid conflict with current Spray
}
val akkaActor = "com.typesafe.akka" %% "akka-actor" % v.akka
val akkaAgent = "com.typesafe.akka" %% "akka-agent" % v.akka
val akkaSlf4j = "com.typesafe.akka" %% "akka-slf4j" % v.akka
val argonaut = "io.argonaut" %% "argonaut" % v.argonaut
val eaio = "com.eaio.uuid" % "uuid" % v.eaio
val logback = "ch.qos.logback" % "logback-classic" % v.logback
val scalaCheck = "org.scalacheck" %% "scalacheck" % v.scalaCheck % "test"
val scalaTest = "org.scalatest" %% "scalatest" % v.scalaTest % "test"
val scalazConcurrent = "org.scalaz" %% "scalaz-concurrent" % v.scalaZ
val scalazCore = "org.scalaz" %% "scalaz-core" % v.scalaZ
val scalazEffect = "org.scalaz" %% "scalaz-effect" % v.scalaZ
val scalazScalacheck = "org.scalaz" %% "scalaz-scalacheck-binding" % v.scalaZ
val sprayCan = "io.spray" % "spray-can" % v.spray
val sprayClient = "io.spray" % "spray-client" % v.spray
val sprayIo = "io.spray" % "spray-io" % v.spray
val sprayJson = "io.spray" %% "spray-json" % v.sprayJson
val sprayRouting = "io.spray" % "spray-routing" % v.spray
val sprayTestkit = "io.spray" % "spray-testkit" % v.spray % "test"
}
package com.rackspace.dcx.foo.build
import sbt._
import sbt.Keys._
object FooBuild extends Build
with Assembly
with Dependencies
with DependencyGraph
with GitVersion
with NativePackager
with Unidoc {
override lazy val settings =
super.settings ++
gitVersionSettings ++
Seq(
organization := "com.rackspace.dcx",
organizationName := "Autohost Team - GDCI - Rackspace Hosting, Inc.",
startYear := Some(2013),
scalaVersion := "2.10.2",
resolvers += "spray repo" at "http://repo.spray.io/",
scalacOptions ++= Seq(
"-Xlint",
"-Ywarn-all",
//"-Xlog-implicits",
//"-Xfatal-warnings",
"-Yinline-warnings",
"-deprecation",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-language:postfixOps",
"-optimize"),
testOptions in Test += Tests.Argument("-oD"))
lazy val root =
Project("foo", file("."))
.aggregate(debian, unidoc, server, lib)
lazy val debian =
Project("foo-debian", file("foo-debian"))
.settings(nativePackagerSettings(assembly in server): _*)
lazy val unidoc =
Project("foo-unidoc", file("foo-unidoc"))
.settings(unidocSettings: _*)
.aggregate(lib, server)
lazy val server =
Project("foo-server", file("foo-server"))
.settings((assemblySettings ++ graphSettings): _*)
.settings(
libraryDependencies ++=
Seq(
akkaActor,
akkaAgent,
akkaSlf4j,
logback,
scalaTest,
sprayCan,
sprayClient,
sprayIo,
sprayJson,
sprayRouting,
sprayTestkit))
.dependsOn(lib)
lazy val lib =
Project("foo-lib", file("foo-lib"))
.settings(graphSettings: _*)
.settings(
libraryDependencies ++=
Seq(
argonaut,
eaio,
scalaCheck,
scalaTest,
scalazConcurrent,
scalazCore,
scalazEffect,
scalazScalacheck))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment