forked from lichess-org/lila
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
394 lines (320 loc) · 14.2 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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
import com.typesafe.sbt.packager.Keys.scriptClasspath
import com.typesafe.sbt.SbtScalariform.autoImport.scalariformFormat
import com.typesafe.sbt.web.SbtWeb.autoImport._
import play.Play.autoImport._
import play.sbt.PlayImport._
import PlayKeys._
import BuildSettings._
import Dependencies._
lazy val root = Project("lila", file("."))
.enablePlugins(_root_.play.sbt.PlayScala)
.dependsOn(api)
.aggregate(api)
scalaVersion := globalScalaVersion
resolvers ++= Dependencies.Resolvers.commons
scalacOptions ++= compilerOptions
incOptions := incOptions.value.withNameHashing(true)
updateOptions := updateOptions.value.withCachedResolution(true)
sources in doc in Compile := List()
// disable publishing the main API jar
publishArtifact in (Compile, packageDoc) := false
// disable publishing the main sources jar
publishArtifact in (Compile, packageSrc) := false
// don't stage the conf dir
externalizeResources := false
// shorter prod classpath
scriptClasspath := Seq("*")
// offline := true
libraryDependencies ++= Seq(
scalaz, chess, compression, scalalib, hasher, typesafeConfig, findbugs,
reactivemongo.driver, reactivemongo.iteratees, akka.actor, akka.slf4j,
maxmind, prismic, netty, guava, markdown,
kamon.core, kamon.influxdb, scalatags,
java8compat, semver, scrimage, scalaConfigs, scaffeine, lettuce, epoll
)
resourceDirectory in Assets := (sourceDirectory in Compile).value / "assets"
unmanagedResourceDirectories in Assets ++= (if (scala.sys.env.get("SERVE_ASSETS").exists(_ == "1")) Seq(baseDirectory.value / "public") else Nil)
scalariformPreferences := scalariformPrefs(scalariformPreferences.value)
excludeFilter in scalariformFormat := "*Routes*"
routesGenerator := LilaRoutesGenerator
lazy val modules = Seq(
common, db, rating, user, security, hub, socket,
message, notifyModule, i18n, game, bookmark, search,
gameSearch, timeline, forum, forumSearch, team, teamSearch,
analyse, mod, round, pool, lobby, setup,
importer, tournament, simul, relation, report, pref,
evaluation, chat, puzzle, tv, coordinate, blog,
history, video, shutup, push,
playban, insight, perfStat, slack, quote, challenge,
study, studySearch, fishnet, explorer, learn, plan,
event, coach, practice, evalCache, irwin,
activity, relay, streamer, bot
)
lazy val moduleRefs = modules map projectToRef
lazy val moduleCPDeps = moduleRefs map { new sbt.ClasspathDependency(_, None) }
lazy val api = module("api", moduleCPDeps)
.settings(
libraryDependencies ++= provided(
play.api, hasher, typesafeConfig, findbugs,
reactivemongo.driver, reactivemongo.iteratees,
kamon.core, kamon.influxdb, lettuce
),
aggregate in Runtime := false,
aggregate in Test := true // Test <: Runtime
) aggregate (moduleRefs: _*)
lazy val puzzle = module("puzzle", Seq(
common, memo, hub, history, db, user, rating, pref, tree, game
)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver, reactivemongo.iteratees)
)
lazy val quote = module("quote", Seq())
lazy val video = module("video", Seq(
common, memo, hub, db, user
)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val coach = module("coach", Seq(
common, hub, db, user, security, notifyModule
)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val streamer = module("streamer", Seq(
common, hub, db, user, notifyModule
)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val coordinate = module("coordinate", Seq(common, db)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val blog = module("blog", Seq(common, memo, timeline)).settings(
libraryDependencies ++= provided(play.api, prismic,
reactivemongo.driver, reactivemongo.iteratees)
)
lazy val evaluation = module("evaluation", Seq(
common, hub, db, user, game, analyse
)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val common = module("common", Seq()).settings(
libraryDependencies ++= provided(play.api, play.test, reactivemongo.driver, kamon.core, scalatags) ++ Seq(scaffeine)
)
lazy val rating = module("rating", Seq(common, db, memo)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val perfStat = module("perfStat", Seq(common, db, user, game, rating)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val history = module("history", Seq(common, db, memo, game, user)).settings(
libraryDependencies ++= provided(play.api, scalatags, reactivemongo.driver)
)
lazy val db = module("db", Seq(common)).settings(
libraryDependencies ++= provided(play.test, play.api, reactivemongo.driver, hasher, scrimage)
)
lazy val memo = module("memo", Seq(common, db)).settings(
libraryDependencies ++= Seq(findbugs, scaffeine, scalaConfigs) ++ provided(play.api, reactivemongo.driver)
)
lazy val search = module("search", Seq(common, hub)).settings(
libraryDependencies ++= provided(play.api)
)
lazy val chat = module("chat", Seq(common, db, user, security, i18n, socket)).settings(
libraryDependencies ++= provided(play.api, scalatags, reactivemongo.driver)
)
lazy val room = module("room", Seq(common, socket, chat)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver, lettuce)
)
lazy val timeline = module("timeline", Seq(common, db, game, user, hub, security, relation)).settings(
libraryDependencies ++= provided(play.api, play.test, reactivemongo.driver)
)
lazy val event = module("event", Seq(common, db, memo, i18n)).settings(
libraryDependencies ++= provided(play.api, play.test, scalatags, reactivemongo.driver)
)
lazy val mod = module("mod", Seq(common, db, user, hub, security, tournament, simul, game, analyse, evaluation,
report, notifyModule, history, perfStat)).settings(
libraryDependencies ++= provided(play.api, play.test, reactivemongo.driver)
)
lazy val user = module("user", Seq(common, memo, db, hub, rating, socket)).settings(
libraryDependencies ++= provided(play.api, play.test, reactivemongo.driver, hasher,
reactivemongo.iteratees // only for bcrypt migration
)
)
lazy val game = module("game", Seq(common, memo, db, hub, user, chat)).settings(
libraryDependencies ++= provided(compression, play.api, reactivemongo.driver, reactivemongo.iteratees)
)
lazy val gameSearch = module("gameSearch", Seq(common, hub, search, game)).settings(
libraryDependencies ++= provided(
play.api, reactivemongo.driver, reactivemongo.iteratees
)
)
lazy val tv = module("tv", Seq(common, db, hub, socket, game, round, user)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver, hasher)
)
lazy val bot = module("bot", Seq(common, db, hub, game, user, challenge, chat)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val analyse = module("analyse", Seq(common, hub, game, user, notifyModule, evalCache)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val round = module("round", Seq(
common, db, memo, hub, socket, game, user,
i18n, fishnet, pref, chat, history, playban, room
)).settings(
libraryDependencies ++= provided(play.api, scalatags, hasher, kamon.core,
reactivemongo.driver, reactivemongo.iteratees, lettuce)
)
lazy val pool = module("pool", Seq(common, game, user, playban)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val activity = module("activity", Seq(common, game, analyse, user, forum, study, pool, puzzle, tournament, practice, team)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val lobby = module("lobby", Seq(
common, db, memo, hub, socket, game, user,
round, timeline, relation, playban, security, pool
)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver, lettuce)
)
lazy val setup = module("setup", Seq(
common, db, memo, hub, socket, game, user, lobby, pref, relation
)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val importer = module("importer", Seq(common, game, round)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val insight = module(
"insight",
Seq(common, game, user, analyse, relation, pref, socket, round, security)
).settings(
libraryDependencies ++= provided(
play.api, reactivemongo.driver, reactivemongo.iteratees, scalatags
)
)
lazy val tournament = module("tournament", Seq(
common, hub, socket, game, round, security, chat, memo, quote, history, notifyModule, i18n, room
)).settings(
libraryDependencies ++= provided(
play.api, scalatags, reactivemongo.driver, reactivemongo.iteratees, lettuce
)
)
lazy val simul = module("simul", Seq(
common, hub, socket, game, round, chat, memo, quote, room
)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver, lettuce)
)
lazy val fishnet = module("fishnet", Seq(common, game, analyse, db, evalCache)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver, semver, lettuce)
)
lazy val irwin = module("irwin", Seq(common, db, user, game, tournament, mod)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val oauth = module("oauth", Seq(common, db, user)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val security = module("security", Seq(common, hub, db, user, i18n, slack, oauth)).settings(
libraryDependencies ++= provided(play.api, scalatags, reactivemongo.driver, maxmind, hasher)
)
lazy val shutup = module("shutup", Seq(common, db, hub, game, relation)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val challenge = module("challenge", Seq(common, db, hub, setup, game, relation, pref, socket, room)).settings(
libraryDependencies ++= provided(play.api, scalatags, reactivemongo.driver, lettuce)
)
lazy val study = module("study", Seq(
common, db, hub, socket, game, round, importer, notifyModule, relation, evalCache, explorer, i18n, room
)).settings(
libraryDependencies ++= provided(play.api, scalatags, reactivemongo.driver, lettuce)
)
lazy val relay = module("relay", Seq(common, study)).settings(
libraryDependencies ++= Seq(scalaUri) ++ provided(play.api, reactivemongo.driver, markdown)
)
lazy val studySearch = module("studySearch", Seq(common, hub, study, search)).settings(
libraryDependencies ++= provided(
play.api,
reactivemongo.driver, reactivemongo.iteratees
)
)
lazy val learn = module("learn", Seq(common, db, user)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val evalCache = module("evalCache", Seq(common, db, user, security, socket, tree)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val practice = module("practice", Seq(common, db, memo, user, study)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val playban = module("playban", Seq(common, db, game, message, chat)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val push = module("push", Seq(common, db, user, game, challenge, message)).settings(
libraryDependencies ++= Seq(googleOAuth) ++ provided(play.api, reactivemongo.driver)
)
lazy val slack = module("slack", Seq(common, hub, user)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val plan = module("plan", Seq(common, user, notifyModule)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val relation = module("relation", Seq(common, db, memo, hub, user, game, pref)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver, reactivemongo.iteratees)
)
lazy val pref = module("pref", Seq(common, db, user)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val message = module("message", Seq(common, db, user, hub, relation, security, shutup, notifyModule)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val forum = module("forum", Seq(common, db, user, security, hub, mod, notifyModule)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val forumSearch = module("forumSearch", Seq(common, hub, forum, search)).settings(
libraryDependencies ++= provided(
play.api,
reactivemongo.driver, reactivemongo.iteratees
)
)
lazy val team = module("team", Seq(common, memo, db, user, forum, security, hub, notifyModule)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver, reactivemongo.iteratees)
)
lazy val teamSearch = module("teamSearch", Seq(common, hub, team, search)).settings(
libraryDependencies ++= provided(
play.api,
reactivemongo.driver, reactivemongo.iteratees
)
)
lazy val i18n = module("i18n", Seq(common, db, user, hub)).settings(
sourceGenerators in Compile += Def.task {
MessageCompiler(
sourceDir = new File("translation/source"),
destDir = new File("translation/dest"),
dbs = List("site", "arena", "emails", "learn", "activity", "coordinates", "study"),
compileTo = (sourceManaged in Compile).value / "messages"
)
}.taskValue,
libraryDependencies ++= provided(play.api, scalatags)
)
lazy val bookmark = module("bookmark", Seq(common, memo, db, hub, user, game)).settings(
libraryDependencies ++= provided(
play.api, play.test, reactivemongo.driver
)
)
lazy val report = module("report", Seq(common, db, user, game, security, playban)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver, reactivemongo.iteratees)
)
lazy val explorer = module("explorer", Seq(common, db, game, importer)).settings(
libraryDependencies ++= provided(
play.api,
reactivemongo.driver, reactivemongo.iteratees
)
)
lazy val notifyModule = module("notify", Seq(common, db, game, user, hub, relation)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val tree = module("tree", Seq(common)).settings(
libraryDependencies ++= provided(play.api)
)
lazy val socket = module("socket", Seq(common, hub, memo, tree)).settings(
libraryDependencies ++= provided(play.api, lettuce)
)
lazy val hub = module("hub", Seq(common)).settings(
libraryDependencies ++= Seq(scaffeine) ++ provided(play.api)
)