Skip to content

Lichess Development With Bloop

nav-28 edited this page Dec 21, 2022 · 14 revisions

Bloop for hacking lila scala code

bloop is a build server. It's the best way to work on lila.

Install it with your package manager and create a userland systemd service for it.

systemctl --user enable bloop
systemctl --user start bloop

After being set up (sbt bloopInstall), bloop can be used to build lila (bloop compile lila) and run it (bloop run lila -m lila.app.Lila -c /path/to/lila/.bloop).

I like to run my local lila as a systemd service, and to restart it by pressing F1. I also have a service notifying me when the restart completes or fail.

You can interface bloop with your text editor using scala metals. You gain full IDE support: incremental compilation, warning and error reports, jump to definition, global renaming, etc. This supports vim, emacs, atom, visual studio, sublime and more. I highly recommend using it.

For details about my setup and vim configs, checkout my dotfiles repository.

My vim setup for hacking lila scala code

bloop will also happily compile and run scalachess, lila-ws, lila-fishnet and probably any scala project.

Known issues

  • bloop doesn't know about translation xmls. When one is modified, you need to do bloop clean i18n from the project root and restart lila to pick it up.
  • bloop doesn't watch and recompile playframework routes. Until we find a way to fix that (can you help?), the workaround after editing conf/routes is to run sbt playRoutes.
  • The bloop CLI does not currently install via homebrew on M1 Macs. However, you should still be able to install bloop (non-CLI) by installing Metals with VSCode. Note that you will not be able to run bloop commands from the terminal.