-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathbuild.sbt
222 lines (212 loc) · 10.2 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
val V = new {
val avro4s_scala2 = "4.1.2"
val avro4s_scala3 = "5.0.14"
val awssdk = "2.30.16"
val `cats-effect` = "3.5.3"
val circe = "0.14.10"
val doobie = "1.0.0-RC7"
val `embedded-kafka` = "3.9.0"
val `embedded-kafka-schema-registry` = "7.8.0"
val http4s = "0.23.30"
val jackson = "2.18.2"
val `json-schema` = "1.14.4"
val `jsoniter-scala` = "2.33.2"
val kafka = "3.9.0"
val logback = "1.5.16"
val `log-effect` = "0.19.4"
val ocisdk = "3.55.1"
val postgresql = "42.7.5"
val scala213 = "2.13.16"
val scala3 = "3.3.5"
val `scala-collection-compat` = "2.13.0"
val slf4j = "2.0.16"
val sttp = "4.0.0-RC1"
val upickle = "4.1.0"
val vulcan = "1.11.1"
val `zio-interop` = "23.1.0.3"
val `zio-cache` = "0.2.3"
val `zio-json` = "0.7.16"
val `zio-kafka` = "2.10.0"
val `zio-nio` = "2.0.2"
val `zio-oci-objectstorage` = "0.7.3"
val `zio-s3` = "0.4.3"
}
lazy val D = new {
lazy val avro4s = new {
val scala2 = "com.sksamuel.avro4s" %% "avro4s-core" % V.avro4s_scala2
val scala3 = "com.sksamuel.avro4s" %% "avro4s-core" % V.avro4s_scala3
}
val `aws-s3` = "software.amazon.awssdk" % "s3" % V.awssdk
val `cats-effect` = "org.typelevel" %% "cats-effect" % V.`cats-effect`
val `circe-core` = "io.circe" %% "circe-core" % V.circe
val `circe-generic` = "io.circe" %% "circe-generic" % V.circe
val `circe-literal` = "io.circe" %% "circe-literal" % V.circe
val `circe-parser` = "io.circe" %% "circe-parser" % V.circe
val `doobie-core` = "org.tpolecat" %% "doobie-core" % V.doobie
val `doobie-hikari` = "org.tpolecat" %% "doobie-hikari" % V.doobie
val `embedded-kafka` =
"io.github.embeddedkafka" %% "embedded-kafka" % V.`embedded-kafka` excludeAll ("org.scala-lang.modules" % "scala-collection-compat_2.13")
val `embedded-kafka-schema-registry` =
"io.github.embeddedkafka" %% "embedded-kafka-schema-registry" % V.`embedded-kafka-schema-registry` excludeAll (
"com.github.everit-org.json-schema" % "org.everit.json.schema",
"org.scala-lang.modules" % "scala-collection-compat_2.13",
"org.slf4j" % "slf4j-log4j12"
)
val `http4s-circe` = "org.http4s" %% "http4s-circe" % V.http4s
val `http4s-dsl` = "org.http4s" %% "http4s-dsl" % V.http4s
val `http4s-ember-server` = "org.http4s" %% "http4s-ember-server" % V.http4s
val `jackson-annotations` = "com.fasterxml.jackson.core" % "jackson-annotations" % V.jackson
val `jackson-core` = "com.fasterxml.jackson.core" % "jackson-core" % V.jackson
val `jackson-databind` = "com.fasterxml.jackson.core" % "jackson-databind" % V.jackson
val `json-schema` = "com.github.everit-org.json-schema" % "org.everit.json.schema" % V.`json-schema`
val `jsoniter-scala-core` = "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % V.`jsoniter-scala`
val `jul-to-slf4j` = "org.slf4j" % "jul-to-slf4j" % V.slf4j
val `kafka-clients` = "org.apache.kafka" % "kafka-clients" % V.kafka
val `log4j-over-slf4j` = "org.slf4j" % "log4j-over-slf4j" % V.slf4j
val `logback-classic` = "ch.qos.logback" % "logback-classic" % V.logback
val `log-effect-zio` = "io.laserdisc" %% "log-effect-zio" % V.`log-effect`
val `oci-java-sdk-objectstorage` = "com.oracle.oci.sdk" % "oci-java-sdk-objectstorage" % V.ocisdk
val postgresql = "org.postgresql" % "postgresql" % V.postgresql
val `scala-collection-compat` = "org.scala-lang.modules" %% "scala-collection-compat" % V.`scala-collection-compat`
val `sttp-upickle` = "com.softwaremill.sttp.client4" %% "upickle" % V.sttp
val `sttp-zio` = "com.softwaremill.sttp.client4" %% "zio" % V.sttp
val upickle = "com.lihaoyi" %% "upickle" % V.upickle
val vulcan = "com.github.fd4s" %% "vulcan" % V.vulcan
val `vulcan-generic` = "com.github.fd4s" %% "vulcan-generic" % V.vulcan
val `zio-cache` = "dev.zio" %% "zio-cache" % V.`zio-cache`
val `zio-interop-cats` = "dev.zio" %% "zio-interop-cats" % V.`zio-interop`
val `zio-json` = "dev.zio" %% "zio-json" % V.`zio-json`
val `zio-kafka` = "dev.zio" %% "zio-kafka" % V.`zio-kafka`
val `zio-nio` = "dev.zio" %% "zio-nio" % V.`zio-nio`
val `zio-oci-objectstorage` = "io.laserdisc" %% "zio-oci-objectstorage" % V.`zio-oci-objectstorage`
val `zio-s3` = "dev.zio" %% "zio-s3" % V.`zio-s3`
}
enablePlugins(ZioSbtEcosystemPlugin)
inThisBuild(
Seq(
name := "Tamer",
zioVersion := "2.1.15",
organization := "io.laserdisc",
scalaVersion := V.scala213,
crossScalaVersions := Seq(V.scala213, V.scala3),
homepage := Some(url("https://github.com/laserdisc-io/tamer")),
Test / fork := true,
licenses += "MIT" -> url("http://opensource.org/licenses/MIT"),
developers += Developer("sirocchj", "Julien Sirocchi", "[email protected]", url("https://github.com/sirocchj")),
resolvers ++= Seq("confluent" at "https://packages.confluent.io/maven/", "jitpack" at "https://jitpack.io")
)
)
lazy val core = project
.in(file("core"))
.settings(enableZIO(enableStreaming = true))
.settings(
name := "tamer-core",
libraryDependencies ++= Seq(
D.`jackson-annotations`,
D.`jackson-core`,
D.`jackson-databind`,
D.`kafka-clients`,
D.`log-effect-zio`,
D.`sttp-upickle`,
D.`sttp-zio`,
D.upickle,
D.`zio-cache`,
D.`zio-kafka`,
// optional dependencies
D.`circe-parser` % Optional,
D.`jsoniter-scala-core` % Optional,
D.vulcan % Optional,
D.`zio-json` % Optional,
// test dependencies
D.`embedded-kafka` % Test,
D.`embedded-kafka-schema-registry` % Test,
D.`json-schema` % Test,
D.`jul-to-slf4j` % Test,
D.`log4j-over-slf4j` % Test,
D.`logback-classic` % Test
),
addDependenciesOn("3")(D.`scala-collection-compat` % Test),
addDependenciesOnOrElse("3")(D.avro4s.scala3 % Optional)(D.avro4s.scala2 % Optional)
)
lazy val db = project
.in(file("db"))
.dependsOn(core)
.settings(
name := "tamer-db",
libraryDependencies ++= Seq(
D.`doobie-core`,
D.`doobie-hikari`,
D.`zio-interop-cats`
)
)
lazy val ociObjectStorage = project
.in(file("oci-objectstorage"))
.dependsOn(core)
.settings(
name := "tamer-oci-objectstorage",
libraryDependencies ++= Seq(
D.`oci-java-sdk-objectstorage`,
D.`zio-oci-objectstorage`
)
)
lazy val s3 = project
.in(file("s3"))
.dependsOn(core)
.settings(enableZIO())
.settings(
name := "tamer-s3",
libraryDependencies ++= Seq(
D.`aws-s3`,
D.`zio-nio`, // zio-s3 brings scala-collection-compat_2.13 in scala3 build
D.`zio-s3`
)
)
lazy val rest = project
.in(file("rest"))
.dependsOn(core % "compile->compile;test->compile,test")
.settings(
name := "tamer-rest",
libraryDependencies ++= Seq(
D.`sttp-zio`,
// test dependencies
D.`circe-core` % Test,
D.`circe-generic` % Test,
D.`circe-parser` % Test,
D.`http4s-circe` % Test,
D.`http4s-dsl` % Test,
D.`http4s-ember-server` % Test,
D.`vulcan-generic` % Test,
D.`zio-interop-cats` % Test
)
)
lazy val example = project
.in(file("example"))
.enablePlugins(JavaAppPackaging)
.dependsOn(core, db, ociObjectStorage, rest, s3)
.settings(
libraryDependencies ++= Seq(
D.`circe-literal`,
D.`http4s-circe`,
D.`http4s-dsl`,
D.`http4s-ember-server`,
D.`logback-classic`,
D.postgresql,
D.`scala-collection-compat`,
D.`vulcan-generic`
),
publish / skip := true
)
lazy val tamer = project
.in(file("."))
.aggregate(core, example, db, ociObjectStorage, rest, s3)
.settings(
publish / skip := true,
addCommandAlias("fmtCheck", "scalafmtCheckAll; scalafmtSbtCheck"),
addCommandAlias("fmt", "scalafmtAll; scalafmtSbt"),
addCommandAlias("fullTest", "clean; test"),
addCommandAlias(
"setReleaseOptions",
"""set scalacOptions ++= Seq("-opt:l:method", "-opt:l:inline", "-opt-inline-from:tamer.**", "-opt-inline-from:<sources>")"""
),
addCommandAlias("releaseIt", "clean; setReleaseOptions; session list; compile; ci-release")
)