Bloop

This plugin generates bloop configuration from your build file, which lets you use the bloop CLI for compiling, and makes your scala code editable in Metals

Quickstart

In your terminal:

Generate Bloop project configuration
> mill --import ivy:com.lihaoyi::mill-contrib-bloop:  mill.contrib.bloop.Bloop/install

It generate correct bloop config for any JavaModule, ScalaModule, ScalaJsModule or ScalaNativeModule under the .bloop folder

Mix-in

You can mix-in the Bloop.Module trait with any JavaModule to quickly access the deserialised configuration for that particular module:

build.sc
import $ivy.`com.lihaoyi::mill-contrib-bloop:`

import mill._
import mill.scalalib._
import mill.contrib.bloop.Bloop

object MyModule extends ScalaModule with Bloop.Module {
  def myTask = T { bloop.config() }
}

Note regarding metals

Metals will automatically detect your mill workspace and generate the necessary files that bloop needs. You don’t need to manually include the bloop plugin in order for this to work. Also note that your mill/ammonite related .sc files are only partially supported by metals when located inside a project workspace.

Note regarding current mill support in bloop

The mill-bloop integration currently present in the bloop codebase will be deprecated in favour of this implementation.