-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
85 lines (77 loc) · 2.62 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
name := "blog-code-samples"
val scala2Version = "2.13.15"
val scala3Version = "3.5.2"
lazy val cats = project
.in(file("cats"))
.settings(
name := "cats",
scalaVersion := scala2Version,
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % "2.12.0",
"org.scalameta" %% "munit" % "1.0.3" % Test
)
)
val diffxVersion = "0.9.0"
lazy val scala3 = project
.in(file("scala3"))
.configs(ManualTestConfig)
.settings(
name := "scala3",
scalaVersion := scala3Version,
manualTestSettings,
libraryDependencies ++= Seq(
"com.softwaremill.diffx" %% "diffx-core" % diffxVersion,
"org.scalatest" %% "scalatest-flatspec" % "3.2.19" % Test,
"dev.zio" %% "zio" % "2.1.13",
"dev.zio" %% "zio-test" % "2.1.13" % Test
)
)
val testContainersVersion = "0.41.4"
lazy val scala2 = project
.in(file("scala2"))
.configs(IntegrationTest)
.settings(
name := "scala2",
scalaVersion := scala2Version,
Test / fork := true,
Defaults.itSettings,
libraryDependencies ++= Seq(
"com.dimafeng" %% "testcontainers-scala-scalatest" % testContainersVersion % Test,
"com.dimafeng" %% "testcontainers-scala-postgresql" % testContainersVersion % Test,
"org.tpolecat" %% "skunk-core" % "0.6.4",
"org.scalatest" %% "scalatest-flatspec" % "3.2.19" % "test,it",
"org.postgresql" % "postgresql" % "42.7.4",
"org.reactivemongo" %% "reactivemongo" % "1.0.10",
"com.dimafeng" %% "testcontainers-scala-mongodb" % testContainersVersion % Test,
"org.wvlet.airframe" %% "airframe-ulid" % "24.11.0",
"org.scalatestplus" %% "scalacheck-1-17" % "3.2.18.0" % Test,
"com.lihaoyi" %% "fansi" % "0.5.0"
)
)
lazy val ManualTestConfig = config("manual") extend (Test)
lazy val manualTestSettings = inConfig(ManualTestConfig)(Defaults.testSettings)
lazy val startEmbedMongo =
taskKey[Unit]("Start embedded mongodb for the CI tests")
lazy val port = 8765
startEmbedMongo := {
val log = streams.value.log
log.info("Starting the embedded mongodb on port: " + port)
EmbeddedMongoInstance.start(port)
}
lazy val stopEmbedMongo = taskKey[Unit]("Stop embedded mongodb after CI tests")
stopEmbedMongo := {
val log = streams.value.log
log.info("Stopping the embedded mongodb on port: " + port)
EmbeddedMongoInstance.stop(port)
}
addCommandAlias("mongoTests", ";startEmbedMongo;it:test;stopEmbedMongo")
Global / onLoad ~= { state =>
import java.nio.file._
import java.time.LocalDateTime
val dummyFile = Paths.get(".dummy")
Files.write(
dummyFile,
s"This is a dummy content written on startup : ${LocalDateTime.now}".getBytes
)
state
}