-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sbt
132 lines (123 loc) · 3.87 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
import ReleaseTransformations._
import ReleasePlugin.autoImport._
val akkaVersion = "2.6.5"
val akkaHttpVersion = "10.1.12"
val circeVersion = "0.13.0"
val scalaTestVersion = "3.1.1"
val compilerOptions = Seq(
"-deprecation",
"-encoding",
"UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-unchecked",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Xfuture",
"-Xfatal-warnings",
"-Ywarn-unused-import"
)
val buildSettings = Seq(
organization := "io.scalac",
scalaVersion := "2.13.2",
crossScalaVersions := Seq("2.12.11", "2.13.2"),
scalacOptions ++= {
if (priorTo2_13(scalaVersion.value)) compilerOptions
else
compilerOptions.flatMap {
case "-Ywarn-unused-import" => Seq("-Ywarn-unused:imports")
case "-Xfuture" => Nil
case other => Seq(other)
}
}
)
val publishSettings = Seq(
releaseUseGlobalVersion := true,
releaseVersionFile := file(".") / "version.sbt",
releaseCommitMessage := s"Set version to ${version.value}",
releaseIgnoreUntrackedFiles := true,
releaseCrossBuild := true,
homepage := Some(url("https://github.com/ScalaConsultants/akka-periscope")),
licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT")),
publishTo := sonatypePublishToBundle.value,
publishMavenStyle := true,
publishArtifact in Test := false,
scmInfo := Some(
ScmInfo(
url("https://github.com/ScalaConsultants/akka-periscope"),
"scm:git:git@github.com:ScalaConsultants/akka-periscope.git"
)
),
developers := List(
Developer(
id = "vpavkin",
name = "Vladimir Pavkin",
email = "vpavkin@gmail.com",
url = url("http://pavkin.ru")
),
Developer(
id = "jczuchnowski",
name = "Jakub Czuchnowski",
email = "jakub.czuchnowski@gmail.com",
url = url("https://github.com/jczuchnowski")
)
),
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
pushChanges
)
)
val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false
)
val core = (project in file("core"))
.settings(buildSettings: _*)
.settings(
name := "akka-periscope-core",
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"org.scalatest" %% "scalatest" % scalaTestVersion % Test,
"io.circe" %% "circe-parser" % circeVersion % Test,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % Test
)
)
.settings(publishSettings: _*)
val akkaHttp = (project in file("akka-http"))
.settings(buildSettings: _*)
.settings(
name := "akka-periscope-akka-http",
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % akkaVersion,
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"org.scalatest" %% "scalatest" % scalaTestVersion % Test,
"io.circe" %% "circe-parser" % circeVersion % Test,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % Test,
"com.typesafe.akka" %% "akka-stream-testkit" % akkaVersion % Test,
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % Test
)
)
.settings(publishSettings: _*)
.dependsOn(core % "compile->compile;test->test")
val root = (project in file("."))
.settings(buildSettings: _*)
.settings(publishSettings: _*)
.settings(noPublishSettings: _*)
.aggregate(core, akkaHttp)
def priorTo2_13(scalaVersion: String): Boolean =
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, minor)) if minor < 13 => true
case _ => false
}