-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
113 lines (87 loc) · 2.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
name := "online-stats"
organization := "org.tupol"
scalaVersion := "2.11.12"
crossScalaVersions := Seq("2.11.12", "2.12.6")
// ------------------------------
// DEPENDENCIES AND RESOLVERS
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.0.1" % "test",
"org.scalacheck" %% "scalacheck" % "1.14.0" % "test",
"org.apache.commons" % "commons-math3" % "3.2" % "test"
)
// ------------------------------
// TESTING
parallelExecution in Test := false
fork in Test := true
publishArtifact in Test := true
// ------------------------------
// TEST COVERAGE
scoverage.ScoverageKeys.coverageExcludedPackages := "org.apache.spark.ml.param.shared.*"
scoverage.ScoverageKeys.coverageExcludedFiles := ".*BuildInfo.*"
// ------------------------------
// PUBLISHING
isSnapshot := version.value.trim.endsWith("SNAPSHOT")
useGpg := true
// Nexus (see https://www.scala-sbt.org/1.x/docs/Using-Sonatype.html)
publishTo := {
val repo = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at repo + "content/repositories/snapshots")
else
Some("releases" at repo + "service/local/staging/deploy/maven2")
}
publishArtifact in Test := true
publishMavenStyle := true
pomIncludeRepository := { _ => false }
licenses := Seq("MIT-style" -> url("https://opensource.org/licenses/MIT"))
homepage := Some(url("https://github.com/tupol/spark-utils"))
scmInfo := Some(
ScmInfo(
url("https://github.com/tupol/spark-utils.git"),
"scm:[email protected]:tupol/spark-utils.git"
)
)
developers := List(
Developer(
id = "tupol",
name = "Tupol",
email = "[email protected]",
url = url("https://github.com/tupol")
)
)
releasePublishArtifactsAction := PgpKeys.publishSigned.value
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion, // performs the initial git checks
tagRelease,
releaseStepCommand(s"""sonatypeOpen "${organization.value}" "${name.value} v${version.value}""""),
releaseStepCommand("+publishSigned"),
releaseStepCommand("+sonatypeRelease"),
setNextVersion,
commitNextVersion,
pushChanges // also checks that an upstream branch is properly configured
)
// ------------------------------
// BUILD-INFO
lazy val root = (project in file(".")).
enablePlugins(BuildInfoPlugin).
settings(
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoPackage := "org.tupol.stats.info"
)
buildInfoKeys ++= Seq[BuildInfoKey](
resolvers,
libraryDependencies in Test,
BuildInfoKey.map(name) { case (k, v) => "project" + k.capitalize -> v.capitalize },
BuildInfoKey.action("buildTime") {
System.currentTimeMillis
} // re-computed each time at compile
)
buildInfoOptions += BuildInfoOption.BuildTime
buildInfoOptions += BuildInfoOption.ToMap
buildInfoOptions += BuildInfoOption.ToJson