forked from moia-oss/scala-http-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
128 lines (115 loc) · 3.89 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
lazy val root = (project in file("."))
.settings(
name := "scala-pekko-http-client",
organization := "io.moia",
licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0")),
scmInfo := Some(ScmInfo(url("https://github.com/moia-oss/scala-pekko-http-client"), "scm:git@github.com:moia-oss/scala-pekko-http-client.git")),
homepage := Some(url("https://github.com/moia-oss/scala-pekko-http-client")),
scalaVersion := "2.13.15",
crossScalaVersions := List("2.12.20", "2.13.15"),
versionScheme := Some("early-semver"),
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) => scalacOptions_2_12
case Some((2, 13)) => scalacOptions_2_13
case _ => Seq()
}
},
libraryDependencies ++= pekkoDependencies ++ awsDependencies ++ testDependencies ++ loggingDependencies ++ scalaDependencies
)
.settings(sonatypeSettings: _*)
.configs(IntegrationTest)
.settings(
scalafmtOnCompile := true,
Defaults.itSettings,
IntegrationTest / scalacOptions := (Compile / scalacOptions).value.filterNot(_ == "-Ywarn-dead-code")
)
.settings(sbtGitSettings)
.enablePlugins(
GitVersioning,
GitBranchPrompt
)
.settings(mimaSettings)
val pekkoVersion = "1.1.2"
val pekkoHttpVersion = "1.1.0"
lazy val pekkoDependencies = Seq(
"org.apache.pekko" %% "pekko-stream" % pekkoVersion,
"org.apache.pekko" %% "pekko-stream-typed" % pekkoVersion,
"org.apache.pekko" %% "pekko-http" % pekkoHttpVersion,
"org.apache.pekko" %% "pekko-testkit" % pekkoVersion % Test,
"org.apache.pekko" %% "pekko-http-testkit" % pekkoHttpVersion % Test
)
lazy val awsJavaSdkVersion = "2.29.45"
lazy val awsDependencies = Seq(
"software.amazon.awssdk" % "core" % awsJavaSdkVersion,
"software.amazon.awssdk" % "sts" % awsJavaSdkVersion
)
lazy val testDependencies = Seq(
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
"org.mockito" %% "mockito-scala" % "1.17.37" % Test,
"org.mock-server" % "mockserver-netty" % "5.15.0" % Test
)
lazy val loggingDependencies = Seq(
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",
"ch.qos.logback" % "logback-classic" % "1.5.16" % Test
)
lazy val scalaDependencies = Seq(
"org.scala-lang.modules" %% "scala-collection-compat" % "2.12.0"
)
ThisBuild / scapegoatVersion := "3.1.2"
lazy val scalacOptions_2_12 = Seq(
"-unchecked",
"-deprecation",
"-language:_",
"-release",
"8",
"-encoding",
"UTF-8",
"-Xfatal-warnings",
"-Ywarn-unused-import",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-inaccessible",
"-Ywarn-infer-any",
"-Ywarn-nullary-override",
"-Ywarn-nullary-unit"
)
lazy val scalacOptions_2_13 = Seq(
"-unchecked",
"-deprecation",
"-language:_",
"-release",
"8",
"-encoding",
"UTF-8",
"-Xfatal-warnings",
"-Xlint:strict-unsealed-patmat",
"-Ymacro-annotations",
"-Ywarn-dead-code",
"-Xsource:3"
)
lazy val sonatypeSettings = {
import xerial.sbt.Sonatype._
Seq(
publishTo := sonatypePublishTo.value,
sonatypeProfileName := organization.value,
publishMavenStyle := true,
sonatypeProjectHosting := Some(GitHubHosting("moia-oss", "scala-pekko-http-client", "oss-support@moia.io")),
credentials += Credentials(Path.userHome / ".sbt" / "sonatype_credential")
)
}
lazy val sbtVersionRegex = "v([0-9]+.[0-9]+.[0-9]+)-?(.*)?".r
lazy val sbtGitSettings = Seq(
git.useGitDescribe := true,
git.baseVersion := "0.0.0",
git.uncommittedSignifier := None,
git.gitTagToVersionNumber := {
case sbtVersionRegex(v, "") => Some(v)
case sbtVersionRegex(v, "SNAPSHOT") => Some(s"$v-SNAPSHOT")
case sbtVersionRegex(v, s) => Some(s"$v-$s-SNAPSHOT")
case _ => None
}
)
lazy val mimaSettings = Seq(
mimaPreviousArtifacts := Set("io.moia" %% "scala-pekko-http-client" % "1.0.0")
)