-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.sbt
179 lines (147 loc) · 4.65 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
// Copyright 2021 IBM Corp.
// SPDX-License-Identifier: Apache-2.0
name := "xskipper-core"
crossScalaVersions := Seq("2.12.8")
scalaVersion := crossScalaVersions.value.head
sparkVersion := "3.3.0"
libraryDependencies ++= Seq (
"org.apache.spark" %% "spark-hive" % sparkVersion.value % "provided",
"org.apache.spark" %% "spark-sql" % sparkVersion.value % "provided",
"org.apache.spark" %% "spark-core" % sparkVersion.value % "provided",
"org.apache.spark" %% "spark-catalyst" % sparkVersion.value % "provided",
// test dependencies
"org.scalatest" %% "scalatest" % "3.0.5" % "test",
"org.apache.spark" %% "spark-catalyst" % sparkVersion.value % "test",
"org.apache.spark" %% "spark-core" % sparkVersion.value % "test",
"org.apache.spark" %% "spark-sql" % sparkVersion.value % "test",
"org.apache.spark" %% "spark-hive" % sparkVersion.value % "test",
"com.googlecode.json-simple" % "json-simple" % "1.1" % "test",
// dependency for InMemoryKMS to test parquet encryption
"org.apache.parquet" % "parquet-hadoop" % "1.12.2" % "test",
"org.apache.parquet" % "parquet-hadoop" % "1.12.2" % "test" classifier "tests"
)
/**
* Test settings
*/
// Tests cannot be run in parallel since multiple Spark contexts cannot run in the same JVM.
parallelExecution in Test := false
fork in Test := true
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oDG")
// Configurations to speed up tests and reduce memory footprint
javaOptions in Test ++= Seq(
"-Dspark.ui.enabled=false",
"-Dspark.ui.showConsoleProgress=false",
"-Xmx1024m"
)
/**
* ScalaStyle settings
*/
scalastyleConfig := baseDirectory.value / "scalastyle-config.xml"
// Run each test in different JVM
testGrouping in Test := (definedTests in Test).value map { test =>
Tests.Group(name = test.name, tests = Seq(test), runPolicy = Tests.SubProcess(
ForkOptions(
javaHome.value,
outputStrategy.value,
Nil,
Some(baseDirectory.value),
javaOptions.value,
connectInput.value,
envVars.value
)))
}
// Run as part of compile task
lazy val compileScalastyle = taskKey[Unit]("compileScalastyle")
compileScalastyle := scalastyle.in(Compile).toTask("").value
(compile in Compile) := ((compile in Compile) dependsOn compileScalastyle).value
// Run as part of test task
lazy val testScalastyle = taskKey[Unit]("testScalastyle")
testScalastyle := scalastyle.in(Test).toTask("").value
(test in Test) := ((test in Test) dependsOn testScalastyle).value
/**
* Spark Packages settings
*/
spName := "xskipper-io/xskipper-core"
spAppendScalaVersion := true
spIncludeMaven := true
spIgnoreProvided := true
packageBin in Compile := spPackage.value
/*
* Doc settings
*/
scalacOptions in (Compile, doc) ++= Seq(
"-no-link-warnings" // Suppresses problems with Scaladoc @throws links
)
/**
* Release settings
*/
organization := "io.xskipper"
organizationName := "xskipper"
organizationHomepage := Some(url("https://github.com/xskipper-io"))
description := "Xskipper: An Indexing Subsystem for Apache Spark"
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"))
homepage := Some(url("https://github.com/xskipper-io/xskipper"))
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value) {
Some("snapshots" at nexus + "content/repositories/snapshots")
} else {
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
}
credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org",
System.getenv("NEXUS_USER"), System.getenv("NEXUS_PW"))
releasePublishArtifactsAction := PgpKeys.publishSigned.value
publishMavenStyle := true
releaseCrossBuild := true
scmInfo := Some(
ScmInfo(
url("https://github.com/xskipper-io/xskipper"),
"scm:[email protected]:xskipper-io/xskipper.git"
)
)
developers := List(
Developer(
id = "guykhazma",
name = "Guy Khazma",
email = "",
url = url("https://github.com/guykhazma")
),
Developer(
id = "gallushi",
name = "Gal Lushi",
email = "",
url = url("https://github.com/gallushi")
),
Developer(
id = "oshritf",
name = "Oshrit Feder",
email = "",
url = url("https://github.com/oshritf")
),
Developer(
id = "paulata",
name = "Paula Ta-Shma",
email = "",
url = url("https://github.com/paulata")
),
Developer(
id = "ymoatti",
name = "Yosef Moatti",
email = "",
url = url("https://github.com/ymoatti")
)
)
import ReleaseTransformations._
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
setNextVersion,
commitNextVersion
)