-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.sbt
275 lines (233 loc) · 7.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
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
val scala213 = "2.13.15"
val scala3 = "3.4.3"
ThisBuild / organization := "io.higherkindness"
ThisBuild / githubOrganization := "47degrees"
ThisBuild / scalaVersion := scala3
ThisBuild / resolvers ++= Resolver.sonatypeOssRepos("snapshots")
publish / skip := true
addCommandAlias(
"all-tests",
"config/test; tests/test; tests3/test; avro-rpc-tests/test; avro-rpc-tests3/test; protobuf-rpc-tests/test; protobuf-rpc-tests3/test"
)
addCommandAlias(
"ci-test",
"scalafmtCheckAll; scalafmtSbtCheck; missinglinkCheck; mdoc; all-tests"
)
addCommandAlias(
"ci-docs",
"github; documentation3/mdoc; headerCreateAll; microsite3/publishMicrosite"
)
addCommandAlias("ci-publish", "github; ci-release")
Global / concurrentRestrictions += Tags.limit(Tags.Test, 1)
////////////////
//// COMMON ////
////////////////
lazy val `rpc-service` = projectMatrix
.in(file("modules/service"))
.settings(moduleName := "mu-rpc-service")
.settings(rpcServiceSettings)
.jvmPlatform(scalaVersions = Seq(scala3, scala213))
lazy val fs2 = projectMatrix
.in(file("modules/fs2"))
.dependsOn(`rpc-service`)
.settings(moduleName := "mu-rpc-fs2")
.settings(fs2Settings)
.jvmPlatform(scalaVersions = Seq(scala3, scala213))
lazy val config = projectMatrix
.in(file("modules/config"))
.dependsOn(`rpc-service`, server)
.settings(moduleName := "mu-config")
.settings(configSettings)
.jvmPlatform(scalaVersions = Seq(scala213))
lazy val testing = projectMatrix
.in(file("modules/testing"))
.settings(moduleName := "mu-rpc-testing")
.settings(testingSettings)
.jvmPlatform(scalaVersions = Seq(scala3, scala213))
////////////////
//// CLIENT ////
////////////////
lazy val `client-netty` = projectMatrix
.in(file("modules/client/netty"))
.dependsOn(`rpc-service`)
.settings(moduleName := "mu-rpc-client-netty")
.settings(clientNettySettings)
.jvmPlatform(scalaVersions = Seq(scala3, scala213))
lazy val `client-okhttp` = projectMatrix
.in(file("modules/client/okhttp"))
.dependsOn(`rpc-service`)
.settings(moduleName := "mu-rpc-client-okhttp")
.settings(clientOkHttpSettings)
.jvmPlatform(scalaVersions = Seq(scala3, scala213))
lazy val `client-cache` = projectMatrix
.in(file("modules/client/cache"))
.settings(moduleName := "mu-rpc-client-cache")
.settings(clientCacheSettings)
.jvmPlatform(scalaVersions = Seq(scala3, scala213))
///////////////////
//// NETTY SSL ////
///////////////////
lazy val `netty-ssl` = projectMatrix
.in(file("modules/netty-ssl"))
.settings(moduleName := "mu-rpc-netty-ssl")
.settings(nettySslSettings)
.jvmPlatform(scalaVersions = Seq(scala3, scala213))
////////////////
//// SERVER ////
////////////////
lazy val server = projectMatrix
.in(file("modules/server"))
.dependsOn(`rpc-service`)
.settings(moduleName := "mu-rpc-server")
.settings(serverSettings)
.jvmPlatform(scalaVersions = Seq(scala3, scala213))
/////////////////////
//// HEALTHCHECK ////
/////////////////////
lazy val `health-check` = projectMatrix
.in(file("modules/health-check"))
.enablePlugins(SrcGenPlugin)
.dependsOn(`rpc-service`, fs2)
.settings(healthCheckSettings)
.settings(moduleName := "mu-rpc-health-check")
.jvmPlatform(scalaVersions = Seq(scala3, scala213))
////////////////////
//// PROMETHEUS ////
////////////////////
lazy val prometheus = projectMatrix
.in(file("modules/metrics/prometheus"))
.dependsOn(`rpc-service`)
.settings(moduleName := "mu-rpc-prometheus")
.settings(prometheusMetricsSettings)
.jvmPlatform(scalaVersions = Seq(scala3, scala213))
////////////////////
//// DROPWIZARD ////
////////////////////
lazy val dropwizard = projectMatrix
.in(file("modules/metrics/dropwizard"))
.dependsOn(`rpc-service`)
.settings(moduleName := "mu-rpc-dropwizard")
.settings(dropwizardMetricsSettings)
.jvmPlatform(scalaVersions = Seq(scala3, scala213))
////////////////////
//// BENCHMARKS ////
////////////////////
lazy val `benchmarks-vnext` = projectMatrix
.in(file("benchmarks/vnext"))
.dependsOn(server)
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %% "log4cats-core" % V.log4cats,
"org.typelevel" %% "log4cats-slf4j" % V.log4cats
)
)
.settings(moduleName := "mu-benchmarks-vnext")
.settings(benchmarksSettings)
.settings(publish / skip := true)
.jvmPlatform(scalaVersions = Seq(scala213))
.enablePlugins(JmhPlugin)
///////////////
//// TESTS ////
///////////////
lazy val `test-utils` = projectMatrix
.in(file("modules/tests/utils"))
.dependsOn(crossBuiltModuleDeps: _*)
.settings(moduleName := "mu-rpc-test-utils")
.settings(publish / skip := true)
.settings(testUtilsSettings)
.jvmPlatform(scalaVersions = Seq(scala3, scala213))
lazy val tests = projectMatrix
.in(file("modules/tests"))
.dependsOn(crossBuiltModuleDeps: _*)
.dependsOn(`test-utils`)
.settings(moduleName := "mu-rpc-tests")
.settings(publish / skip := true)
.settings(testSettings)
.jvmPlatform(scalaVersions = Seq(scala3, scala213))
lazy val `protobuf-rpc-tests` = projectMatrix
.in(file("modules/tests/rpc/proto"))
.enablePlugins(SrcGenPlugin)
.dependsOn(crossBuiltModuleDeps: _*)
.dependsOn(`test-utils`)
.settings(moduleName := "mu-rpc-protobuf-tests")
.settings(publish / skip := true)
.settings(protobufRPCTestSettings)
.jvmPlatform(scalaVersions = Seq(scala3, scala213))
lazy val `avro-rpc-tests` = projectMatrix
.in(file("modules/tests/rpc/avro"))
.enablePlugins(SrcGenPlugin)
.dependsOn(crossBuiltModuleDeps: _*)
.settings(moduleName := "mu-rpc-avro-tests")
.settings(publish / skip := true)
.settings(avroRPCTestSettings)
.jvmPlatform(scalaVersions = Seq(scala3, scala213))
//////////////////////////
//// MODULES REGISTRY ////
//////////////////////////
lazy val crossBuiltModules: Seq[sbt.internal.ProjectMatrix] = Seq(
`rpc-service`,
fs2,
`client-netty`,
`client-okhttp`,
`client-cache`,
server,
dropwizard,
prometheus,
testing,
`netty-ssl`,
`health-check`
)
lazy val crossBuiltModuleDeps: Seq[
sbt.internal.MatrixClasspathDep[sbt.internal.ProjectMatrixReference]
] =
crossBuiltModules.map(m =>
sbt.internal.ProjectMatrix.MatrixClasspathDependency(m, configuration = None)
)
///////////////////
//// MICROSITE ////
///////////////////
lazy val `microsite-examples-protobuf` = projectMatrix
.in(file("microsite/examples/proto"))
.dependsOn(`rpc-service`, fs2)
.enablePlugins(SrcGenPlugin)
.settings(publish / skip := true)
.settings(protobufSrcGenSettings)
.jvmPlatform(scalaVersions = Seq(scala3))
lazy val `microsite-examples-avro` = projectMatrix
.in(file("microsite/examples/avro"))
.dependsOn(`rpc-service`)
.enablePlugins(SrcGenPlugin)
.settings(publish / skip := true)
.settings(avroSrcGenSettings)
.jvmPlatform(scalaVersions = Seq(scala3))
lazy val microsite = projectMatrix
.dependsOn(crossBuiltModuleDeps: _*)
.dependsOn(`microsite-examples-protobuf`, `microsite-examples-avro`)
.enablePlugins(MicrositesPlugin)
.enablePlugins(MdocPlugin)
.settings(docsSettings)
.settings(micrositeSettings)
.settings(publish / skip := true)
.settings(
excludeDependencies ++= Seq(
/*
* Exclude _2.13 version of these libraries,
because we also have the _3 version on the classpath.
mdoc_3 -> mdoc-cli_3 -> scalameta_2.13 -> scalapb-runtime_2.13
*/
ExclusionRule("com.thesamet.scalapb", "scalapb-runtime_2.13"),
ExclusionRule("com.thesamet.scalapb", "lenses_2.13")
)
)
.jvmPlatform(scalaVersions = Seq(scala3))
/////////////////////////////////
//// GENERATED DOCUMENTATION ////
/////////////////////////////////
lazy val documentation = projectMatrix
.enablePlugins(MdocPlugin)
.settings(
mdocOut := file("."),
mdocExtraArguments := Seq("--no-link-hygiene")
)
.settings(publish / skip := true)
.jvmPlatform(scalaVersions = Seq(scala3))