forked from tmtsoftware/csw-prototype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
251 lines (213 loc) · 9.14 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
import com.typesafe.sbt.SbtMultiJvm
import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys.MultiJvm
import com.typesafe.sbt.packager.archetypes.JavaAppPackaging
import sbt.Keys._
import sbt._
import com.typesafe.sbt.site.PreprocessSupport._
import Dependencies._
import Settings._
def compile(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "compile")
def test(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "test")
def runtime(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "runtime")
def container(deps: ModuleID*): Seq[ModuleID] = deps map (_ % "container")
// Need a root project for unidoc plugin, so we can merge the scaladocs
val csw = (project in file("."))
.enablePlugins(cswbuild.UnidocRoot)
.settings(UnidocRoot.settings(Nil, Nil): _*)
.settings(defaultSettings: _*)
.settings(siteSettings: _*)
.settings(
name := "CSW - TMT Common Software",
preprocessVars := Map(
"CSWSRC" -> s"https://github.com/tmtsoftware/csw/tree/${git.gitCurrentBranch.value}",
"DOCROOT" -> "latest/api/index.html"
)
).aggregate(util, support, log, loc, events, event_old, alarms, ccs, cs, pkg, ts,
containerCmd, sequencer, configServiceAnnex, csClient, hcdExample, assemblyExample,
trackLocation, asConsole, sysControl, seqSupport, javacsw
)
// Utility classes
lazy val util = project
.settings(defaultSettings: _*)
.settings(libraryDependencies ++=
compile(akkaActor, akkaHttpSprayJson, scalaReflect) ++
test(scalaTest, junit)
) dependsOn log
// AAS- Authorization and Authentication service
lazy val aas = project
.settings(defaultSettings: _*)
.settings(libraryDependencies ++=
compile(akkaActor) ++
test(scalaTest, junit)
) dependsOn log
// Database service
lazy val dbs = project
.settings(defaultSettings: _*)
.settings(libraryDependencies ++=
compile(slick, postgresql, HikariCP) ++
test(scalaTest, junit)
) dependsOn log
// Supporting classes
lazy val support = project
.settings(defaultSettings: _*)
.settings(libraryDependencies ++=
test(scalaTest)
)
// Logging support, Log service (only includes config files so far)
lazy val log = project
.settings(defaultSettings: _*)
.settings(libraryDependencies ++=
compile(akkaActor, akkaSlf4j, scalaLogging, logback, janino, logstashLogbackEncoder) ++
test(scalaTest, akkaTestKit)
)
// Event Service and Key Value Store
lazy val events = project
.settings(defaultSettings: _*)
.settings(libraryDependencies ++=
compile(akkaActor, redisScala, logback) ++
test(scalaTest, akkaTestKit)
) dependsOn(util, log, loc, trackLocation)
// Alarm Service
lazy val alarms = project
.settings(defaultSettings: _*)
.settings(libraryDependencies ++=
compile(akkaActor, akkaHttpSprayJson, redisScala, jsonSchemaValidator, ficus) ++
test(scalaTest, akkaTestKit)
) dependsOn(util, log, loc, trackLocation)
// Location Service
lazy val loc = project
.settings(defaultSettings: _*)
.settings(libraryDependencies ++=
compile(akkaActor, akkaRemote, jmdns, akkaHttp) ++
test(scalaTest, akkaTestKit)
) dependsOn log
// Command Service
lazy val ccs = project
.settings(defaultSettings: _*)
.settings(libraryDependencies ++=
compile(akkaActor, akkaSse) ++
test(scalaTest, specs2, akkaTestKit, akkaStreamTestKit, akkaHttpTestKit)
) dependsOn(log, loc, util)
// Config Service
lazy val cs = project
.settings(defaultSettings: _*)
.enablePlugins(JavaAppPackaging)
.settings(packageSettings("configService", "CSW Config Service", "Used to manage configuration files in a Git repository"): _*)
.settings(SbtMultiJvm.multiJvmSettings: _*)
.settings(configServiceDockerSettings: _*)
.dependsOn(log, loc, util, configServiceAnnex)
.enablePlugins(DockerPlugin)
.settings(libraryDependencies ++=
compile(akkaActor, akkaHttpSprayJson, jgit, svnkit, logback, akkaHttp, scopt) ++
test(scalaTest, akkaTestKit, junit, akkaMultiNodeTest)
) configs MultiJvm
// Package (Container, Component) classes
lazy val pkg = project
.settings(defaultSettings: _*)
.settings(SbtMultiJvm.multiJvmSettings: _*)
.dependsOn(log, loc, util, ccs % "test")
.settings(libraryDependencies ++=
compile(akkaActor) ++
test(scalaTest, akkaTestKit, akkaMultiNodeTest)
) configs MultiJvm
// Event Service
lazy val event_old = project
.settings(defaultSettings: _*)
.settings(libraryDependencies ++=
compile(akkaActor, akkaRemote, hornetqServer, hornetqNative, ficus) ++
test(scalaTest, akkaTestKit)
) dependsOn(util, log)
// Time Service support
lazy val ts = project
.settings(defaultSettings: _*)
.settings(libraryDependencies ++=
compile(akkaActor) ++
test(scalaTest, akkaTestKit, junit)
) dependsOn log
// Java APIs
lazy val javacsw = project
.settings(defaultSettings: _*)
.settings(// fix problems with javadoc errors?
publishArtifact in(Compile, packageDoc) := false,
publishArtifact in packageDoc := false,
sources in(Compile, doc) := Seq.empty
)
.settings(libraryDependencies ++=
compile(akkaActor) ++
test(akkaTestKit, junit, junitInterface, scalaJava8Compat, assertj)
) dependsOn(util, support, log, events, loc, ccs, cs, pkg, event_old, ts, containerCmd,
events % "test->test", alarms % "test->test;compile->compile", trackLocation % "test->test")
// Runtime library for use in sequencer scripts
lazy val seqSupport = project
.settings(defaultSettings: _*)
.settings(libraryDependencies ++=
compile(akkaActor) ++
test(akkaTestKit, junit, junitInterface, assertj)
) dependsOn(util, support, pkg, ccs, cs, loc, log, ts, events, alarms, containerCmd, hcdExample)
// -- Apps --
// Build the containerCmd command line application
lazy val containerCmd = Project(id = "containerCmd", base = file("apps/containerCmd"))
.settings(defaultSettings: _*)
.settings(libraryDependencies ++=
compile(akkaActor, akkaRemote, scopt) ++
test(scalaLogging, logback)
) dependsOn(pkg, ccs, loc, log, cs)
// Build the sequencer command line application
lazy val sequencer = Project(id = "sequencer", base = file("apps/sequencer"))
.enablePlugins(JavaAppPackaging)
.settings(packageSettings("sequencer", "CSW Sequencer", "Scala REPL for running sequences"): _*)
.settings(libraryDependencies ++=
compile(akkaActor, akkaRemote, scalaLibrary, scalaCompiler, scalaReflect, jline)
) dependsOn(pkg, cs, ccs, loc, ts, events, util, alarms, containerCmd, seqSupport)
// Build the config service annex application
lazy val configServiceAnnex = Project(id = "configServiceAnnex", base = file("apps/configServiceAnnex"))
.enablePlugins(JavaAppPackaging)
.settings(packageSettings("configServiceAnnex", "CSW Config Service Annex", "Store/retrieve large files for Config Service"): _*)
.settings(libraryDependencies ++=
compile(akkaActor, akkaRemote, akkaHttp) ++
test(scalaTest, specs2, akkaTestKit)
) dependsOn(loc, log, util)
// Track the location of an external application
lazy val trackLocation = Project(id = "trackLocation", base = file("apps/trackLocation"))
.enablePlugins(JavaAppPackaging)
.settings(packageSettings("trackLocation", "Location Service Application Tracker", "Track Location"): _*)
.settings(libraryDependencies ++=
compile(scopt, akkaActor) ++
test(scalaTest, akkaTestKit)
) dependsOn(loc, log, cs % "test->test;compile->compile")
// Track the location of an external application
lazy val asConsole = Project(id = "asConsole", base = file("apps/asConsole"))
.enablePlugins(JavaAppPackaging)
.settings(packageSettings("asConsole", "Alarm Service Console application", "Alarm Service Console"): _*)
.settings(libraryDependencies ++=
compile(scopt, akkaActor) ++
test(scalaTest, akkaTestKit)
) dependsOn(loc, log, alarms, trackLocation)
// Track the location of an external application
lazy val sysControl = Project(id = "sysControl", base = file("apps/sysControl"))
.enablePlugins(JavaAppPackaging)
.settings(packageSettings("sysControl", "System remote control for CSW services", "System Remote Control"): _*)
.settings(libraryDependencies ++=
compile(scopt, akkaActor) ++
test(scalaTest, akkaTestKit)
) dependsOn(loc, log, pkg, cs)
// Build the config service annex application
lazy val csClient = Project(id = "csClient", base = file("apps/csClient"))
.enablePlugins(JavaAppPackaging)
.settings(packageSettings("csClient", "CSW Config Service Client", "Command line client for Config Service"): _*)
.settings(libraryDependencies ++=
compile(akkaActor, akkaRemote, akkaStream, scopt) ++
test(scalaTest, specs2, akkaTestKit)
) dependsOn cs
// -- Example projects --
// HCD Example project
lazy val hcdExample = Project(id = "hcdExample", base = file("examples/hcdExample"))
.enablePlugins(JavaAppPackaging)
.settings(packageSettings("hcdExample", "HCD Example", "Simple HCD example application"): _*)
.settings(mainClass in Compile := Some("csw.examples.HCDExampleApp"))
.dependsOn(pkg, ccs, ts, events)
// Assembly Example project
lazy val assemblyExample = Project(id = "assemblyExample", base = file("examples/assemblyExample"))
.enablePlugins(JavaAppPackaging)
.settings(packageSettings("assemblyExample", "Assembly Example", "Simple Assembly example application"): _*)
.dependsOn(pkg, ccs, ts, hcdExample)