This repository has been archived by the owner on Aug 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sbt
360 lines (337 loc) · 10.4 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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
import xerial.sbt.Sonatype._
import Dependencies._
lazy val snapshot: Boolean = true
lazy val v: String = {
val vv = "0.8.5"
if (!snapshot) vv
else vv + "-SNAPSHOT"
}
lazy val scalaReflect = Def.setting {
"org.scala-lang" % "scala-reflect" % scalaVersion.value
}
organization in ThisBuild := "ua.pp.itkpi"
val ScalaVersions = Seq(`scala-2-12`, `scala-2-11`)
def sonatypeProject(id: String, base: File) =
Project(id, base)
.enablePlugins(JmhPlugin)
.settings(
name := id,
isSnapshot := snapshot,
version := v,
scalaVersion := `scala-2-12`,
crossScalaVersions := ScalaVersions,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
updateOptions := updateOptions.value.withGigahorse(false),
scalacOptions ++= Seq("-Ypartial-unification", "-feature"),
sourceDirectory in Jmh := (sourceDirectory in Test).value,
classDirectory in Jmh := (classDirectory in Test).value,
dependencyClasspath in Jmh := (dependencyClasspath in Test).value,
compile in Jmh := (compile in Jmh).dependsOn(compile in Test).value,
run in Jmh := (run in Jmh).dependsOn(Keys.compile in Jmh).evaluated,
resolvers += Resolver.sonatypeRepo("releases"),
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.8"),
libraryDependencies ++= commonDeps
)
lazy val collection_extentions = sonatypeProject(
id = "collection-extensions",
base = file("./utils/collection_extensions")
)
lazy val kernel =
sonatypeProject(id = "trembita-kernel", base = file("./kernel"))
.dependsOn(collection_extentions)
.settings(libraryDependencies ++= {
Seq("org.scalatest" %% "scalatest" % testV % "test")
})
lazy val cassandra_connector = sonatypeProject(
id = "trembita-cassandra",
base = file("./connectors/cassandra")
).dependsOn(kernel)
.settings(libraryDependencies ++= {
Seq(
Cassandra.driver
)
})
lazy val cassandra_connector_phantom =
sonatypeProject(id = "trembita-phantom", base = file("./connectors/phantom"))
.dependsOn(cassandra_connector)
.settings(libraryDependencies ++= {
Seq(
Cassandra.phantom % "provided",
Cassandra.driverExtras % "provided"
)
})
lazy val logging_commons =
sonatypeProject(id = "trembita-logging-commons", base = file("./utils/logging/commons"))
.dependsOn(kernel)
lazy val slf4j =
sonatypeProject(id = "trembita-slf4j", base = file("./utils/logging/slf4j"))
.dependsOn(kernel, logging_commons)
.settings(libraryDependencies ++= {
Seq(Utils.slf4j)
})
lazy val log4j =
sonatypeProject(id = "trembita-log4j", base = file("./utils/logging/log4j"))
.dependsOn(kernel, logging_commons)
.settings(libraryDependencies ++= {
Seq(
Utils.log4j,
Utils.log4jScala
)
})
lazy val trembita_spark =
sonatypeProject(id = "trembita-spark", base = file("./integrations/spark/core"))
.dependsOn(kernel)
.settings(
name := "trembita-spark",
version := v,
scalacOptions ++= Seq(
"-Ypartial-unification",
"-language:experimental.macros"
),
libraryDependencies ++= {
Seq(
Spark.core % "provided",
Spark.sql % "provided",
Macros.resetallattrs
)
}
)
lazy val trembita_akka_streams =
sonatypeProject(
id = "trembita-akka-streams",
base = file("./integrations/akka/streams")
).dependsOn(kernel)
.settings(
name := "trembita-akka-streams",
version := v,
scalacOptions ++= Seq("-Ypartial-unification"),
libraryDependencies ++= {
Seq(
Akka.actors,
Akka.streams,
Akka.testkit
)
}
)
lazy val seamless_akka_spark =
sonatypeProject(
id = "trembita-seamless-akka-spark",
base = file("./integrations/seamless/akka-spark")
).dependsOn(kernel, trembita_akka_streams, trembita_spark)
.settings(
name := "trembita-seamless-akka-spark",
version := v,
scalacOptions ++= Seq("-Ypartial-unification"),
libraryDependencies ++= Seq(
Spark.core % "provided",
Spark.sql % "provided"
),
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.8")
)
lazy val trembita_spark_streaming =
sonatypeProject(id = "trembita-spark-streaming", base = file("./integrations/spark/streaming"))
.dependsOn(kernel, trembita_spark)
.settings(
name := "trembita-spark-streaming",
version := v,
scalacOptions ++= Seq(
"-Ypartial-unification",
"-language:experimental.macros"
),
libraryDependencies ++= {
Seq(
Spark.core % "provided",
Spark.sql % "provided",
Spark.streaming % "provided"
)
}
)
lazy val trembita_caching =
sonatypeProject(id = "trembita-caching", base = file("./caching/kernel"))
.dependsOn(kernel)
.settings(
name := "trembita-caching",
version := v
)
lazy val trembita_caching_infinispan =
sonatypeProject(id = "trembita-caching-infinispan", base = file("./caching/infinispan"))
.dependsOn(trembita_caching)
.settings(
name := "trembita-caching-infinispan",
version := v,
libraryDependencies ++= Seq(
Infinispan.core,
Infinispan.commons,
ScalaCompat.java8compat,
Testing.mockito % "test"
)
)
lazy val trembita_java_streams =
sonatypeProject(id = "trembita-java-streams", base = file("./integrations/java/streams"))
.dependsOn(kernel)
.settings(
name := "trembita_java_streams",
version := v,
scalacOptions ++= Seq(
"-Ypartial-unification",
"-language:experimental.macros",
"-target:jvm-1.8"
),
libraryDependencies += ScalaCompat.java8compat
)
lazy val seamless_akka_infinispan =
sonatypeProject(id = "trembita-seamless-akka-infinispan", base = file("./integrations/seamless/akka-infinispan"))
.dependsOn(kernel, trembita_akka_streams, trembita_caching_infinispan)
.settings(
name := "trembita-seamless-akka-infinispan",
version := v,
scalacOptions ++= Seq(
"-Ypartial-unification",
"-language:experimental.macros",
"-target:jvm-1.8"
),
libraryDependencies ++= Seq(
ScalaCompat.java8compat,
Akka.testkit,
Testing.mockito % "test"
)
)
lazy val bench = Project(id = "trembita-bench", base = file("./bench"))
.enablePlugins(JmhPlugin)
.dependsOn(
collection_extentions,
kernel,
slf4j,
cassandra_connector,
cassandra_connector_phantom,
trembita_spark,
trembita_akka_streams,
seamless_akka_spark,
trembita_spark_streaming,
trembita_caching,
trembita_caching_infinispan,
trembita_java_streams,
seamless_akka_infinispan
)
.settings(
name := "trembita-bench",
version := v,
scalacOptions += "-Ypartial-unification",
scalaVersion := `scala-2-12`,
crossScalaVersions := ScalaVersions,
isSnapshot := snapshot,
skip in publish := true,
publish := {},
publishLocal := {},
addCompilerPlugin(
"org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full
),
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.8"),
libraryDependencies ++= {
Seq(
Spark.core,
Spark.sql,
Spark.streaming
).map(_ exclude ("org.slf4j", "log4j-over-slf4j"))
}
)
lazy val examples = Project(id = "trembita-examples", base = file("./examples"))
.dependsOn(
collection_extentions,
kernel,
slf4j,
cassandra_connector,
cassandra_connector_phantom,
trembita_spark,
trembita_akka_streams,
seamless_akka_spark,
trembita_spark_streaming,
trembita_caching,
trembita_caching_infinispan,
trembita_java_streams,
seamless_akka_infinispan
)
.settings(
name := "trembita-examples",
version := v,
scalacOptions += "-Ypartial-unification",
scalaVersion := `scala-2-12`,
crossScalaVersions := ScalaVersions,
isSnapshot := snapshot,
skip in publish := true,
publish := {},
publishLocal := {},
addCompilerPlugin(
"org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full
),
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.8"),
libraryDependencies ++= {
Seq(
Cassandra.driver,
Cassandra.driverExtras,
Cassandra.phantom,
Spark.core % "provided",
Spark.sql % "provided",
Spark.streaming % "provided",
Utils.console,
Akka.csv,
Akka.http,
Infinispan.hotrod,
Sttp.core,
Sttp.catsBackend,
Sttp.asyncHttp
).map(_ exclude ("org.slf4j", "log4j-over-slf4j"))
},
test in assembly := {},
mainClass in assembly := Some("com.examples.spark.Main"),
assemblyJarName in assembly := "trembita-spark.jar",
assemblyMergeStrategy in assembly := {
case m if m.toLowerCase.endsWith("manifest.mf") => MergeStrategy.discard
case m if m.toLowerCase.matches("meta-inf.*\\.sf$") =>
MergeStrategy.discard
case "log4j.properties" => MergeStrategy.discard
case m if m.toLowerCase.startsWith("meta-inf/services/") =>
MergeStrategy.filterDistinctLines
case "reference.conf" => MergeStrategy.concat
case m if m endsWith ".conf" => MergeStrategy.concat
case _ => MergeStrategy.first
}
)
lazy val root = Project(id = "trembita", base = file("."))
.dependsOn(bench, examples)
.aggregate(
collection_extentions,
kernel,
slf4j,
cassandra_connector,
cassandra_connector_phantom,
trembita_spark,
trembita_akka_streams,
seamless_akka_spark,
trembita_spark_streaming,
trembita_caching,
trembita_caching_infinispan,
log4j,
logging_commons,
trembita_java_streams,
seamless_akka_infinispan
)
.settings(
name := "trembita",
version := v,
scalaVersion := `scala-2-12`,
crossScalaVersions := ScalaVersions,
scalacOptions += "-Ypartial-unification",
isSnapshot := snapshot,
skip in publish := true,
publish := {},
publishLocal := {},
coverageExcludedPackages := ".*operations.*",
coverageExcludedFiles := ".*orderingInstances | .*arrows* | .*ToCaseClass* | .*22*"
)