-
Notifications
You must be signed in to change notification settings - Fork 35
/
build.sbt
138 lines (102 loc) · 3.95 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
name := "parquet-index"
organization := "com.github.lightcopy"
scalaVersion := "2.12.12"
spName := "lightcopy/parquet-index"
val defaultSparkVersion = "3.0.0"
sparkVersion := sys.props.getOrElse("spark.testVersion", defaultSparkVersion)
val defaultHadoopVersion = "2.7.0"
val hadoopVersion = settingKey[String]("The version of Hadoop to test against.")
hadoopVersion := sys.props.getOrElse("hadoop.testVersion", defaultHadoopVersion)
spAppendScalaVersion := true
spIncludeMaven := false
spIgnoreProvided := true
sparkComponents := Seq("sql")
libraryDependencies ++= Seq(
"org.apache.hadoop" % "hadoop-client" % hadoopVersion.value % "test" exclude("javax.servlet", "servlet-api") force(),
"org.apache.spark" %% "spark-core" % sparkVersion.value % "test" exclude("org.apache.hadoop", "hadoop-client"),
"org.apache.spark" %% "spark-sql" % sparkVersion.value % "test" exclude("org.apache.hadoop", "hadoop-client")
)
// Test dependencies
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.2.0" % "test",
"com.novocode" % "junit-interface" % "0.11" % "test"
)
// Add Python files to the build
unmanagedResourceDirectories in Compile += {
baseDirectory.value / "python" / "src"
}
// Check deprecation without manual restart
scalacOptions in ThisBuild ++= Seq("-unchecked", "-deprecation", "-feature")
// Display full-length stacktraces from ScalaTest
testOptions in Test += Tests.Argument("-oF")
testOptions in Test += Tests.Argument(TestFrameworks.JUnit, "-a", "-v", "+q")
parallelExecution in Test := false
// Skip tests during assembly
test in assembly := {}
// Exclude scala library from assembly
assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false)
coverageHighlighting := {
if (scalaBinaryVersion.value == "2.10") false
else true
}
coverageMinimum := 80
coverageFailOnMinimum := true
EclipseKeys.eclipseOutput := Some("target/eclipse")
// Tasks dependencies
lazy val compileScalastyle = taskKey[Unit]("compileScalastyle")
compileScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Compile).toTask("").value
(compile in Compile) <<= (compile in Compile).dependsOn(compileScalastyle)
// Create a default Scala style task to run with tests
lazy val testScalastyle = taskKey[Unit]("testScalastyle")
testScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle.in(Test).toTask("").value
(test in Test) <<= (test in Test).dependsOn(testScalastyle)
/********************
* Release settings *
********************/
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (version.value.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
publishMavenStyle := true
publishArtifact in Test := false
pomIncludeRepository := { _ => false }
releaseCrossBuild := true
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))
releasePublishArtifactsAction := PgpKeys.publishSigned.value
pomExtra := (
<url>https://github.com/lightcopy/parquet-index</url>
<scm>
<url>[email protected]:lightcopy/parquet-index.git</url>
<connection>scm:git:[email protected]:lightcopy/parquet-index.git</connection>
</scm>
<developers>
<developer>
<id>sadikovi</id>
<name>Ivan Sadikov</name>
<url>https://github.com/sadikovi</url>
</developer>
</developers>
)
bintrayReleaseOnPublish in ThisBuild := false
import ReleaseTransformations._
// Add publishing to spark packages as another step.
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
setNextVersion,
commitNextVersion,
pushChanges,
releaseStepTask(spPublish)
)
// Credentials for sbt-spark-package
credentials += Credentials(Path.userHome / ".ivy2" / ".sbtcredentials")
// Credentials for publishing to sonatype
credentials += Credentials(Path.userHome / ".ivy2" / ".sonatype.sbt")