-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sbt
82 lines (77 loc) · 2.37 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
inThisBuild(
List(
organization := "com.github.poslegm",
homepage := Some(url("https://github.com/poslegm/munit-zio/")),
licenses := List("MIT" -> url("http://opensource.org/licenses/MIT")),
developers := List(
Developer(
"poslegm",
"Mikhail Chugunkov",
url("https://github.com/poslegm")
)
)
)
)
val scala212 = "2.12.20"
val scala213 = "2.13.14"
val scala3 = "3.3.3"
lazy val Version = new {
val munit = "1.0.2"
val zio = "2.1.7"
val scalaJavaTime = "2.6.0"
}
commands += Command.command("ci-test") { s =>
val scalaVersion = sys.env.get("TEST") match {
case Some("2.12") => scala212
case Some("2.13") => scala213
case _ => scala3
}
s"++$scalaVersion" ::
"test" ::
"publishLocal" ::
s
}
lazy val core = crossProject(JVMPlatform, JSPlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(CrossType.Pure)
.in(file("core"))
.settings(
name := "munit-zio",
libraryDependencies += "com.github.sbt" % "junit-interface" % "0.13.3" % "test",
scalaVersion := scala3,
scalacOptions ++= Seq(
"-Xfatal-warnings",
"-deprecation",
"-unchecked"
),
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) =>
Seq("-Xsource:3")
case Some((2, 13)) =>
Seq(
"-Xsource:3",
"-Wdead-code",
"-Wextra-implicit",
"-Wunused",
"-Ywarn-value-discard"
)
case _ => Seq("-explain", "-source:3.0-migration")
}
},
crossScalaVersions := Seq(scala3, scala212, scala213),
libraryDependencies ++= Seq(
"org.scalameta" %%% "munit" % Version.munit,
"dev.zio" %%% "zio" % Version.zio
),
testFrameworks += new TestFramework("munit.Framework")
)
.jsSettings(
Test / parallelExecution := false, // NOTE: https://scalameta.org/munit/docs/tests.html#run-tests-in-parallel
libraryDependencies ++= Seq(
"io.github.cquiroz" %%% "scala-java-time" % Version.scalaJavaTime % Test // To run the tests in JSPlatform
)
)
addCommandAlias("fmt", """scalafmtSbt;scalafmtAll""")
addCommandAlias("fmtCheck", """scalafmtSbtCheck;scalafmtCheckAll""")