forked from zio/zio-petclinic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
102 lines (95 loc) · 4.75 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
ThisBuild / scalaVersion := "2.13.8"
ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / organization := "com.example"
ThisBuild / organizationName := "example"
val animusVersion = "0.1.15" // animation library for Laminar
val flywayVersion = "8.5.12" // manages database migrations
val laminarVersion = "0.14.2" // functional reactive programming (FRP) library
val postgresVersion = "42.3.6" // Java database connectivity (JDBC) driver for PostgreSQL
val scalaJavaTimeVersion = "2.4.0" // an implementation of the java.time package for Scala
val slf4jVersion = "1.7.36" // logging framework
val sttpClientVersion = "3.6.2" // an API for describing HTTP requests and how to handle responses
val waypointVersion = "0.5.0" // router for Laminar for URL matching and managing URL transitions
val zioHttpVersion = "2.0.0-RC9" // HTTP client library for ZIO
val zioJsonVersion = "0.3.0-RC8" // JSON serialization library for ZIO
val zioLoggingVersion = "2.0.0-RC10" // logging library for ZIO
val zioQuillVersion = "4.0.0-RC1" // compile-time database query library for ZIO
val zioTestContainersVersion = "0.6.0" // library fro testing database queries with ZIO
val zioVersion = "2.0.0-RC6" // Scala library for asynchronous and concurrent programming
val zioMetricsConnectorsVersion = "2.0.0-RC6" // metrics library for ZIO
Global / onChangedBuildSource := ReloadOnSourceChanges
val sharedSettings = Seq(
libraryDependencies ++= Seq(
"dev.zio" %%% "zio-json" % zioJsonVersion
),
scalacOptions ++= Seq(
"-deprecation",
"-encoding",
"utf8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xfatal-warnings",
"-Ymacro-annotations"
)
)
lazy val root = (project in file("."))
.aggregate(backend, frontend, shared)
.settings(name := "pet-clinic")
lazy val backend = (project in file("backend"))
.settings(
name := "pet-clinic-backend",
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-macros" % zioVersion,
"dev.zio" %% "zio-metrics-connectors" % zioMetricsConnectorsVersion,
"dev.zio" %% "zio-test" % zioVersion % Test,
"dev.zio" %% "zio-test-sbt" % zioVersion % Test,
"io.d11" %% "zhttp" % zioHttpVersion,
"io.getquill" %% "quill-jdbc-zio" % zioQuillVersion,
"org.postgresql" % "postgresql" % postgresVersion,
"org.flywaydb" % "flyway-core" % flywayVersion,
"io.github.scottweaver" %% "zio-2-0-testcontainers-postgresql" % zioTestContainersVersion,
"io.github.scottweaver" %% "zio-2-0-db-migration-aspect" % zioTestContainersVersion,
"dev.zio" %% "zio-logging-slf4j" % zioLoggingVersion,
"org.slf4j" % "slf4j-api" % slf4jVersion,
"org.slf4j" % "slf4j-simple" % slf4jVersion
),
Test / fork := true,
testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework")
)
.enablePlugins(JavaAppPackaging)
.settings(sharedSettings)
.enablePlugins(FlywayPlugin)
.settings(
flywayUrl := "jdbc:postgresql://localhost:5432/postgres",
flywayUser := "postgres",
flywayPassword := ""
)
.dependsOn(shared)
lazy val frontend = (project in file("frontend"))
.enablePlugins(ScalaJSPlugin)
.settings(
name := "pet-clinic-frontend",
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule) },
scalaJSUseMainModuleInitializer := true,
scalaJSLinkerConfig ~= { _.withSourceMap(false) },
libraryDependencies ++= Seq(
"com.raquo" %%% "laminar" % laminarVersion,
"io.github.kitlangton" %%% "animus" % animusVersion,
"com.raquo" %%% "waypoint" % waypointVersion,
"io.github.cquiroz" %%% "scala-java-time" % scalaJavaTimeVersion,
"com.softwaremill.sttp.client3" %%% "core" % sttpClientVersion
)
)
.settings(sharedSettings)
.dependsOn(shared)
lazy val shared = (project in file("shared"))
.enablePlugins(ScalaJSPlugin)
.settings(
scalaJSLinkerConfig ~= { _.withSourceMap(false) },
scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule) }
)
.settings(sharedSettings)