-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
130 lines (95 loc) · 3.66 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
name := "spark-hosvd"
organization := "com.github.sadikovi"
scalaVersion := "2.11.7"
spName := "sadikovi/spark-hosvd"
val defaultSparkVersion = "2.2.1"
sparkVersion := sys.props.getOrElse("spark.testVersion", defaultSparkVersion)
val defaultHadoopVersion = "2.6.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("mllib")
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "2.2.4" % "test"
)
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-mllib" % sparkVersion.value % "test" exclude("org.apache.hadoop", "hadoop-client")
)
// check deprecation without manual restart
scalacOptions in ThisBuild ++= Seq("-unchecked", "-deprecation", "-feature")
// Display full-length stacktraces from ScalaTest
testOptions in Test += Tests.Argument("-oF")
parallelExecution in Test := false
fork in Test := true // to run tests in a separate JVM
javaOptions += "-Xmx4G" // increase maximum heap size for forked processes
// Skip tests during assembly
test in assembly := {}
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/sadikovi/spark-hosvd</url>
<scm>
<url>[email protected]:sadikovi/spark-hosvd.git</url>
<connection>scm:git:[email protected]:sadikovi/spark-hosvd.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")