forked from cfpb/hmda-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
270 lines (242 loc) · 8.73 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
import BuildSettings._
import Dependencies._
import sbtassembly.AssemblyPlugin.autoImport._
import spray.revolver.RevolverPlugin.autoImport.Revolver
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import io.gatling.sbt.GatlingPlugin
val commonDeps = Seq(logback, scalaTest, scalaCheck, gatling, gatlingHighcharts)
val akkaDeps = commonDeps ++ Seq(akka, akkaCluster, akkaClusterTools, akkaSlf4J, akkaStream, akkaTestkit, constructr, constructrZookeeper, akkaClusterManagement, akkaQuartzScheduler)
val akkaPersistenceDeps = akkaDeps ++ Seq(akkaPersistence, akkaStream, leveldb, leveldbjni, akkaPersistenceQuery, inMemoryPersistence, cassandraPersistence)
val httpDeps = akkaDeps ++ Seq(akkaHttp, akkaHttpJson, akkaHttpTestkit)
val scalazDeps = Seq(scalaz)
val configDeps = Seq(typesafeConfig)
val enumDeps = Seq(enumeratum)
val slickDeps = Seq(slick, slickHikariCP, h2, postgres)
val csvDeps = Seq(scalaCsv)
lazy val hmda = (project in file("."))
.settings(hmdaBuildSettings:_*)
.settings(Revolver.settings:_*)
.settings(
Seq(
assemblyJarName in assembly := {s"${name.value}.jar"},
mainClass in assembly := Some("hmda.cluster.HmdaPlatform"),
assemblyMergeStrategy in assembly := {
case "application.conf" => MergeStrategy.concat
case "application-dev.conf" => MergeStrategy.concat
case "JS_DEPENDENCIES" => MergeStrategy.concat
case "META-INF/io.netty.versions.properties" => MergeStrategy.concat
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
)
).dependsOn(cluster)
.aggregate(
modelJVM,
modelJS,
parserJVM,
parserJS,
persistenceModel,
persistence,
api,
apiModel,
query,
platformTest,
validation,
census,
publication,
cluster)
lazy val cluster = (project in file("cluster"))
.enablePlugins(GatlingPlugin)
.settings(hmdaBuildSettings: _*)
.settings(
Seq(
libraryDependencies ++= akkaDeps ++ configDeps
)
)
.dependsOn(
modelJVM % "compile->compile;test->test",
parserJVM,
apiModel,
api,
persistenceModel,
persistence,
query,
validation,
publication,
census
)
lazy val model = (crossProject in file("model"))
.settings(hmdaBuildSettings: _*)
.jvmSettings(
Seq(
libraryDependencies ++= commonDeps ++ enumDeps ++ csvDeps ++ Seq(
"org.scala-js" %% "scalajs-stubs" % scalaJSVersion % "provided"
)
)
)
.jsSettings(
scoverage.ScoverageKeys.coverageEnabled := false,
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % Version.scalaTest % "test",
"org.scalacheck" %%% "scalacheck" % Version.scalaCheck % "test",
"com.beachape" %%% "enumeratum" % Version.enumeratum
)
)
lazy val modelJVM = model.jvm
lazy val modelJS = model.js
lazy val parser = (crossProject in file("parser"))
.settings(hmdaBuildSettings: _*)
.jvmSettings(
libraryDependencies ++= commonDeps ++ scalazDeps
)
.jsSettings(
scalaJSModuleKind := ModuleKind.CommonJSModule,
scoverage.ScoverageKeys.coverageEnabled := false,
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % Version.scalaTest % "test",
"org.scalacheck" %%% "scalacheck" % Version.scalaCheck % "test",
"org.scalaz" %%% "scalaz-core" % Version.scalaz
)
)
.dependsOn(model % "compile->compile;test->test")
lazy val parserJVM = parser.jvm
lazy val parserJS = parser.js
lazy val validation = (project in file("validation"))
.settings(hmdaBuildSettings: _*)
.settings(
parallelExecution in Test := false,
libraryDependencies ++= commonDeps ++ scalazDeps ++ configDeps ++ Seq(akkaStream)
).dependsOn(parserJVM % "compile->compile;test->test")
.dependsOn(persistenceModel % "compile->compile;test->test")
lazy val loader = (project in file("loader"))
.settings(hmdaBuildSettings: _*)
.settings(Revolver.settings:_*)
.settings(
Seq(
assemblyJarName in assembly := {s"${name.value}.jar"},
mainClass in assembly := Some("hmda.loader.panel.PanelCsvLoader"),
assemblyMergeStrategy in assembly := {
case "application.conf" => MergeStrategy.concat
case "META-INF/io.netty.versions.properties" => MergeStrategy.concat
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
},
libraryDependencies ++= httpDeps,
fork in run := true
)
).dependsOn(parserJVM % "compile->compile;test->test")
.dependsOn(apiModel % "compile->compile;test->test")
.dependsOn(query)
lazy val persistenceModel = (project in file("persistence-model"))
.settings(hmdaBuildSettings:_*)
.settings(
assemblyMergeStrategy in assembly := {
case "META-INF/io.netty.versions.properties" => MergeStrategy.concat
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
},
libraryDependencies ++= akkaPersistenceDeps,
PB.targets in Compile := Seq(
scalapb.gen() -> (sourceManaged in Compile).value
)
).disablePlugins(ScoverageSbtPlugin)
.dependsOn(census % "compile->compile;test->test")
lazy val persistence = (project in file("persistence"))
.settings(hmdaBuildSettings:_*)
.settings(
resolvers += Resolver.jcenterRepo,
Seq(
assemblyMergeStrategy in assembly := {
case "application.conf" => MergeStrategy.concat
case "META-INF/io.netty.versions.properties" => MergeStrategy.concat
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
},
parallelExecution in Test := false,
libraryDependencies ++= akkaPersistenceDeps ++ Seq(alpakkaS3)
)
)
.dependsOn(validation % "compile->compile;test->test")
lazy val query = (project in file("query"))
.settings(hmdaBuildSettings:_*)
.settings(
assemblyMergeStrategy in assembly := {
case "META-INF/io.netty.versions.properties" => MergeStrategy.concat
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
},
parallelExecution in Test := false,
fork in Test := false,
libraryDependencies ++= configDeps ++ akkaPersistenceDeps ++ slickDeps ++ Seq(cassandraDriver, cassandraUnit, alpakkaCassandra, alpakkaS3)
)
.dependsOn(modelJVM % "compile->compile;test->test")
.dependsOn(persistenceModel % "compile->compile;test->test")
lazy val api = (project in file("api"))
.settings(hmdaBuildSettings: _*)
.settings(Revolver.settings:_*)
.settings(
Seq(
scoverage.ScoverageKeys.coverageExcludedPackages := "hmda.api.HmdaFilingApi;hmda.api.HmdaAdminApi",
assemblyJarName in assembly := {s"${name.value}.jar"},
mainClass in assembly := Some("hmda.api.HmdaFilingApi"),
assemblyMergeStrategy in assembly := {
case "application.conf" => MergeStrategy.concat
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
},
parallelExecution in Test := false,
libraryDependencies ++= httpDeps
//++ Seq(javaMail)
)
)
.dependsOn(persistenceModel % "compile->compile;test->test")
.dependsOn(query % "compile->compile")
.dependsOn(persistence % "compile->compile")
.dependsOn(apiModel % "compile->compile;test->test")
.dependsOn(publication % "compile->compile;test->test")
lazy val platformTest = (project in file("platform-test"))
.settings(hmdaBuildSettings: _*)
.settings(
Seq(
libraryDependencies ++= akkaDeps
)
)
.disablePlugins(ScoverageSbtPlugin)
.dependsOn(parserJVM)
lazy val census = (project in file("census"))
.settings(hmdaBuildSettings: _*)
.settings(
Seq(
mainClass in assembly := Some("TractToCbsa"),
libraryDependencies ++= commonDeps ++ csvDeps
)
).dependsOn(modelJVM % "compile->compile;test->test")
lazy val apiModel = (project in file("api-model"))
.settings(hmdaBuildSettings: _*)
.settings(
libraryDependencies ++= commonDeps ++ httpDeps
).dependsOn(modelJVM % "compile->compile;test->test")
.dependsOn(persistence % "compile->compile;test->test")
lazy val publication = (project in file("publication"))
.settings(hmdaBuildSettings: _*)
.settings(
Seq(
assemblyMergeStrategy in assembly := {
case "application.conf" => MergeStrategy.concat
case "META-INF/io.netty.versions.properties" => MergeStrategy.concat
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
},
parallelExecution in Test := true,
libraryDependencies ++= akkaPersistenceDeps ++ Seq(akkaHttpJson)
)
).dependsOn(query % "compile->compile;test->test")
.dependsOn(persistence % "compile->compile;test->test")
.dependsOn(validation % "compile->compile;test->test")