-
Notifications
You must be signed in to change notification settings - Fork 54
/
build.sbt
79 lines (74 loc) · 3.27 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
import xerial.sbt.Sonatype._
/*
To run tests or publish with a specific spark version use this java option:
-Dspark.version=3.0.0
*/
val sparkVersion = sys.props.get("spark.version").getOrElse("3.1.3")
val scalaVersionStr = "2.12.12"
val scalaVersionPrefix = scalaVersionStr.substring(0, 4)
val jacksonDatabindVersion = sparkVersion match {
case "3.1.3" => "2.10.0"
case "3.2.4" => "2.12.3"
case "3.3.4" => "2.13.4.2"
case "3.4.2" => "2.14.2"
case "3.5.0" => "2.15.2"
}
lazy val root = project
.withId("singlestore-spark-connector")
.in(file("."))
.enablePlugins(BuildInfoPlugin)
.settings(
name := "singlestore-spark-connector",
organization := "com.singlestore",
scalaVersion := scalaVersionStr,
Compile / unmanagedSourceDirectories += (Compile / sourceDirectory).value / (sparkVersion match {
case "3.1.3" => "scala-sparkv3.1"
case "3.2.4" => "scala-sparkv3.2"
case "3.3.4" => "scala-sparkv3.3"
case "3.4.2" => "scala-sparkv3.4"
case "3.5.0" => "scala-sparkv3.5"
}),
version := s"4.1.9-spark-${sparkVersion}",
licenses += "Apache-2.0" -> url(
"http://opensource.org/licenses/Apache-2.0"
),
resolvers += "Spark Packages Repo" at "https://dl.bintray.com/spark-packages/maven",
libraryDependencies ++= Seq(
// runtime dependencies
"org.apache.spark" %% "spark-core" % sparkVersion % "provided, test",
"org.apache.spark" %% "spark-sql" % sparkVersion % "provided, test",
"org.apache.avro" % "avro" % "1.11.3",
"org.apache.commons" % "commons-dbcp2" % "2.7.0",
"org.scala-lang.modules" %% "scala-java8-compat" % "0.9.0",
"com.singlestore" % "singlestore-jdbc-client" % "1.2.0",
"io.spray" %% "spray-json" % "1.3.5",
"io.netty" % "netty-buffer" % "4.1.70.Final",
"org.apache.commons" % "commons-dbcp2" % "2.9.0",
// test dependencies
"org.mariadb.jdbc" % "mariadb-java-client" % "2.+" % Test,
"org.scalatest" %% "scalatest" % "3.1.0" % Test,
"org.scalacheck" %% "scalacheck" % "1.14.1" % Test,
"org.mockito" %% "mockito-scala" % "1.16.37" % Test,
"com.github.mrpowers" %% "spark-fast-tests" % "0.21.3" % Test,
"com.github.mrpowers" %% "spark-daria" % "0.38.2" % Test
),
dependencyOverrides += "com.fasterxml.jackson.core" % "jackson-databind" % jacksonDatabindVersion,
Test / testOptions += Tests.Argument("-oF"),
Test / fork := true,
buildInfoKeys := Seq[BuildInfoKey](version),
buildInfoPackage := "com.singlestore.spark"
)
credentials += Credentials(
"GnuPG Key ID",
"gpg",
"CDD996495CF08BB2041D86D8D1EB3D14F1CD334F",
"ignored" // this field is ignored; passwords are supplied by pinentry
)
assemblyMergeStrategy in assembly := {
case PathList("META-INF", _*) => MergeStrategy.discard
case _ => MergeStrategy.first
}
publishTo := sonatypePublishToBundle.value
publishMavenStyle := true
sonatypeSessionName := s"[sbt-sonatype] ${name.value} ${version.value}"
sonatypeProjectHosting := Some(GitHubHosting("memsql", "memsql-spark-connector", "[email protected]"))