forked from UltimateSoftware/surge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
173 lines (153 loc) · 5.82 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
// Copyright © 2017-2021 UKG Inc. <https://www.ukg.com>
import Dependencies.autoImport.OpenTelemetry.{ HoneycombSample, JaegerSample }
import sbt.Keys._
ThisBuild / scalaVersion := "2.13.7"
ThisBuild / crossScalaVersions := Seq("2.13.7", "2.12.15")
ThisBuild / dynverSonatypeSnapshots := true
publish / skip := true
lazy val unitTest = taskKey[Unit]("Runs only the unit tests")
val multiJvmTestSettings = Seq(
unitTest := {
implicit val display: Show[Def.ScopedKey[_]] = Project.showContextKey(state.value)
val testResultLogger = TestResultLogger.Default.copy(printNoTests = TestResultLogger.const(_.info("No tests to run for test:unitTest scope")))
testResultLogger.run(streams.value.log, (Test / executeTests).value, "test:unitTest")
},
// Override default definition of test so that sbt test runs both unit and multi-jvm tests
Test / test := {
(Test / unitTest).value
// FIXME fix multi-jvm tests running on GH Actions
// (MultiJvm / test).value
})
lazy val `surge-serialization` =
(project in file("modules/serialization"))
.settings(multiJvmTestSettings, libraryDependencies ++= Seq(scalaCollectionCompat, scalatest, scalatestPlusMockito, mockitoCore, PlayFramework.json))
lazy val `surge-common` = (project in file("modules/common"))
.settings(
multiJvmTestSettings,
libraryDependencies ++= Seq(
Akka.actor,
Akka.multiNodeTestkit,
Akka.remote,
Akka.jacksonSerialization,
Akka.clusterSharding,
Akka.kafkaStream,
Akka.kafkaStreamTestKit,
Kafka.kafkaClients,
Kafka.kafkaStreams,
Kafka.kafkaStreamsScala,
Kafka.kafkaStreamsTestUtils,
OpenTelemetry.api,
OpenTelemetry.sdk,
OpenTelemetry.sdkTesting,
PlayFramework.json,
typesafeConfig,
Akka.akkaStreamTestKit,
embeddedKafka,
junit,
logbackForTesting,
scalatest,
scalatestPlusMockito,
mockitoCore))
.enablePlugins(MultiJvmPlugin)
.configs(MultiJvm)
.dependsOn(`surge-metrics`, `surge-serialization`)
lazy val `surge-engine-command-core` = (project in file("modules/command-engine/core"))
.settings(
multiJvmTestSettings,
libraryDependencies ++= Seq(
Akka.actor,
Akka.remote,
Kafka.kafkaClients,
Akka.testKit,
Akka.multiNodeTestkit,
Akka.akkaStreamTestKit,
Akka.kafkaClusterSharding,
Akka.management,
Akka.managementClusterHttp,
Akka.managementClusterBootstrap,
Akka.discovery,
mockitoCore,
scalatest,
scalatestPlusMockito,
embeddedKafka,
OpenTelemetry.api,
logbackForTesting,
typesafeConfig))
.enablePlugins(MultiJvmPlugin)
.configs(MultiJvm)
.dependsOn(`surge-common` % "compile->compile;test->test")
lazy val `surge-engine-command-scaladsl` = (project in file("modules/command-engine/scaladsl")).dependsOn(`surge-engine-command-core`)
lazy val `surge-engine-command-javadsl` =
(project in file("modules/command-engine/javadsl"))
.dependsOn(`surge-engine-command-core`)
.settings(libraryDependencies ++= Seq(scalatest, scalatestPlusMockito, mockitoCore))
lazy val `surge-engine-multilanguage-protocol` =
(project in file("modules/multilanguage-protocol")).enablePlugins(AkkaGrpcPlugin)
lazy val `surge-engine-multilanguage` =
(project in file("modules/multilanguage"))
.dependsOn(`surge-engine-command-scaladsl`, `surge-engine-multilanguage-protocol`)
.settings(
libraryDependencies ++= Seq(Akka.discovery, Akka.slf4j, Akka.http, logbackForTesting, slf4jApi, Akka.testKit, scalatest, embeddedKafka),
publish / skip := true)
.enablePlugins(JavaServerAppPackaging)
lazy val `surge-engine-multilanguage-scala-sdk` =
(project in file("modules/multilanguage-scala-sdk"))
.settings(publish / skip := true)
.dependsOn(`surge-engine-multilanguage-protocol`)
.enablePlugins(AkkaGrpcPlugin)
lazy val `surge-engine-multilanguage-scala-sdk-sample` =
(project in file("modules/multilanguage-scala-sdk-sample"))
.settings(
libraryDependencies ++= Seq(Akka.http, Akka.discovery, Akka.stream, Akka.protobufV3, Akka.slf4j, logbackForTesting, slf4jApi, json4s),
publish / skip := true)
.dependsOn(`surge-engine-multilanguage-scala-sdk`)
.enablePlugins(JavaServerAppPackaging)
lazy val `surge-metrics` = (project in file("modules/metrics")).settings(
libraryDependencies ++= Seq(
Akka.actor,
Akka.testKit,
Kafka.kafkaClients,
PlayFramework.json,
scalaCollectionCompat,
slf4jApi,
typesafeConfig,
scalatest,
scalatestPlusMockito,
mockitoCore))
lazy val `surge-docs` = (project in file("modules/surge-docs"))
.dependsOn(`surge-common`, `surge-engine-command-core`, `surge-engine-command-javadsl`, `surge-engine-command-scaladsl`, `surge-metrics`)
.enablePlugins(ParadoxPlugin, ParadoxSitePlugin, GhpagesPlugin)
.settings(
compileOrder := CompileOrder.JavaThenScala,
publish / skip := true,
paradoxTheme := Some(builtinParadoxTheme("generic")),
libraryDependencies ++= Seq(
typesafeConfig,
embeddedKafka,
logbackForTesting,
scalatest,
scalatestPlusMockito,
mockitoCore,
HoneycombSample.sdk,
HoneycombSample.exporter,
HoneycombSample.grpc,
JaegerSample.sdk,
JaegerSample.exporter,
JaegerSample.grpc))
lazy val `surge` = project
.in(file("."))
.aggregate(
`surge-serialization`,
`surge-common`,
`surge-engine-command-core`,
`surge-engine-command-javadsl`,
`surge-engine-command-scaladsl`,
`surge-metrics`,
`surge-docs`,
`surge-engine-multilanguage-protocol`,
`surge-engine-multilanguage`,
`surge-engine-multilanguage-scala-sdk`,
`surge-engine-multilanguage-scala-sdk-sample`)
.settings(publish / skip := true)
.disablePlugins(MimaPlugin)
addCommandAlias("codeFormat", ";headerCreate;test:headerCreate;scalafmtAll;scalafmtSbt")