This repository was archived by the owner on Nov 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
Expand file tree
/
Copy pathbuild.sbt
More file actions
315 lines (263 loc) · 9.32 KB
/
build.sbt
File metadata and controls
315 lines (263 loc) · 9.32 KB
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
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import sbt.Keys._
import scala.language.postfixOps
import scalariform.formatter.preferences._
organization in ThisBuild := "io.vamp"
name := """vamp"""
version in ThisBuild := VersionHelper.versionByTag // version based on env VAMP_VERSION and "git describe"
scalaVersion := "2.12.8"
scalaVersion in ThisBuild := scalaVersion.value
description in ThisBuild := """Vamp"""
organizationName in ThisBuild := "Magnetic.io"
organizationHomepage in ThisBuild := Some(url("http://magnetic.io"))
bintrayOrganization in ThisBuild := Some("magnetic-io")
bintrayRepository in ThisBuild := "vamp"
licenses in ThisBuild += ("Apache-2.0", url("https://opensource.org/licenses/Apache-2.0"))
resolvers in ThisBuild ++= Seq(
Resolver.typesafeRepo("releases"),
Resolver.sonatypeRepo("releases"),
Resolver.jcenterRepo
)
// Libraries
val akka = "com.typesafe.akka" %% "akka-stream" % "2.5.9" ::
"com.typesafe.akka" %% "akka-actor" % "2.5.9" ::
"com.typesafe.akka" %% "akka-http" % "10.0.11" ::
"com.typesafe.akka" %% "akka-parsing" % "10.0.11" ::
"ch.megard" %% "akka-http-cors" % "0.2.2" ::
("com.typesafe.akka" %% "akka-slf4j" % "2.5.9" exclude("org.slf4j", "slf4j-api")) :: Nil
val bouncyCastle =
"org.bouncycastle" % "bcprov-jdk15on" % "1.61" ::
"org.bouncycastle" % "bcprov-ext-jdk15on" % "1.61" ::
"org.bouncycastle" % "bcpkix-jdk15on" % "1.61" :: Nil
val json4s = "org.json4s" %% "json4s-native" % "3.5.0" ::
"org.json4s" %% "json4s-core" % "3.5.0" ::
"org.json4s" %% "json4s-ext" % "3.5.0" :: Nil
val snakeYaml = "org.yaml" % "snakeyaml" % "1.16" :: Nil
val kamon = ("io.kamon" %% "kamon-core" % "0.6.4" excludeAll ExclusionRule(organization = "com.typesafe.akka")) ::
"org.slf4j" % "jul-to-slf4j" % "1.7.21" :: Nil
val logging = "org.slf4j" % "slf4j-api" % "1.7.21" ::
"ch.qos.logback" % "logback-classic" % "1.2.0" ::
("com.typesafe.scala-logging" %% "scala-logging" % "3.5.0" exclude("org.slf4j", "slf4j-api")) :: Nil
val testing = "junit" % "junit" % "4.11" % "test" ::
"org.scalatest" %% "scalatest" % "3.0.1" % "test" ::
"org.scalacheck" %% "scalacheck" % "1.13.4" % "test" ::
"com.typesafe.akka" %% "akka-testkit" % "2.5.9" % "test" :: Nil
val templating = Seq(
"org.jtwig" % "jtwig-core" % "5.87.0.RELEASE" exclude("com.google.guava", "guava"),
"com.google.guava" % "guava" % "27.1-jre"
)
val sql = Seq(
"org.postgresql" % "postgresql" % "42.2.5",
"mysql" % "mysql-connector-java" % "8.0.16",
"com.microsoft.sqlserver" % "mssql-jdbc" % "7.2.2.jre8" excludeAll ExclusionRule(organization = "org.bouncycastle"),
"org.xerial" % "sqlite-jdbc" % "3.19.3"
) ++ bouncyCastle
val caching = Seq("com.github.cb372" %% "scalacache-caffeine" % "0.22.0")
val config = Seq("com.typesafe" % "config" % "1.3.1")
val redislbs = Seq("com.github.etaty" %% "rediscala" % "1.8.0")
val zookeeperlbs = Seq("org.apache.zookeeper" % "zookeeper" % "3.5.5"
exclude("org.slf4j", "slf4j-log4j12") exclude("log4j", "log4j"))
val apache = Seq("org.apache.commons" % "commons-dbcp2" % "2.0.1")
val k8s = Seq(
"io.kubernetes" % "client-java" % "2.0.0" excludeAll ExclusionRule(organization = "org.bouncycastle")
) ++ bouncyCastle
val natslibs = Seq(
"io.nats" % "java-nats-streaming" % "2.1.2" exclude("io.nats", "jnats"),
"io.nats" % "jnats" % "2.1.0"
)
// Force scala version for the dependencies
dependencyOverrides in ThisBuild ++= Set(
"org.scala-lang" % "scala-compiler" % scalaVersion.value,
"org.scala-lang" % "scala-library" % scalaVersion.value
)
lazy val formatting = scalariformSettings ++ Seq(ScalariformKeys.preferences := ScalariformKeys.preferences.value
.setPreference(CompactControlReadability, true)
.setPreference(AlignParameters, true)
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(DoubleIndentClassDeclaration, true)
.setPreference(DanglingCloseParenthesis, Preserve)
.setPreference(RewriteArrowSymbols, true))
lazy val root = project.in(file(".")).settings(
// Disable publishing root empty pom
packagedArtifacts in RootProject(file(".")) := Map.empty,
// allows running main classes from subprojects
run := {
(run in bootstrap in Compile).evaluated
},
publishLocal := {},
publish := { },
bintrayUnpublish := {}
).aggregate(
common,
persistence,
model,
operation,
bootstrap,
container_driver,
workflow_driver,
pulse,
http_api,
gateway_driver,
dcos,
elasticsearch,
nats,
haproxy,
redis,
zookeeper,
consul,
etcd,
kubernetes)
lazy val bootstrap = project.settings(packAutoSettings).settings(
description := "Bootstrap for Vamp",
name := "vamp-bootstrap",
formatting,
bintrayRepository := "vamp"
).dependsOn(common,
persistence,
model,
operation,
container_driver,
workflow_driver,
pulse,
http_api,
gateway_driver,
dcos,
elasticsearch,
nats,
haproxy,
redis,
zookeeper,
consul,
etcd,
kubernetes)
lazy val http_api = project.settings(
description := "Http Api for Vamp",
name := "vamp-http_api",
formatting,
libraryDependencies ++= testing,
bintrayRepository := "vamp"
).dependsOn(operation)
lazy val operation = project.settings(
description := "The control center of Vamp",
name := "vamp-operation",
formatting,
libraryDependencies ++= testing,
bintrayRepository := "vamp"
).dependsOn(persistence, container_driver, workflow_driver, gateway_driver, pulse)
lazy val pulse = project.settings(
description := "Enables Vamp to connect to event storage - Elasticsearch",
name := "vamp-pulse",
formatting,
libraryDependencies ++= testing,
bintrayRepository := "vamp"
).dependsOn(model)
lazy val gateway_driver = project.settings(
description := "Enables Vamp to talk to Vamp Gateway Agent",
name := "vamp-gateway_driver",
formatting,
libraryDependencies ++= testing,
bintrayRepository := "vamp"
).dependsOn(model, pulse, persistence)
lazy val container_driver = project.settings(
description := "Enables Vamp to talk to container managers",
name := "vamp-container_driver",
formatting,
libraryDependencies ++= testing,
bintrayRepository := "vamp"
).dependsOn(model, persistence, pulse)
lazy val workflow_driver = project.settings(
description := "Enables Vamp to talk to workflow managers",
name := "vamp-workflow_driver",
formatting,
libraryDependencies ++= testing,
bintrayRepository := "vamp"
).dependsOn(model, pulse, persistence, container_driver)
lazy val persistence = project.settings(
description := "Stores Vamp artifacts",
name := "vamp-persistence",
formatting,
libraryDependencies ++= testing ++ sql ++ apache,
bintrayRepository := "vamp"
).dependsOn(model, pulse)
lazy val model = project.settings(
description := "Definitions of Vamp artifacts",
name := "vamp-model",
formatting,
libraryDependencies ++= testing,
bintrayRepository := "vamp"
).dependsOn(common)
lazy val common = project.settings(
description := "Vamp common",
name := "vamp-common",
formatting,
libraryDependencies ++= akka ++ json4s ++ snakeYaml ++ kamon ++ logging ++ caching ++ config ++ testing,
bintrayRepository := "vamp"
)
lazy val dcos = project.settings(
description := "Container driver for DCOS and Marathon/Mesos",
name := "vamp-dcos",
formatting,
libraryDependencies ++= testing,
bintrayRepository := "vamp"
).dependsOn(pulse, workflow_driver, container_driver)
lazy val elasticsearch = project.settings(
description := "Pulse and metrics driver for Elasticsearch",
name := "vamp-elasticsearch",
formatting,
libraryDependencies ++= testing,
bintrayRepository := "vamp"
).dependsOn(pulse, persistence)
lazy val nats = project.settings(
description := "Pulse and metrics driver for Nats",
name := "vamp-nats",
formatting,
libraryDependencies ++= testing ++ natslibs ++ bouncyCastle,
bintrayRepository := "vamp"
).dependsOn(pulse)
lazy val haproxy = project.settings(
description := "HAProxy driver",
name := "vamp-haproxy",
formatting,
libraryDependencies ++= testing ++ templating,
bintrayRepository := "vamp"
).dependsOn(gateway_driver)
lazy val redis = project.settings(
description := "Redis driver for VAMP",
name := "vamp-redis",
formatting,
libraryDependencies ++= testing ++ redislbs,
bintrayRepository := "vamp"
).dependsOn(persistence)
lazy val zookeeper = project.settings(
description := "Zookeeper driver for VAMP K/V Store",
name := "vamp-zookeeper",
formatting,
libraryDependencies ++= testing ++ zookeeperlbs,
bintrayRepository := "vamp"
).dependsOn(persistence)
lazy val consul = project.settings(
description := "Driver for Consul",
name := "vamp-consul",
formatting,
libraryDependencies ++= testing,
bintrayRepository := "vamp"
).dependsOn(persistence)
lazy val etcd = project.settings(
description := "Driver for ETCD",
name := "vamp-etcd",
formatting,
libraryDependencies ++= testing,
bintrayRepository := "vamp"
).dependsOn(persistence)
lazy val kubernetes = project.settings(
description := "Container driver for Kubernetes",
name := "vamp-kubernetes",
formatting,
libraryDependencies ++= k8s ++ testing,
bintrayRepository := "vamp"
).dependsOn(pulse, workflow_driver, container_driver)
// Java version and encoding requirements
scalacOptions += "-target:jvm-1.8"
javacOptions ++= Seq("-encoding", "UTF-8")
scalacOptions in ThisBuild ++= Seq(Opts.compile.deprecation, Opts.compile.unchecked) ++
Seq("-Ywarn-unused-import", "-Ywarn-unused", "-Xlint", "-feature")