-
Notifications
You must be signed in to change notification settings - Fork 919
/
Dependencies.scala
117 lines (97 loc) · 4.68 KB
/
Dependencies.scala
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
108
109
110
111
112
113
114
115
116
117
import sbt.{ModuleID, _}
object Dependencies
{
import Versions._
object Spark {
val sparkCore = "org.apache.spark" %% "spark-core" % ApacheSpark % "provided" // ApacheV2
val sparkRepl = "org.apache.spark" %% "spark-repl" % ApacheSpark % "provided" // ApacheV2
val sparkUnsafe = "org.apache.spark" %% "spark-unsafe" % ApacheSpark % "provided" // ApacheV2
val sparkStreaming = "org.apache.spark" %% "spark-streaming" % ApacheSpark % "provided" // ApacheV2
val sparkSql = "org.apache.spark" %% "spark-sql" % ApacheSpark % "provided" // ApacheV2
val sparkCatalyst = "org.apache.spark" %% "spark-catalyst" % ApacheSpark % "provided" // ApacheV2
val sparkHive = "org.apache.spark" %% "spark-hive" % ApacheSpark % "provided" // ApacheV2
val dependencies = Seq(
sparkCore,
sparkRepl,
sparkUnsafe,
sparkStreaming,
sparkSql,
sparkHive,
sparkCatalyst)
}
implicit class Exclude(module: ModuleID) {
def logbackExclude(): ModuleID = module
.exclude("ch.qos.logback", "logback-classic")
.exclude("ch.qos.logback", "logback-core")
.exclude("org.slf4j", "log4j-over-slf4j")
def driverCoreExclude(): ModuleID = module
.exclude("org.apache.cassandra", "java-driver-core") // doesn't shade guava
.exclude("org.apache.tinkerpop", "*")
// until SPARK-20075 is fixed we fallback to java workarounds for native calls
.exclude("com.github.jnr", "jnr-posix")
}
object TestCommon {
val mockito = "org.mockito" % "mockito-all" % Mockito
val junit = "junit" % "junit" % JUnit
val junitInterface = "com.novocode" % "junit-interface" % JUnitInterface
val scalaTest = "org.scalatest" %% "scalatest" % ScalaTest
val driverMapperProcessor = "org.apache.cassandra" % "java-driver-mapper-processor" % CassandraJavaDriver
val esriGeometry = "com.esri.geometry" % "esri-geometry-api" % EsriGeometry
}
object TestConnector {
val commonsIO = "commons-io" % "commons-io" % CommonsIO % "test,it" // ApacheV2
val scalaCheck = "org.scalacheck" %% "scalacheck" % ScalaCheck % "test,it" // BSD
val sparkCoreT = "org.apache.spark" %% "spark-core" % ApacheSpark % "test,it" classifier "tests"
val sparkStreamingT = "org.apache.spark" %% "spark-streaming" % ApacheSpark % "test,it" classifier "tests"
val solrj = "org.apache.solr" % "solr-solrj" % SolrJ % "test,it"
val dependencies = Seq(
scalaCheck,
sparkCoreT,
sparkStreamingT,
solrj,
TestCommon.driverMapperProcessor % "test,it" driverCoreExclude(),
TestCommon.scalaTest % "test,it",
TestCommon.mockito % "test,it",
TestCommon.junit % "test,it",
TestCommon.junitInterface % "test,it",
TestCommon.esriGeometry % "test,it").map(_.logbackExclude())
}
// Required for metrics
object Jetty {
val jettyServer = "org.eclipse.jetty" % "jetty-server" % SparkJetty % "provided"
val jettyServlet = "org.eclipse.jetty" % "jetty-servlet" % SparkJetty % "provided"
val dependencies = Seq(jettyServer, jettyServlet)
}
object Driver {
val driverCore = "org.apache.cassandra" % "java-driver-core-shaded" % CassandraJavaDriver driverCoreExclude()
val driverMapper = "org.apache.cassandra" % "java-driver-mapper-runtime" % CassandraJavaDriver driverCoreExclude()
val commonsLang3 = "org.apache.commons" % "commons-lang3" % Versions.CommonsLang3
val paranamer = "com.thoughtworks.paranamer" % "paranamer" % Versions.Paranamer
val dependencies = Seq(driverCore, driverMapper, commonsLang3, paranamer)
}
object Compatibility {
val scalaCompat = "org.scala-lang.modules" %% "scala-collection-compat" % Versions.ScalaCompat
val parallelCollections = "org.scala-lang.modules" %% "scala-parallel-collections" % Versions.ParallelCollections
def dependencies(version: String): Seq[ModuleID] = {
CrossVersion.partialVersion(version) match {
case Some((2, scalaMajor)) if scalaMajor == 13 => Seq(scalaCompat, parallelCollections)
case _ => Seq(scalaCompat)
}
}
}
object TestDriver {
val dependencies = Seq(
TestCommon.scalaTest % "test",
TestCommon.mockito % "test",
TestCommon.junit % "test",
TestCommon.junitInterface % "test",
TestCommon.driverMapperProcessor % "test" driverCoreExclude()
)
}
object TestSupport {
val commonsExec = "org.apache.commons" % "commons-exec" % CommonsExec
val dependencies = Seq(
commonsExec,
Dependencies.Driver.driverCore)
}
}