-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sbt
57 lines (48 loc) · 1.56 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
import sbtassembly.AssemblyPlugin.defaultShellScript
import Dependencies._
val appName = IO.read(file("NAME"))
val fileVersion = IO.read(file("VERSION"))
lazy val commonSettings = Seq(
organization := "com.example",
scalaVersion := "2.11.8",
version := fileVersion
)
lazy val root = (project in file("."))
.settings(
commonSettings,
name := appName,
assemblyJarName in assembly := s"${name.value}-$fileVersion.jar",
libraryDependencies ++= List(
sparkCore,
sparkSql,
scallop,
cassConnector,
elasticSearchSpark,
awsSdk,
hadoopAws,
json4sNative,
commonsCsv,
httpclient,
scalaTest,
scalaLogging
)
//libraryDependencies ~= (_.map(excludeLog4j))
)
.configs( IntegrationTest )
.settings( inConfig(IntegrationTest)(Defaults.testTasks) : _*)
.settings(
testOptions in Test := Seq(Tests.Filter(unitFilter)),
testOptions in IntegrationTest := Seq(Tests.Filter(itFilter))
)
assemblyShadeRules in assembly := Seq(
ShadeRule.rename("org.apache.http.**" -> "shadehttp.@1").inAll
)
def itFilter(name: String): Boolean = name endsWith "IntegrationSpec"
def unitFilter(name: String): Boolean = (name endsWith "Spec") && !itFilter(name)
lazy val IntegrationTest: Configuration = config("it") extend Test
fork in run := true
javaOptions in run ++= Seq(
"-Dlog4j.debug=true",
"-Dlog4j.configuration=log4j.properties")
outputStrategy := Some(StdoutOutput)
run in Compile := Defaults.runTask(fullClasspath in Compile, mainClass in (Compile, run), runner in (Compile, run)).evaluated