lila/build.sbt

395 lines
14 KiB
Plaintext
Raw Normal View History

2017-08-23 18:43:12 -06:00
import com.typesafe.sbt.packager.Keys.scriptClasspath
import com.typesafe.sbt.SbtScalariform.autoImport.scalariformFormat
2017-08-23 18:43:12 -06:00
import com.typesafe.sbt.web.SbtWeb.autoImport._
import play.Play.autoImport._
import play.sbt.PlayImport._
2017-08-23 18:43:12 -06:00
import PlayKeys._
import BuildSettings._
import Dependencies._
lazy val root = Project("lila", file("."))
.enablePlugins(_root_.play.sbt.PlayScala)
.dependsOn(api)
.aggregate(api)
2017-08-23 18:47:35 -06:00
scalaVersion := globalScalaVersion
resolvers ++= Dependencies.Resolvers.commons
2017-10-21 12:33:22 -06:00
scalacOptions ++= compilerOptions
2017-08-23 18:47:35 -06:00
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,
2019-08-29 03:53:09 -06:00
maxmind, prismic, netty, guava, markdown,
kamon.core, kamon.influxdb, scalatags,
2019-07-09 16:54:00 -06:00
java8compat, semver, scrimage, scalaConfigs, scaffeine, lettuce, epoll
2017-08-23 18:47:35 -06:00
)
resourceDirectory in Assets := (sourceDirectory in Compile).value / "assets"
2018-12-12 09:09:30 -07:00
unmanagedResourceDirectories in Assets ++= (if (scala.sys.env.get("SERVE_ASSETS").exists(_ == "1")) Seq(baseDirectory.value / "public") else Nil)
2017-08-23 18:47:35 -06:00
2017-10-21 09:37:37 -06:00
scalariformPreferences := scalariformPrefs(scalariformPreferences.value)
excludeFilter in scalariformFormat := "*Routes*"
2017-08-23 18:43:12 -06:00
routesGenerator := LilaRoutesGenerator
2019-04-23 00:06:38 -06:00
2017-08-23 18:43:12 -06:00
lazy val modules = Seq(
common, db, rating, user, security, hub, socket,
2017-08-23 18:43:12 -06:00
message, notifyModule, i18n, game, bookmark, search,
gameSearch, timeline, forum, forumSearch, team, teamSearch,
analyse, mod, site, 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,
2018-04-15 15:26:36 -06:00
activity, relay, streamer, bot
2017-08-23 18:43:12 -06:00
)
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,
2017-08-23 18:43:12 -06:00
reactivemongo.driver, reactivemongo.iteratees,
2019-07-15 03:57:45 -06:00
kamon.core, kamon.influxdb, lettuce
),
aggregate in Runtime := false,
aggregate in Test := true // Test <: Runtime
2017-08-23 18:43:12 -06:00
) aggregate (moduleRefs: _*)
lazy val puzzle = module("puzzle", Seq(
2019-02-04 20:57:09 -07:00
common, memo, hub, history, db, user, rating, pref, tree, game
2017-08-23 18:43:12 -06:00
)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver, reactivemongo.iteratees)
2017-08-23 18:43:12 -06:00
)
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(
2017-12-27 21:56:36 -07:00
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val streamer = module("streamer", Seq(
2018-01-01 21:17:36 -07:00
common, hub, db, user, notifyModule
2017-12-27 21:56:36 -07:00
)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
2017-08-23 18:43:12 -06:00
)
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)
2017-08-23 18:43:12 -06:00
)
lazy val rating = module("rating", Seq(common, db, memo)).settings(
2017-08-23 18:43:12 -06:00
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val perfStat = module("perfStat", Seq(common, db, user, game, rating)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
2017-08-23 18:43:12 -06:00
)
lazy val history = module("history", Seq(common, db, memo, game, user)).settings(
2019-04-22 03:42:25 -06:00
libraryDependencies ++= provided(play.api, scalatags, reactivemongo.driver)
2017-08-23 18:43:12 -06:00
)
lazy val db = module("db", Seq(common)).settings(
2017-12-27 21:56:36 -07:00
libraryDependencies ++= provided(play.test, play.api, reactivemongo.driver, hasher, scrimage)
2017-08-23 18:43:12 -06:00
)
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(
2018-12-10 06:23:08 -07:00
libraryDependencies ++= provided(play.api, scalatags, reactivemongo.driver)
2017-08-23 18:43:12 -06:00
)
lazy val timeline = module("timeline", Seq(common, db, game, user, hub, security, relation)).settings(
libraryDependencies ++= provided(play.api, play.test, reactivemongo.driver)
2017-08-23 18:43:12 -06:00
)
2017-10-31 16:33:32 -06:00
lazy val event = module("event", Seq(common, db, memo, i18n)).settings(
2018-12-10 06:23:08 -07:00
libraryDependencies ++= provided(play.api, play.test, scalatags, reactivemongo.driver)
2017-08-23 18:43:12 -06:00
)
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)
2017-08-23 18:43:12 -06:00
)
lazy val user = module("user", Seq(common, memo, db, hub, rating)).settings(
2017-10-17 10:26:26 -06:00
libraryDependencies ++= provided(play.api, play.test, reactivemongo.driver, hasher,
reactivemongo.iteratees // only for bcrypt migration
)
2017-08-23 18:43:12 -06:00
)
lazy val game = module("game", Seq(common, memo, db, hub, user, chat)).settings(
libraryDependencies ++= provided(compression, play.api, reactivemongo.driver, reactivemongo.iteratees)
2017-08-23 18:43:12 -06:00
)
lazy val gameSearch = module("gameSearch", Seq(common, hub, search, game)).settings(
2017-08-23 18:43:12 -06:00
libraryDependencies ++= provided(
play.api, reactivemongo.driver, reactivemongo.iteratees
2017-08-23 18:43:12 -06:00
)
)
2018-03-31 08:04:18 -06:00
lazy val tv = module("tv", Seq(common, db, hub, socket, game, round, user)).settings(
2017-08-23 18:43:12 -06:00
libraryDependencies ++= provided(play.api, reactivemongo.driver, hasher)
)
2018-04-18 07:14:26 -06:00
lazy val bot = module("bot", Seq(common, db, hub, game, user, challenge, chat)).settings(
2018-04-15 15:26:36 -06:00
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)
2017-08-23 18:43:12 -06:00
)
lazy val round = module("round", Seq(
common, db, memo, hub, socket, game, user,
2017-08-23 18:43:12 -06:00
i18n, fishnet, pref, chat, history, playban
)).settings(
2018-12-10 06:23:08 -07:00
libraryDependencies ++= provided(play.api, scalatags, hasher, kamon.core,
reactivemongo.driver, reactivemongo.iteratees)
2017-08-23 18:43:12 -06:00
)
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,
2017-08-23 18:43:12 -06:00
round, timeline, relation, playban, security, pool
)).settings(
2019-07-17 03:21:05 -06:00
libraryDependencies ++= provided(play.api, reactivemongo.driver, lettuce)
2017-08-23 18:43:12 -06:00
)
lazy val setup = module("setup", Seq(
common, db, memo, hub, socket, game, user, lobby, pref, relation
2017-08-23 18:43:12 -06:00
)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val importer = module("importer", Seq(common, game, round)).settings(
2017-08-23 18:43:12 -06:00
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val insight = module(
"insight",
Seq(common, game, user, analyse, relation, pref, socket, round, security)
2017-08-23 18:43:12 -06:00
).settings(
libraryDependencies ++= provided(
2019-04-22 03:42:25 -06:00
play.api, reactivemongo.driver, reactivemongo.iteratees, scalatags
2017-08-23 18:43:12 -06:00
)
)
lazy val tournament = module("tournament", Seq(
common, hub, socket, game, round, security, chat, memo, quote, history, notifyModule, i18n
2017-08-23 18:43:12 -06:00
)).settings(
libraryDependencies ++= provided(
2018-12-10 06:23:08 -07:00
play.api, scalatags, reactivemongo.driver, reactivemongo.iteratees
2017-08-23 18:43:12 -06:00
)
)
lazy val simul = module("simul", Seq(
common, hub, socket, game, round, chat, memo, quote
2017-08-23 18:43:12 -06:00
)).settings(
2019-07-17 03:21:05 -06:00
libraryDependencies ++= provided(play.api, reactivemongo.driver)
2017-08-23 18:43:12 -06:00
)
lazy val fishnet = module("fishnet", Seq(common, game, analyse, db, evalCache)).settings(
2017-08-23 18:43:12 -06:00
libraryDependencies ++= provided(play.api, reactivemongo.driver, semver)
)
lazy val irwin = module("irwin", Seq(common, db, user, game, tournament, mod)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
2017-08-23 18:43:12 -06:00
)
lazy val oauth = module("oauth", Seq(common, db, user)).settings(
2018-04-29 21:10:01 -06:00
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val security = module("security", Seq(common, hub, db, user, i18n, slack, oauth)).settings(
2018-12-10 06:23:08 -07:00
libraryDependencies ++= provided(play.api, scalatags, reactivemongo.driver, maxmind, hasher)
2017-08-23 18:43:12 -06:00
)
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)).settings(
2018-12-10 06:23:08 -07:00
libraryDependencies ++= provided(play.api, scalatags, reactivemongo.driver)
2017-08-23 18:43:12 -06:00
)
lazy val study = module("study", Seq(
2019-08-24 02:58:39 -06:00
common, db, hub, socket, game, round, importer, notifyModule, relation, evalCache, explorer, i18n
2017-08-23 18:43:12 -06:00
)).settings(
2019-08-24 02:58:39 -06:00
libraryDependencies ++= provided(play.api, scalatags, reactivemongo.driver)
2017-08-23 18:43:12 -06:00
)
2017-09-19 20:24:59 -06:00
lazy val relay = module("relay", Seq(common, study)).settings(
2019-08-29 03:53:09 -06:00
libraryDependencies ++= Seq(scalaUri) ++ provided(play.api, reactivemongo.driver, markdown)
2017-09-19 20:24:59 -06:00
)
2017-08-23 18:43:12 -06:00
lazy val studySearch = module("studySearch", Seq(common, hub, study, search)).settings(
libraryDependencies ++= provided(
play.api,
reactivemongo.driver, reactivemongo.iteratees
2017-08-23 18:43:12 -06:00
)
)
lazy val learn = module("learn", Seq(common, db, user)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
2017-08-23 18:43:12 -06:00
)
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(
2017-08-23 18:43:12 -06:00
libraryDependencies ++= provided(play.api, reactivemongo.driver)
)
lazy val push = module("push", Seq(common, db, user, game, challenge, message)).settings(
libraryDependencies ++= 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)
2017-08-23 18:43:12 -06:00
)
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)
2017-08-23 18:43:12 -06:00
)
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
2017-08-23 18:43:12 -06:00
)
)
lazy val team = module("team", Seq(common, memo, db, user, forum, security, hub, notifyModule)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver, reactivemongo.iteratees)
2017-08-23 18:43:12 -06:00
)
lazy val teamSearch = module("teamSearch", Seq(common, hub, team, search)).settings(
libraryDependencies ++= provided(
play.api,
reactivemongo.driver, reactivemongo.iteratees
2017-08-23 18:43:12 -06:00
)
)
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"),
2019-06-12 08:49:38 -06:00
dbs = List("site", "arena", "emails", "learn", "activity", "coordinates", "study"),
2017-08-23 18:43:12 -06:00
compileTo = (sourceManaged in Compile).value / "messages"
)
}.taskValue,
2018-12-10 06:23:08 -07:00
libraryDependencies ++= provided(play.api, scalatags)
2017-08-23 18:43:12 -06:00
)
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(
2017-12-04 10:40:44 -07:00
libraryDependencies ++= provided(play.api, reactivemongo.driver, reactivemongo.iteratees)
2017-08-23 18:43:12 -06:00
)
2017-09-18 20:03:23 -06:00
lazy val explorer = module("explorer", Seq(common, db, game, importer)).settings(
2017-08-23 18:43:12 -06:00
libraryDependencies ++= provided(
play.api,
reactivemongo.driver, reactivemongo.iteratees
2017-08-23 18:43:12 -06:00
)
)
lazy val notifyModule = module("notify", Seq(common, db, game, user, hub, relation)).settings(
libraryDependencies ++= provided(play.api, reactivemongo.driver)
2017-08-23 18:43:12 -06:00
)
lazy val site = module("site", Seq(common, socket)).settings(
2019-07-15 03:57:45 -06:00
libraryDependencies ++= provided(play.api, lettuce)
2017-08-23 18:43:12 -06:00
)
lazy val tree = module("tree", Seq(common)).settings(
2017-08-23 18:43:12 -06:00
libraryDependencies ++= provided(play.api)
)
lazy val socket = module("socket", Seq(common, hub, memo, tree)).settings(
libraryDependencies ++= provided(play.api, lettuce)
2017-08-23 18:43:12 -06:00
)
lazy val hub = module("hub", Seq(common)).settings(
2018-08-21 05:19:59 -06:00
libraryDependencies ++= Seq(scaffeine) ++ provided(play.api)
2017-08-23 18:43:12 -06:00
)