forked from qubole/spark-acid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
142 lines (115 loc) · 4.19 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name := "spark-acid"
organization:= "com.qubole"
crossScalaVersions := Seq("2.11.12")
scalaVersion := crossScalaVersions.value.head
sparkVersion := "2.4.3"
scalacOptions ++= Seq(
"-Xlint",
"-Xfatal-warnings",
"-deprecation",
"-unchecked",
"-optimise",
"-Yinline-warnings"
)
scalacOptions in (Compile, doc) ++= Seq(
"-no-link-warnings" // Suppresses problems with Scaladoc @throws links
)
resolvers += "spark-packages" at "https://dl.bintray.com/spark-packages/maven/"
libraryDependencies ++= Seq(
// Adding test classifier seems to break transitive resolution of the core dependencies
"org.apache.spark" %% "spark-hive" % "2.4.3" % "provided" excludeAll(
ExclusionRule("org.apache", "hadoop-common"),
ExclusionRule("org.apache", "hadoop-hdfs")),
"org.apache.spark" %% "spark-sql" % "2.4.3" % "provided" excludeAll(
ExclusionRule("org.apache", "hadoop-common"),
ExclusionRule("org.apache", "hadoop-hdfs")),
"org.apache.spark" %% "spark-core" % "2.4.3" % "provided" excludeAll(
ExclusionRule("org.apache", "hadoop-common"),
ExclusionRule("org.apache", "hadoop-hdfs")),
"org.apache.spark" %% "spark-catalyst" % "2.4.3" % "provided" excludeAll(
ExclusionRule("org.apache", "hadoop-common"),
ExclusionRule("org.apache", "hadoop-hdfs"))
)
libraryDependencies ++= Seq(
"org.apache.hadoop" % "hadoop-common" % "2.8.1" % "provided",
"org.apache.hadoop" % "hadoop-hdfs" % "2.8.1" % "provided",
// Dependencies for tests
//
"org.scalatest" %% "scalatest" % "3.0.5" % "test"
)
// Shaded jar dependency
libraryDependencies ++= Seq(
"com.qubole" %% "spark-acid-shaded-dependencies" % "0.1"
)
// Remove shaded dependency jar from pom.
import scala.xml.{Node => XmlNode, NodeSeq => XmlNodeSeq, _}
import scala.xml.transform.{RewriteRule, RuleTransformer}
pomPostProcess := { (node: XmlNode) =>
new RuleTransformer(new RewriteRule {
override def transform(node: XmlNode): XmlNodeSeq = node match {
case e: Elem if e.label == "dependency" && e.child.filter(_.label == "groupId").text.mkString == "com.qubole" =>
val organization = e.child.filter(_.label == "groupId").flatMap(_.text).mkString
val artifact = e.child.filter(_.label == "artifactId").flatMap(_.text).mkString
val version = e.child.filter(_.label == "version").flatMap(_.text).mkString
Comment(s"dependency $organization#$artifact;$version has been omitted")
case _ => node
}
}).transform(node).head
}
excludeDependencies ++= Seq (
// hive
"org.apache.hive" % "hive-exec",
"org.apache.hive" % "hive-metastore",
"org.apache.hive" % "hive-jdbc",
"org.apache.hive" % "hive-service",
"org.apache.hive" % "hive-serde",
"org.apache.hive" % "hive-common",
// orc
"org.apache.orc" % "orc-core",
"org.apache.orc" % "orc-mapreduce"
)
// do not run test at assembly
test in assembly := {}
// Spark Package Section
spName := "qubole/spark-acid"
spShade := true
spAppendScalaVersion := true
credentials += Credentials(Path.userHome / ".ivy2" / ".sbtcredentials")
licenses += "Apache-2.0" -> url("http://opensource.org/licenses/Apache-2.0")
pomExtra :=
<url>https://github.com/qubole/spark-acid</url>
<scm>
<url>[email protected]:qubole/spark-acid.git</url>
<connection>scm:git:[email protected]:qubole/spark-acid.git</connection>
</scm>
<developers>
<developer>
<id>citrusraj</id>
<name>Rajkumar Iyer</name>
<url>https://github.com/citrusraj</url>
</developer>
<developer>
<id>somani</id>
<name>Abhishek Somani</name>
<url>https://github.com/somani</url>
</developer>
<developer>
<id>prakharjain09</id>
<name>Prakhar Jain</name>
<url>https://github.com/prakharjain09</url>
</developer>
</developers>
publishMavenStyle := true
bintrayReleaseOnPublish := false
import ReleaseTransformations._
// Add publishing to spark packages as another step.
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
pushChanges,
releaseStepTask(spDist),
releaseStepTask(spPublish)
)