-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.sbt
68 lines (64 loc) · 2.25 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
val zioVersion = "2.0.0"
val zioRSVersion = "2.0.0"
val slickVersion = "3.4.1"
val scalaTestVersion = "3.1.1"
inThisBuild(
List(
organization := "io.scalac",
homepage := Some(url("https://github.com/ScalaConsultants/zio-slick-interop")),
licenses := List("MIT" -> url("https://opensource.org/licenses/MIT")),
developers := List(
Developer(
id = "jczuchnowski",
name = "Jakub Czuchnowski",
email = "[email protected]",
url = url("https://github.com/jczuchnowski")
)
)
)
)
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 root = (project in file("."))
.settings(
name := "zio-slick-interop",
scalaVersion := "2.13.10",
crossScalaVersions := Seq("2.12.17", "2.13.10"),
// JavaConverters ¯\_(ツ)_/¯
Test / scalacOptions ~= (_ filterNot (_ == "-Xfatal-warnings")),
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)
}
},
testFrameworks := Seq(new TestFramework("zio.test.sbt.ZTestFramework")),
libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % slickVersion % Provided,
"dev.zio" %% "zio" % zioVersion % Provided,
"dev.zio" %% "zio-interop-reactivestreams" % zioRSVersion % Provided,
"org.scala-lang.modules" %% "scala-collection-compat" % "2.9.0" % Test,
"com.h2database" % "h2" % "2.1.214" % Test,
"dev.zio" %% "zio-test-sbt" % zioVersion % Test
)
)
def priorTo2_13(scalaVersion: String): Boolean =
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, minor)) if minor < 13 => true
case _ => false
}