This repository has been archived by the owner on Oct 10, 2023. It is now read-only.
generated from JannikArndt/scala-start
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
128 lines (115 loc) · 3.85 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-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-http-client"), "scm:[email protected]:moia-oss/scala-http-client.git")),
homepage := Some(url("https://github.com/moia-oss/scala-http-client")),
scalaVersion := "2.13.11",
crossScalaVersions := List("2.12.18", "2.13.11"),
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 ++= akkaDependencies ++ 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 akkaVersion = "2.6.19"
val akkaHttpVersion = "10.2.10"
lazy val akkaDependencies = Seq(
"com.typesafe.akka" %% "akka-stream" % akkaVersion,
"com.typesafe.akka" %% "akka-stream-typed" % akkaVersion,
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % Test,
"com.typesafe.akka" %% "akka-http-testkit" % akkaHttpVersion % Test
)
lazy val awsJavaSdkVersion = "2.20.162"
lazy val awsDependencies = Seq(
"software.amazon.awssdk" % "core" % awsJavaSdkVersion,
"software.amazon.awssdk" % "sts" % awsJavaSdkVersion
)
lazy val testDependencies = Seq(
"org.scalatest" %% "scalatest" % "3.2.17" % Test,
"org.mockito" %% "mockito-scala" % "1.17.27" % 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.4.11" % Test
)
lazy val scalaDependencies = Seq(
"org.scala-lang.modules" %% "scala-collection-compat" % "2.11.0"
)
ThisBuild / scapegoatVersion := "2.1.3"
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-http-client", "[email protected]")),
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-http-client" % "5.0.0")
)