forked from akka/alpakka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
320 lines (277 loc) · 12.6 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
lazy val modules: Seq[ProjectReference] = Seq(
amqp,
avroparquet,
awslambda,
azureStorageQueue,
cassandra,
couchbase,
csv,
dynamodb,
elasticsearch,
files,
ftp,
geode,
googleCloudPubSub,
googleCloudPubSubGrpc,
googleFcm,
hbase,
hdfs,
ironmq,
jms,
jsonStreaming,
kinesis,
kudu,
mongodb,
mqtt,
mqttStreaming,
orientdb,
reference,
s3,
springWeb,
simpleCodecs,
slick,
sns,
solr,
sqs,
sse,
text,
udp,
unixdomainsocket,
xml
)
lazy val alpakka = project
.in(file("."))
.enablePlugins(ScalaUnidocPlugin)
.disablePlugins(MimaPlugin, SitePlugin)
.aggregate(modules: _*)
.aggregate(`doc-examples`)
.settings(
onLoadMessage :=
"""
|** Welcome to the sbt build definition for Alpakka! **
|
|Useful sbt tasks:
|
| docs/previewSite - builds Paradox and Scaladoc documentation,
| starts a webserver and opens a new browser window
|
| test - runs all the tests for all of the connectors.
| Make sure to run `docker-compose up` first.
|
| mqtt/testOnly *.MqttSourceSpec - runs a single test
|
| mimaReportBinaryIssues - checks whether this current API
| is binary compatible with the released version
""".stripMargin,
// unidoc combines sources and jars from all connectors and that
// includes two incompatible versions of protobuf. Depending on the
// classpath order that might lead to scaladoc compilation errors.
// Therefore the older version is exlcuded here.
ScalaUnidoc / unidoc / fullClasspath := {
(ScalaUnidoc / unidoc / fullClasspath).value
.filterNot(_.data.getAbsolutePath.contains("protobuf-java-2.5.0.jar"))
},
ScalaUnidoc / unidoc / unidocProjectFilter := inAnyProject -- inProjects(`doc-examples`)
)
lazy val amqp = alpakkaProject("amqp", "amqp", Dependencies.Amqp)
lazy val avroparquet =
alpakkaProject("avroparquet", "avroparquet", Dependencies.AvroParquet, parallelExecution in Test := false)
lazy val awslambda = alpakkaProject("awslambda",
"aws.lambda",
Dependencies.AwsLambda,
// For mockito https://github.com/akka/alpakka/issues/390
parallelExecution in Test := false)
lazy val azureStorageQueue = alpakkaProject("azure-storage-queue", "azure.storagequeue", Dependencies.AzureStorageQueue)
lazy val cassandra = alpakkaProject("cassandra", "cassandra", Dependencies.Cassandra)
lazy val couchbase =
alpakkaProject("couchbase", "couchbase", Dependencies.Couchbase, parallelExecution in Test := false)
lazy val csv = alpakkaProject("csv", "csv", Dependencies.Csv)
lazy val dynamodb = alpakkaProject("dynamodb", "aws.dynamodb", Dependencies.DynamoDB)
lazy val elasticsearch = alpakkaProject(
"elasticsearch",
"elasticsearch",
Dependencies.Elasticsearch,
// For elasticsearch-cluster-runner https://github.com/akka/alpakka/issues/479
parallelExecution in Test := false
)
// The name 'file' is taken by `sbt.file`, hence 'files'
lazy val files = alpakkaProject("file", "file", Dependencies.File)
lazy val ftp = alpakkaProject(
"ftp",
"ftp",
Dependencies.Ftp,
parallelExecution in Test := false,
fork in Test := true,
// To avoid potential blocking in machines with low entropy (default is `/dev/random`)
javaOptions in Test += "-Djava.security.egd=file:/dev/./urandom"
)
lazy val geode =
alpakkaProject("geode", "geode", Dependencies.Geode, fork in Test := true, parallelExecution in Test := false)
lazy val googleCloudPubSub = alpakkaProject(
"google-cloud-pub-sub",
"google.cloud.pubsub",
Dependencies.GooglePubSub,
fork in Test := true,
envVars in Test := Map("PUBSUB_EMULATOR_HOST" -> "localhost:8538"),
// For mockito https://github.com/akka/alpakka/issues/390
parallelExecution in Test := false
)
lazy val googleCloudPubSubGrpc = alpakkaProject(
"google-cloud-pub-sub-grpc",
"google.cloud.pubsub.grpc",
Dependencies.GooglePubSubGrpc,
akkaGrpcCodeGeneratorSettings ~= { _.filterNot(_ == "flat_package") },
akkaGrpcGeneratedSources := Seq(AkkaGrpc.Client),
akkaGrpcGeneratedLanguages := Seq(AkkaGrpc.Scala, AkkaGrpc.Java),
javaAgents += Dependencies.GooglePubSubGrpcAlpnAgent % "test",
// for the ExampleApp in the tests
connectInput in run := true
).enablePlugins(AkkaGrpcPlugin, JavaAgent)
lazy val googleFcm = alpakkaProject(
"google-fcm",
"google.firebase.fcm",
Dependencies.GoogleFcm,
fork in Test := true
)
lazy val hbase = alpakkaProject("hbase", "hbase", Dependencies.HBase, fork in Test := true)
lazy val hdfs = alpakkaProject("hdfs", "hdfs", Dependencies.Hdfs, parallelExecution in Test := false)
lazy val ironmq = alpakkaProject("ironmq", "ironmq", Dependencies.IronMq)
lazy val jms = alpakkaProject("jms", "jms", Dependencies.Jms, parallelExecution in Test := false)
lazy val jsonStreaming = alpakkaProject("json-streaming", "json.streaming", Dependencies.JsonStreaming)
lazy val kinesis = alpakkaProject("kinesis",
"aws.kinesis",
Dependencies.Kinesis,
// For mockito https://github.com/akka/alpakka/issues/390
parallelExecution in Test := false)
lazy val kudu = alpakkaProject("kudu", "kudu", Dependencies.Kudu, fork in Test := false)
lazy val mongodb = alpakkaProject("mongodb", "mongodb", Dependencies.MongoDb)
lazy val mqtt = alpakkaProject("mqtt", "mqtt", Dependencies.Mqtt)
lazy val mqttStreaming = alpakkaProject("mqtt-streaming", "mqttStreaming", Dependencies.MqttStreaming)
lazy val mqttStreamingBench = alpakkaProject("mqtt-streaming-bench", "mqttStreamingBench", Seq.empty)
.enablePlugins(JmhPlugin)
.dependsOn(mqtt, mqttStreaming)
lazy val orientdb = alpakkaProject("orientdb",
"orientdb",
Dependencies.OrientDB,
fork in Test := true,
parallelExecution in Test := false)
lazy val reference = alpakkaProject("reference", "reference", Dependencies.Reference, publish / skip := true)
.disablePlugins(BintrayPlugin)
lazy val s3 = alpakkaProject("s3", "aws.s3", Dependencies.S3)
lazy val springWeb = alpakkaProject("spring-web", "spring.web", Dependencies.SpringWeb)
lazy val simpleCodecs = alpakkaProject("simple-codecs", "simplecodecs")
lazy val slick = alpakkaProject("slick", "slick", Dependencies.Slick)
lazy val sns = alpakkaProject("sns",
"aws.sns",
Dependencies.Sns,
// For mockito https://github.com/akka/alpakka/issues/390
parallelExecution in Test := false)
lazy val solr = alpakkaProject("solr", "solr", Dependencies.Solr, parallelExecution in Test := false)
lazy val sqs = alpakkaProject("sqs",
"aws.sqs",
Dependencies.Sqs,
// For mockito https://github.com/akka/alpakka/issues/390
parallelExecution in Test := false)
lazy val sse = alpakkaProject("sse", "sse", Dependencies.Sse)
lazy val text = alpakkaProject("text", "text")
lazy val udp = alpakkaProject("udp", "udp")
// FIXME: The exclude filter can be removed once we use JNR with
// https://github.com/jnr/jnr-enxio/pull/28 merged in.
lazy val unixdomainsocket = alpakkaProject(
"unix-domain-socket",
"unixdomainsocket",
Dependencies.UnixDomainSocket,
excludeFilter.in(unmanagedSources.in(headerCreate)) := HiddenFileFilter || "KQSelector.java"
)
lazy val xml = alpakkaProject("xml", "xml", Dependencies.Xml)
lazy val docs = project
.enablePlugins(AkkaParadoxPlugin, ParadoxSitePlugin, PreprocessPlugin, SymlinkPlugin, PublishRsyncPlugin)
.disablePlugins(BintrayPlugin, MimaPlugin)
.settings(
name := "Alpakka",
publish / skip := true,
whitesourceIgnore := true,
makeSite := makeSite.dependsOn(LocalRootProject / ScalaUnidoc / doc).value,
makeSite := {
(Symlink / symlinkCreate).value
makeSite.value
},
Symlink / symlinkPaths ++= Seq(isSnapshot.value).flatMap {
case false =>
Seq(
"api/alpakka/current" -> s"api/alpakka/${version.value}",
"docs/alpakka/current" -> s"docs/alpakka/${version.value}",
)
case true => Seq.empty
}.toMap,
Preprocess / siteSubdirName := s"api/alpakka/${if (isSnapshot.value) "snapshot" else version.value}",
Preprocess / sourceDirectory := (LocalRootProject / ScalaUnidoc / unidoc / target).value,
Preprocess / preprocessRules := Seq(
("\\.java\\.scala".r, _ => ".java")
),
Paradox / siteSubdirName := s"docs/alpakka/${if (isSnapshot.value) "snapshot" else version.value}",
Paradox / sourceDirectory := sourceDirectory.value / "main" / "paradox",
Paradox / paradoxProperties ++= Map(
"project.url" -> "https://doc.akka.io/docs/alpakka/current/",
"akka.version" -> Dependencies.AkkaVersion,
"akka-http.version" -> Dependencies.AkkaHttpVersion,
"couchbase.version" -> Dependencies.CouchbaseVersion,
"extref.akka-docs.base_url" -> s"http://doc.akka.io/docs/akka/${Dependencies.AkkaVersion}/%s",
"extref.akka-http-docs.base_url" -> s"http://doc.akka.io/docs/akka-http/${Dependencies.AkkaHttpVersion}/%s",
"extref.couchbase.base_url" -> s"https://docs.couchbase.com/java-sdk/${Dependencies.CouchbaseVersionForDocs}/%s",
"extref.java-api.base_url" -> "https://docs.oracle.com/javase/8/docs/api/index.html?%s.html",
"extref.geode.base_url" -> "https://geode.apache.org/docs/guide/18/%s",
"extref.javaee-api.base_url" -> "https://docs.oracle.com/javaee/7/api/index.html?%s.html",
"extref.paho-api.base_url" -> "https://www.eclipse.org/paho/files/javadoc/index.html?%s.html",
"extref.slick.base_url" -> s"https://slick.lightbend.com/doc/${Dependencies.SlickVersion}/%s",
"javadoc.base_url" -> "https://docs.oracle.com/javase/8/docs/api/",
"javadoc.javax.jms.base_url" -> "https://docs.oracle.com/javaee/7/api/",
"javadoc.com.couchbase.base_url" -> s"https://docs.couchbase.com/sdk-api/couchbase-java-client-${Dependencies.CouchbaseVersion}/",
"javadoc.org.apache.kudu.base_url" -> s"https://kudu.apache.org/releases/${Dependencies.KuduVersion}/apidocs/",
"javadoc.akka.base_url" -> s"http://doc.akka.io/japi/akka/${Dependencies.AkkaVersion}/",
"javadoc.akka.http.base_url" -> s"http://doc.akka.io/japi/akka-http/${Dependencies.AkkaHttpVersion}/",
"javadoc.org.apache.hadoop.base_url" -> s"https://hadoop.apache.org/docs/r${Dependencies.HadoopVersion}/api/",
"javadoc.com.amazonaws.base_url" -> "https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/",
// Eclipse Paho client for MQTT
"javadoc.org.eclipse.paho.client.mqttv3.base_url" -> "http://www.eclipse.org/paho/files/javadoc/",
"scaladoc.scala.base_url" -> s"http://www.scala-lang.org/api/current/",
"scaladoc.akka.base_url" -> s"http://doc.akka.io/api/akka/${Dependencies.AkkaVersion}",
"scaladoc.akka.http.base_url" -> s"https://doc.akka.io/api/akka-http/${Dependencies.AkkaHttpVersion}/",
"scaladoc.akka.stream.alpakka.base_url" -> {
val docsHost = sys.env
.get("CI")
.map(_ => "https://doc.akka.io")
.getOrElse(s"http://localhost:${(previewSite / previewFixedPort).value}")
s"$docsHost/api/alpakka/${if (isSnapshot.value) "snapshot" else version.value}/"
}
),
Paradox / paradoxGroups := Map("Language" -> Seq("Java", "Scala")),
resolvers += Resolver.jcenterRepo,
publishRsyncArtifact := makeSite.value -> "www/",
publishRsyncHost := "[email protected]"
)
lazy val `doc-examples` = project
.enablePlugins(AutomateHeaderPlugin)
.disablePlugins(BintrayPlugin, MimaPlugin, SitePlugin)
.dependsOn(
modules.map(p => classpathDependency(p)): _*
)
.settings(
name := s"akka-stream-alpakka-doc-examples",
publish / skip := true,
whitesourceIgnore := true,
Dependencies.`Doc-examples`
)
def alpakkaProject(projectId: String, moduleName: String, additionalSettings: sbt.Def.SettingsDefinition*): Project =
Project(id = projectId, base = file(projectId))
.enablePlugins(AutomateHeaderPlugin)
.disablePlugins(SitePlugin)
.settings(
name := s"akka-stream-alpakka-$projectId",
AutomaticModuleName.settings(s"akka.stream.alpakka.$moduleName"),
mimaPreviousArtifacts := Set(
organization.value %% name.value % previousStableVersion.value
.getOrElse(throw new Error("Unable to determine previous version"))
)
)
.settings(additionalSettings: _*)