lila/build.sbt

418 lines
11 KiB
Plaintext
Raw Normal View History

2017-08-23 18:43:12 -06:00
import com.typesafe.sbt.packager.Keys.scriptClasspath
import BuildSettings._
import Dependencies._
lazy val root = Project("lila", file("."))
.enablePlugins(PlayScala, if (useEpoll) PlayNettyServer else PlayAkkaHttpServer)
.disablePlugins(if (useEpoll) PlayAkkaHttpServer else PlayNettyServer)
.dependsOn(api)
.aggregate(api)
2017-08-23 18:47:35 -06:00
2020-01-05 09:00:50 -07:00
version := lilaVersion
2017-08-23 18:47:35 -06:00
scalaVersion := globalScalaVersion
resolvers ++= Dependencies.Resolvers.commons
// don't deploy doc
sources in (Compile, doc) := Seq.empty
2017-08-23 18:47:35 -06:00
publishArtifact in (Compile, packageDoc) := false
// disable publishing the main sources jar
publishArtifact in (Compile, packageSrc) := false
2019-12-12 19:54:07 -07:00
PlayKeys.playDefaultPort := 9663
2017-08-23 18:47:35 -06:00
// don't stage the conf dir
2019-11-28 11:20:59 -07:00
PlayKeys.externalizeResources := false
2017-08-23 18:47:35 -06:00
// shorter prod classpath
scriptClasspath := Seq("*")
// give a fake assets dir to make sure they're not packaged
resourceDirectory in Assets := baseDirectory.value / "public-nothanks"
2019-12-12 22:03:38 -07:00
// don't make an assets jar
PlayKeys.generateAssetsJar := false
2019-12-13 22:07:42 -07:00
// who needs JS routes right?
routesGenerator := LilaRoutesGenerator
2020-01-05 08:47:14 -07:00
maintainer := "contact@lichess.org"
2019-12-12 22:03:38 -07:00
// format: off
2017-08-23 18:47:35 -06:00
libraryDependencies ++= Seq(
2019-11-30 15:45:44 -07:00
macwire.macros, macwire.util, play.json, jodaForms, ws,
2019-11-28 11:20:59 -07:00
scalaz, chess, compression, scalalib, hasher,
reactivemongo.driver, maxmind, prismic, scalatags,
2020-03-07 10:37:31 -07:00
kamon.core, kamon.influxdb, kamon.metrics, kamon.prometheus,
2020-03-12 09:58:44 -06:00
scrimage, scaffeine, lettuce
2020-04-29 08:58:36 -06:00
) ++ {
if (useEpoll) Seq(epoll, reactivemongo.epoll)
else Seq.empty
}
2019-12-08 12:02:47 -07:00
2017-08-23 18:43:12 -06:00
lazy val modules = Seq(
common, db, rating, user, security, hub, socket,
2020-01-27 16:14:40 -07:00
msg, notifyModule, i18n, game, bookmark, search,
2017-08-23 18:43:12 -06:00
gameSearch, timeline, forum, forumSearch, team, teamSearch,
analyse, mod, round, pool, lobby, setup,
2019-07-15 03:57:45 -06:00
importer, tournament, simul, relation, report, pref,
2019-03-26 01:07:41 -06:00
evaluation, chat, puzzle, tv, coordinate, blog,
2017-08-23 18:43:12 -06:00
history, video, shutup, push,
playban, insight, perfStat, slack, quote, challenge,
study, studySearch, fishnet, explorer, learn, plan,
event, coach, practice, evalCache, irwin,
2020-04-28 19:22:38 -06:00
activity, relay, streamer, bot, clas, swiss
2017-08-23 18:43:12 -06:00
)
lazy val moduleRefs = modules map projectToRef
lazy val moduleCPDeps = moduleRefs map { new sbt.ClasspathDependency(_, None) }
2019-12-07 21:02:59 -07:00
lazy val api = module("api",
2019-12-07 21:03:58 -07:00
moduleCPDeps,
Seq(play.api, play.json, hasher, kamon.core, kamon.influxdb, lettuce) ++ reactivemongo.bundle
2019-12-07 21:02:59 -07:00
).settings(
aggregate in Runtime := false,
aggregate in Test := true // Test <: Runtime
) aggregate (moduleRefs: _*)
lazy val i18n = module("i18n",
Seq(common, db, hub),
2019-12-07 21:03:58 -07:00
Seq(scalatags)
2019-12-07 21:02:59 -07:00
).settings(
sourceGenerators in Compile += Def.task {
MessageCompiler(
sourceDir = new File("translation/source"),
destDir = new File("translation/dest"),
2020-04-20 07:21:33 -06:00
dbs = "site arena emails learn activity coordinates study class contact patron coach broadcast streamer tfa settings preferences team perfStat search tourname faq".split(' ').toList,
compileTo = (sourceManaged in Compile).value
2019-12-07 21:02:59 -07:00
)
2020-04-29 08:58:36 -06:00
}.taskValue
2019-12-07 21:02:59 -07:00
)
2017-08-23 18:43:12 -06:00
2019-12-07 20:23:31 -07:00
lazy val puzzle = module("puzzle",
2019-12-07 21:03:58 -07:00
Seq(common, memo, hub, history, db, user, rating, pref, tree, game),
reactivemongo.bundle
2019-11-28 11:20:59 -07:00
)
2019-12-07 20:23:31 -07:00
lazy val quote = module("quote",
2019-12-07 21:03:58 -07:00
Seq(),
2019-12-07 20:23:31 -07:00
Seq()
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val video = module("video",
2019-12-07 21:03:58 -07:00
Seq(common, memo, hub, db, user),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val coach = module("coach",
2019-12-07 21:03:58 -07:00
Seq(common, hub, db, user, security, notifyModule),
reactivemongo.bundle
2017-12-27 21:56:36 -07:00
)
2019-12-07 20:23:31 -07:00
lazy val streamer = module("streamer",
2019-12-07 21:03:58 -07:00
Seq(common, hub, db, user, notifyModule),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val coordinate = module("coordinate",
Seq(common, db, user),
2019-12-07 21:03:58 -07:00
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val blog = module("blog",
2019-12-07 21:03:58 -07:00
Seq(common, memo, timeline),
Seq(prismic, specs2) ++ flexmark.bundle ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val evaluation = module("evaluation",
2019-12-07 21:03:58 -07:00
Seq(common, hub, db, user, game, analyse),
2019-12-14 07:51:39 -07:00
Seq(specs2) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val common = module("common",
2019-12-07 21:03:58 -07:00
Seq(),
2019-12-14 07:51:39 -07:00
Seq(kamon.core, scalatags, jodaForms, scaffeine, specs2) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val rating = module("rating",
Seq(common, db, memo, i18n),
2019-12-07 21:03:58 -07:00
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val perfStat = module("perfStat",
2019-12-07 21:03:58 -07:00
Seq(common, db, user, game, rating),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val history = module("history",
2019-12-07 21:03:58 -07:00
Seq(common, db, memo, game, user),
Seq(scalatags) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val db = module("db",
2019-12-07 21:03:58 -07:00
Seq(common),
Seq(hasher, scrimage) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val memo = module("memo",
2019-12-07 21:03:58 -07:00
Seq(common, db),
Seq(scaffeine, scalatest, akkatestkit) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val search = module("search",
2019-12-07 21:03:58 -07:00
Seq(common, hub),
Seq()
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val chat = module("chat",
2019-12-07 21:03:58 -07:00
Seq(common, db, user, security, i18n, socket),
Seq(scalatags) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val room = module("room",
2019-12-07 21:03:58 -07:00
Seq(common, socket, chat),
Seq(lettuce) ++ reactivemongo.bundle
2019-10-18 13:45:47 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val timeline = module("timeline",
2019-12-07 21:03:58 -07:00
Seq(common, db, game, user, hub, security, relation),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val event = module("event",
Seq(common, db, memo, i18n, user),
2019-12-07 21:03:58 -07:00
Seq(scalatags) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val mod = module("mod",
2020-02-27 19:50:36 -07:00
Seq(common, db, user, hub, security, tournament, simul, game, analyse, evaluation, report, notifyModule, history, perfStat, slack),
2019-12-07 21:03:58 -07:00
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val user = module("user",
2019-12-07 21:03:58 -07:00
Seq(common, memo, db, hub, rating, socket),
2019-12-14 07:51:39 -07:00
Seq(hasher, specs2) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val game = module("game",
2019-12-07 21:03:58 -07:00
Seq(common, memo, db, hub, user, chat),
2019-12-14 07:51:39 -07:00
Seq(compression, specs2) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val gameSearch = module("gameSearch",
2019-12-07 21:03:58 -07:00
Seq(common, hub, search, game),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val tv = module("tv",
2019-12-07 21:03:58 -07:00
Seq(common, db, hub, socket, game, round, user),
Seq(hasher) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val bot = module("bot",
2019-12-07 21:03:58 -07:00
Seq(common, db, hub, game, user, challenge, chat),
reactivemongo.bundle
2018-04-15 15:26:36 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val analyse = module("analyse",
2019-12-07 21:03:58 -07:00
Seq(common, hub, game, user, notifyModule, evalCache),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val round = module("round",
2019-12-07 21:03:58 -07:00
Seq(common, db, memo, hub, socket, game, user, i18n, fishnet, pref, chat, history, playban, room),
Seq(scalatags, hasher, kamon.core, lettuce) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val pool = module("pool",
2019-12-07 21:03:58 -07:00
Seq(common, game, user, playban),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val activity = module("activity",
2019-12-07 21:03:58 -07:00
Seq(common, game, analyse, user, forum, study, pool, puzzle, tournament, practice, team),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val lobby = module("lobby",
2019-12-07 21:03:58 -07:00
Seq(common, db, memo, hub, socket, game, user, round, timeline, relation, playban, security, pool),
Seq(lettuce) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val setup = module("setup",
2019-12-07 21:03:58 -07:00
Seq(common, db, memo, hub, socket, game, user, lobby, pref, relation),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val importer = module("importer",
2019-12-07 21:03:58 -07:00
Seq(common, game, round),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val insight = module("insight",
2019-12-07 21:03:58 -07:00
Seq(common, game, user, analyse, relation, pref, socket, round, security),
Seq(scalatags) ++ reactivemongo.bundle
2019-12-07 20:23:31 -07:00
)
2017-08-23 18:43:12 -06:00
2019-12-07 20:23:31 -07:00
lazy val tournament = module("tournament",
2019-12-07 21:03:58 -07:00
Seq(common, hub, socket, game, round, security, chat, memo, quote, history, notifyModule, i18n, room),
Seq(scalatags, lettuce) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2020-04-28 19:22:38 -06:00
lazy val swiss = module("swiss",
Seq(common, hub, socket, game, round, security, chat, memo, i18n, room),
Seq(scalatags, lettuce) ++ reactivemongo.bundle
)
2019-12-07 20:23:31 -07:00
lazy val simul = module("simul",
2019-12-07 21:03:58 -07:00
Seq(common, hub, socket, game, round, chat, memo, quote, room),
Seq(lettuce) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val fishnet = module("fishnet",
2019-12-07 21:03:58 -07:00
Seq(common, game, analyse, db, evalCache),
2019-12-14 07:51:39 -07:00
Seq(lettuce, specs2) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val irwin = module("irwin",
2019-12-07 21:03:58 -07:00
Seq(common, db, user, game, tournament, mod),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val oauth = module("oauth",
2019-12-07 21:03:58 -07:00
Seq(common, db, user),
reactivemongo.bundle
)
2019-12-07 20:23:31 -07:00
lazy val security = module("security",
2019-12-07 21:03:58 -07:00
Seq(common, hub, db, user, i18n, slack, oauth),
2019-12-14 07:51:39 -07:00
Seq(scalatags, maxmind, hasher, specs2) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val shutup = module("shutup",
2019-12-07 21:03:58 -07:00
Seq(common, db, hub, game, relation),
2019-12-14 07:51:39 -07:00
Seq(specs2) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val challenge = module("challenge",
2019-12-07 21:03:58 -07:00
Seq(common, db, hub, setup, game, relation, pref, socket, room),
Seq(scalatags, lettuce) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val study = module("study",
2019-12-07 21:03:58 -07:00
Seq(common, db, hub, socket, game, round, importer, notifyModule, relation, evalCache, explorer, i18n, room),
2019-12-14 07:51:39 -07:00
Seq(scalatags, lettuce, specs2) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val relay = module("relay",
2019-12-07 21:03:58 -07:00
Seq(common, study),
Seq(scalaUri) ++ flexmark.bundle ++ reactivemongo.bundle
2017-09-19 20:24:59 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val studySearch = module("studySearch",
2019-12-07 21:03:58 -07:00
Seq(common, hub, study, search),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val learn = module("learn",
2019-12-07 21:03:58 -07:00
Seq(common, db, user),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val evalCache = module("evalCache",
2019-12-07 21:03:58 -07:00
Seq(common, db, user, security, socket, tree),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val practice = module("practice",
2019-12-07 21:03:58 -07:00
Seq(common, db, memo, user, study),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val playban = module("playban",
2020-01-26 22:07:27 -07:00
Seq(common, db, game, msg, chat),
2019-12-07 21:03:58 -07:00
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val push = module("push",
2020-01-27 16:14:40 -07:00
Seq(common, db, user, game, challenge, msg),
2019-12-14 07:51:39 -07:00
Seq(googleOAuth) ++ reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val slack = module("slack",
2019-12-07 21:03:58 -07:00
Seq(common, hub, user),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val plan = module("plan",
2019-12-07 21:03:58 -07:00
Seq(common, user, notifyModule),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val relation = module("relation",
2019-12-07 21:03:58 -07:00
Seq(common, db, memo, hub, user, game, pref),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val pref = module("pref",
2019-12-07 21:03:58 -07:00
Seq(common, db, user),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2020-01-24 13:10:07 -07:00
lazy val msg = module("msg",
2020-01-27 07:52:23 -07:00
Seq(common, db, user, hub, relation, security, shutup, notifyModule, chat),
2020-01-24 13:10:07 -07:00
reactivemongo.bundle
)
2019-12-07 20:23:31 -07:00
lazy val forum = module("forum",
2019-12-07 21:03:58 -07:00
Seq(common, db, user, security, hub, mod, notifyModule),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val forumSearch = module("forumSearch",
2019-12-07 21:03:58 -07:00
Seq(common, hub, forum, search),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val team = module("team",
2019-12-07 21:03:58 -07:00
Seq(common, memo, db, user, forum, security, hub, notifyModule),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val teamSearch = module("teamSearch",
2019-12-07 21:03:58 -07:00
Seq(common, hub, team, search),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2020-01-16 07:40:33 -07:00
lazy val clas = module("clas",
2020-01-27 15:03:57 -07:00
Seq(common, memo, db, user, security, msg, history, puzzle),
flexmark.bundle ++ reactivemongo.bundle
2020-01-16 07:40:33 -07:00
)
2019-12-07 20:23:31 -07:00
lazy val bookmark = module("bookmark",
2019-12-07 21:03:58 -07:00
Seq(common, memo, db, hub, user, game),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val report = module("report",
2019-12-07 21:03:58 -07:00
Seq(common, db, user, game, security, playban),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val explorer = module("explorer",
2019-12-07 21:03:58 -07:00
Seq(common, db, game, importer),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val notifyModule = module("notify",
2019-12-07 21:03:58 -07:00
Seq(common, db, game, user, hub, relation),
reactivemongo.bundle
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val tree = module("tree",
2019-12-07 21:03:58 -07:00
Seq(common),
Seq()
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val socket = module("socket",
2019-12-07 21:03:58 -07:00
Seq(common, hub, memo, tree),
Seq(lettuce)
2017-08-23 18:43:12 -06:00
)
2019-12-07 20:23:31 -07:00
lazy val hub = module("hub",
2019-12-07 21:03:58 -07:00
Seq(common),
2019-12-14 07:51:39 -07:00
Seq(scaffeine)
2017-08-23 18:43:12 -06:00
)