-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sbt
312 lines (267 loc) · 9.22 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
import java.io.File
import java.util.UUID
import com.amazonaws.auth.STSAssumeRoleSessionCredentialsProvider
// At the root of the repository is a directory containing index configurations
// In "Real Life" the indices are configured at deploy time, so the applications
// do not need them. However, they are needed in some projects for creating
// ephemeral indices for testing.
lazy val indexConfigDir =
settingKey[File]("Folder in which index configurations are found")
Global / indexConfigDir := baseDirectory.value / "index_config"
def setupProject(
project: Project,
folder: String,
localDependencies: Seq[Project] = Seq(),
externalDependencies: Seq[ModuleID] = Seq()
): Project = {
val dependsOn = localDependencies
.map {
project: Project =>
ClasspathDependency(
project = project,
configuration = Some("compile->compile;test->test")
)
}
project
.in(new File(folder))
.settings(Common.settings: _*)
.enablePlugins(DockerComposePlugin)
.enablePlugins(JavaAppPackaging)
.dependsOn(dependsOn: _*)
.settings(libraryDependencies ++= externalDependencies)
}
lazy val internal_model = setupProject(
project,
"common/internal_model",
externalDependencies = CatalogueDependencies.internalModelDependencies
).settings(
// Only needed for generating ephemeral indices for testing
Test / unmanagedResourceDirectories += indexConfigDir.value
)
lazy val display_model = setupProject(
project,
folder = "common/display_model",
localDependencies = Seq(internal_model),
externalDependencies = CatalogueDependencies.displayModelDependencies
)
lazy val lambda = setupProject(
project,
"common/lambda",
externalDependencies = CatalogueDependencies.lambdaDependencies
)
lazy val flows = setupProject(
project,
"common/flows",
externalDependencies = CatalogueDependencies.flowDependencies
)
lazy val source_model = setupProject(
project,
folder = "common/source_model",
localDependencies = Seq(internal_model),
externalDependencies = CatalogueDependencies.sourceModelDependencies
)
lazy val source_model_typesafe = setupProject(
project,
folder = "common/source_model_typesafe",
localDependencies = Seq(source_model),
externalDependencies = CatalogueDependencies.sourceModelTypesafeDependencies
)
lazy val pipeline_storage = setupProject(
project,
"common/pipeline_storage",
localDependencies = Seq(internal_model, flows),
externalDependencies = CatalogueDependencies.pipelineStorageDependencies
)
lazy val pipeline_storage_typesafe = setupProject(
project,
"common/pipeline_storage_typesafe",
localDependencies = Seq(pipeline_storage),
externalDependencies =
CatalogueDependencies.pipelineStorageTypesafeDependencies
)
lazy val id_minter = setupProject(
project,
"pipeline/id_minter",
localDependencies = Seq(internal_model, pipeline_storage_typesafe),
externalDependencies = CatalogueDependencies.idminterDependencies
)
lazy val ingestor_common = setupProject(
project,
"pipeline/ingestor/ingestor_common",
localDependencies = Seq(pipeline_storage_typesafe, display_model),
externalDependencies = WellcomeDependencies.elasticsearchTypesafeLibrary
)
lazy val ingestor_works = setupProject(
project,
"pipeline/ingestor/ingestor_works",
localDependencies = Seq(ingestor_common)
)
lazy val ingestor_images = setupProject(
project,
"pipeline/ingestor/ingestor_images",
localDependencies = Seq(ingestor_common)
)
lazy val matcher = setupProject(
project,
"pipeline/matcher_merger/matcher",
localDependencies = Seq(internal_model, pipeline_storage_typesafe),
externalDependencies = CatalogueDependencies.matcherDependencies
)
lazy val merger = setupProject(
project,
"pipeline/matcher_merger/merger",
localDependencies = Seq(internal_model, matcher, pipeline_storage_typesafe),
externalDependencies = CatalogueDependencies.mergerDependencies
)
lazy val path_concatenator = setupProject(
project,
"pipeline/relation_embedder/path_concatenator",
localDependencies = Seq(internal_model, pipeline_storage_typesafe),
externalDependencies = CatalogueDependencies.pathConcatenatorDependencies
)
lazy val relation_embedder = setupProject(
project,
"pipeline/relation_embedder/relation_embedder",
localDependencies = Seq(internal_model, pipeline_storage_typesafe, lambda)
)
lazy val router = setupProject(
project,
"pipeline/relation_embedder/router",
localDependencies = Seq(internal_model, pipeline_storage_typesafe),
externalDependencies = CatalogueDependencies.routerDependencies
)
lazy val batcher = setupProject(
project,
"pipeline/relation_embedder/batcher",
localDependencies = Seq(lambda)
)
lazy val reindex_worker = setupProject(
project,
"reindexer/reindex_worker",
localDependencies = Seq(source_model),
externalDependencies = CatalogueDependencies.reindexWorkerDependencies
)
lazy val transformer_common = setupProject(
project,
"pipeline/transformer/transformer_common",
localDependencies =
Seq(internal_model, source_model_typesafe, pipeline_storage_typesafe),
externalDependencies = CatalogueDependencies.transformerCommonDependencies
)
lazy val transformer_marc_common = setupProject(
project,
folder = "pipeline/transformer/transformer_marc_common",
localDependencies = Seq(transformer_common),
externalDependencies = CatalogueDependencies.transformerMarcCommonDependencies
)
lazy val transformer_marc_xml = setupProject(
project,
folder = "pipeline/transformer/transformer_marc_xml",
localDependencies = Seq(transformer_marc_common),
externalDependencies = CatalogueDependencies.transformerMarcXMLDependencies
)
lazy val transformer_ebsco = setupProject(
project,
folder = "pipeline/transformer/transformer_ebsco",
localDependencies = Seq(transformer_marc_xml)
)
lazy val transformer_miro = setupProject(
project,
folder = "pipeline/transformer/transformer_miro",
localDependencies = Seq(transformer_common),
externalDependencies = CatalogueDependencies.miroTransformerDependencies
)
lazy val transformer_sierra = setupProject(
project,
folder = "pipeline/transformer/transformer_sierra",
localDependencies = Seq(transformer_common, transformer_marc_common),
externalDependencies = CatalogueDependencies.sierraTransformerDependencies
)
lazy val transformer_mets = setupProject(
project,
folder = "pipeline/transformer/transformer_mets",
localDependencies = Seq(transformer_common),
externalDependencies = CatalogueDependencies.metsTransformerDependencies
)
lazy val transformer_calm = setupProject(
project,
folder = "pipeline/transformer/transformer_calm",
localDependencies = Seq(transformer_common),
externalDependencies = CatalogueDependencies.calmTransformerDependencies
)
lazy val transformer_tei = setupProject(
project,
folder = "pipeline/transformer/transformer_tei",
localDependencies = Seq(transformer_common)
)
// Sierra adapter
lazy val sierra_merger = setupProject(
project,
"sierra_adapter/sierra_merger",
localDependencies = Seq(source_model_typesafe),
externalDependencies = CatalogueDependencies.sierraMergerDependencies
)
lazy val sierra_linker = setupProject(
project,
folder = "sierra_adapter/sierra_linker",
localDependencies = Seq(source_model),
externalDependencies = CatalogueDependencies.sierraLinkerDependencies
)
lazy val sierra_indexer = setupProject(
project,
folder = "sierra_adapter/sierra_indexer",
localDependencies = Seq(source_model, pipeline_storage_typesafe),
externalDependencies = CatalogueDependencies.sierraIndexerDependencies
)
// METS adapter
lazy val mets_adapter = setupProject(
project,
folder = "mets_adapter/mets_adapter",
localDependencies = Seq(source_model, flows),
externalDependencies = CatalogueDependencies.metsAdapterDependencies
)
// CALM adapter
lazy val calm_api_client = setupProject(
project,
folder = "calm_adapter/calm_api_client",
localDependencies = Seq(source_model, flows),
externalDependencies = CatalogueDependencies.calmApiClientDependencies
)
lazy val calm_adapter = setupProject(
project,
folder = "calm_adapter/calm_adapter",
localDependencies =
Seq(calm_api_client, internal_model, source_model_typesafe)
)
lazy val calm_deletion_checker = setupProject(
project,
folder = "calm_adapter/calm_deletion_checker",
localDependencies = Seq(calm_api_client, source_model_typesafe),
externalDependencies = ExternalDependencies.scalacheckDependencies
)
lazy val calm_indexer = setupProject(
project,
folder = "calm_adapter/calm_indexer",
localDependencies = Seq(source_model),
externalDependencies = CatalogueDependencies.calmIndexerDependencies
)
// Inference manager
lazy val inference_manager = setupProject(
project,
folder = "pipeline/inferrer/inference_manager",
localDependencies = Seq(internal_model, pipeline_storage_typesafe),
externalDependencies = CatalogueDependencies.inferenceManagerDependencies
)
// TEI adapter
lazy val tei_id_extractor = setupProject(
project,
folder = "tei_adapter/tei_id_extractor",
localDependencies = Seq(flows, source_model),
externalDependencies = CatalogueDependencies.teiIdExtractorDependencies
)
lazy val tei_adapter = setupProject(
project,
folder = "tei_adapter/tei_adapter",
localDependencies = Seq(source_model, flows),
externalDependencies = CatalogueDependencies.teiAdapterServiceDependencies
)