forked from filodb/FiloDB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
107 lines (89 loc) · 4.28 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
val mySettings = Seq(organization := "org.velvia",
scalaVersion := "2.10.4",
parallelExecution in Test := false,
resolvers ++= extraRepos) ++
universalSettings
lazy val core = (project in file("core"))
.settings(mySettings:_*)
.settings(name := "filodb-core")
.settings(scalacOptions += "-language:postfixOps")
.settings(libraryDependencies ++= coreDeps)
lazy val cli = (project in file("cli"))
.settings(mySettings:_*)
.settings(name := "filodb-cli")
.settings(libraryDependencies ++= cliDeps)
.settings(cliAssemblySettings:_*)
.dependsOn(core)
lazy val spark = (project in file("spark"))
.settings(mySettings:_*)
.settings(name := "filodb-spark")
.settings(libraryDependencies ++= sparkDeps)
.settings(assemblySettings:_*)
.settings(assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false))
.dependsOn(core)
val phantomVersion = "1.8.12"
val akkaVersion = "2.3.7"
lazy val extraRepos = Seq(
"Typesafe repository releases" at "http://repo.typesafe.com/typesafe/releases/",
"twitter-repo" at "http://maven.twttr.com",
"Websudos releases" at "https://dl.bintray.com/websudos/oss-releases/",
"Pellucid Bintray" at "http://dl.bintray.com/pellucid/maven",
"Velvia Bintray" at "https://dl.bintray.com/velvia/maven"
)
val excludeShapeless = ExclusionRule(organization = "com.chuusai")
lazy val coreDeps = Seq(
"com.websudos" %% "phantom-dsl" % phantomVersion,
// "com.websudos" %% "phantom-zookeeper" % phantomVersion,
"com.typesafe.akka" %% "akka-slf4j" % akkaVersion,
"com.typesafe.scala-logging" %% "scala-logging-slf4j" % "2.1.2",
"ch.qos.logback" % "logback-classic" % "1.0.7",
"com.beachape" %% "enumeratum" % "1.2.1",
"org.velvia.filo" %% "filo-scala" % "0.1.3" excludeAll(excludeShapeless),
"com.opencsv" % "opencsv" % "3.3",
"com.nativelibs4java" %% "scalaxy-loops" % "0.3.3" % "provided",
"com.websudos" %% "phantom-testkit" % phantomVersion % "test",
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test"
)
lazy val cliDeps = Seq(
"com.quantifind" %% "sumac" % "0.3.0"
)
lazy val sparkDeps = Seq(
"org.apache.spark" %% "spark-sql" % "1.4.0" % "provided"
)
//////////////////////////
///
lazy val coreSettings = Seq(
scalacOptions ++= Seq("-Xlint", "-deprecation", "-Xfatal-warnings", "-feature")
)
lazy val universalSettings = coreSettings ++ styleSettings
// Create a default Scala style task to run with tests
lazy val testScalastyle = taskKey[Unit]("testScalastyle")
lazy val compileScalastyle = taskKey[Unit]("compileScalastyle")
lazy val styleSettings = Seq(
testScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Test).toTask("").value,
// (scalastyleConfig in Test) := "scalastyle-test-config.xml",
// This is disabled for now, cannot get ScalaStyle to recognize the file above for some reason :/
// (test in Test) <<= (test in Test) dependsOn testScalastyle,
scalastyleFailOnError := true,
compileScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Compile).toTask("").value,
// Is running this on compile too much?
(compile in Test) <<= (compile in Test) dependsOn compileScalastyle
)
lazy val shellScript = """#!/usr/bin/env sh
exec java -jar "$0" "$@"
""".split("\n")
// Builds cli as a standalone executable to make it easier to launch commands
lazy val cliAssemblySettings = Seq(
assemblyOption in assembly := (assemblyOption in assembly).value.copy(
prependShellScript = Some(shellScript)),
assemblyJarName in assembly := s"filo-cli-${version.value}"
)
lazy val assemblySettings = Seq(
assemblyMergeStrategy in assembly := {
case PathList(ps @ _*) if ps.last endsWith ".txt.1" => MergeStrategy.first
case "application.conf" => MergeStrategy.concat
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
)