2011-07-14 22:38:25 -04:00
import sbt._
import Keys._
2011-08-29 19:13:26 -04:00
import sbtassembly.Plugin. { assemblySettings , Assembly }
2011-07-14 22:38:25 -04:00
object SparkBuild extends Build {
lazy val root = Project ( "root" , file ( "." ) , settings = sharedSettings ) aggregate ( core , repl , examples , bagel )
lazy val core = Project ( "core" , file ( "core" ) , settings = coreSettings )
lazy val repl = Project ( "repl" , file ( "repl" ) , settings = replSettings ) dependsOn ( core )
lazy val examples = Project ( "examples" , file ( "examples" ) , settings = examplesSettings ) dependsOn ( core )
lazy val bagel = Project ( "bagel" , file ( "bagel" ) , settings = bagelSettings ) dependsOn ( core )
def sharedSettings = Defaults . defaultSettings ++ Seq (
organization : = "org.spark-project" ,
2011-07-17 19:13:37 -04:00
version : = "0.4-SNAPSHOT" ,
2011-08-31 05:43:05 -04:00
scalaVersion : = "2.9.1" ,
2011-08-02 05:31:55 -04:00
scalacOptions : = Seq ( /* "-deprecation", */ "-unchecked" , "-optimize" ) , // -deprecation is too noisy due to usage of old Hadoop API, enable it once that's no longer an issue
2011-08-30 01:58:53 -04:00
unmanagedJars in Compile <<= baseDirectory map { base => ( base / "lib" ** "*.jar" ) . classpath } ,
2011-07-14 22:38:25 -04:00
retrieveManaged : = true ,
transitiveClassifiers in Scope . GlobalScope : = Seq ( "sources" ) ,
2011-07-20 20:04:29 -04:00
testListeners <<= target . map ( t => Seq ( new eu . henkelmann . sbt . JUnitXmlTestsListener ( t . getAbsolutePath ) ) ) ,
2011-07-31 15:17:12 -04:00
publishTo <<= baseDirectory { base => Some ( Resolver . file ( "Local" , base / "target" / "maven" asFile ) ( Patterns ( true , Resolver . mavenStyleBasePattern ) ) ) } ,
2011-07-14 22:38:25 -04:00
libraryDependencies ++= Seq (
"org.eclipse.jetty" % "jetty-server" % "7.4.2.v20110526" ,
2011-07-17 19:16:08 -04:00
"org.scalatest" % "scalatest_2.9.0" % "1.6.1" % "test" ,
"org.scala-tools.testing" % "scalacheck_2.9.0-1" % "1.9" % "test"
2011-07-14 22:38:25 -04:00
)
)
val slf4jVersion = "1.6.1"
def coreSettings = sharedSettings ++ Seq ( libraryDependencies ++= Seq (
"com.google.guava" % "guava" % "r09" ,
"log4j" % "log4j" % "1.2.16" ,
"org.slf4j" % "slf4j-api" % slf4jVersion ,
"org.slf4j" % "slf4j-log4j12" % slf4jVersion ,
"com.ning" % "compress-lzf" % "0.7.0" ,
"org.apache.hadoop" % "hadoop-core" % "0.20.2" ,
2011-08-01 18:25:26 -04:00
"asm" % "asm-all" % "3.3.1" ,
"com.google.protobuf" % "protobuf-java" % "2.3.0" ,
"de.javakaffee" % "kryo-serializers" % "0.9"
2011-08-29 19:13:26 -04:00
) ) ++ assemblySettings ++ Seq ( test in Assembly : = { } )
2011-07-14 22:38:25 -04:00
2011-07-18 05:34:51 -04:00
def replSettings = sharedSettings ++
2011-08-29 19:13:26 -04:00
Seq ( libraryDependencies <+= scalaVersion ( "org.scala-lang" % "scala-compiler" % _ ) )
2011-07-14 22:38:25 -04:00
def examplesSettings = sharedSettings ++ Seq ( libraryDependencies += "colt" % "colt" % "1.2.0" )
2011-08-29 19:13:26 -04:00
def bagelSettings = sharedSettings
2011-07-14 22:38:25 -04:00
}