-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
113 lines (105 loc) · 3.51 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
lazy val root = project
.in(file("."))
.enablePlugins(GitVersioning, GitBranchPrompt)
.settings(
name := "scynamo",
organization := "io.moia",
crossScalaVersions := List("2.13.15", "2.12.20"),
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) => scalacOptions_2_12
case Some((2, 13)) => scalacOptions_2_13
case _ => Seq()
}
},
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0")),
scmInfo := Some(ScmInfo(url("https://github.com/moia-oss/scynamo"), "scm:[email protected]:moia-oss/scynamo.git")),
homepage := Some(url("https://github.com/moia-oss/scynamo")),
versionScheme := Some("early-semver"),
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
"com.chuusai" %% "shapeless" % "2.3.12",
"software.amazon.awssdk" % "dynamodb" % "2.29.20",
"org.typelevel" %% "cats-core" % "2.12.0",
"org.typelevel" %% "cats-testkit-scalatest" % "2.1.5" % Test,
"org.scalacheck" %% "scalacheck" % "1.18.1" % Test,
"org.scala-lang.modules" %% "scala-collection-compat" % "2.12.0"
)
)
.settings(sbtGitSettings)
.settings(scalaFmtSettings)
.settings(sonatypeSettings)
.settings(mimaSettings)
lazy val docs = project
.in(file("scynamo-docs"))
.dependsOn(root)
.enablePlugins(MdocPlugin)
.settings(
mdocVariables := Map("VERSION" -> version.value),
publish := {},
publishLocal := {},
publishArtifact := false,
libraryDependencies += "org.scala-lang.modules" %% "scala-java8-compat" % "1.0.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",
"-Ypartial-unification",
"-Xlint"
)
lazy val scalacOptions_2_13 = Seq(
"-unchecked",
"-deprecation",
"-language:_",
"-release",
"8",
"-encoding",
"UTF-8",
"-Xfatal-warnings",
"-Ywarn-dead-code",
"-Ymacro-annotations",
"-Xlint:_,-byname-implicit,-unused",
"-Wunused:_,-imports,-synthetics",
"-Xsource:3"
)
lazy val sbtVersionRegex = "v(\\d+.\\d+.\\d+)-?(.*)?".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 scalaFmtSettings = Seq(
scalafmtOnCompile := true
)
lazy val sonatypeSettings = {
import xerial.sbt.Sonatype._
Seq(
publishTo := sonatypePublishTo.value,
sonatypeProfileName := organization.value,
publishMavenStyle := true,
sonatypeProjectHosting := Some(GitHubHosting("moia-oss", "scynamo", "[email protected]")),
credentials += Credentials(Path.userHome / ".sbt" / "sonatype_credential")
)
}
lazy val mimaSettings = Seq(
mimaPreviousArtifacts := Set.empty
)